YouTube Embed - Version 2.5.1

Version Description

  • Bug: Fixed a bug with Admin Bar when using WP 3.1 - 3.3 (thanks to Carl D'Halluin for finding this)
Download this release

Release Info

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

Code changes from version 2.6.2 to 2.5.1

Files changed (57) hide show
  1. css/aye-admin UNCOMPRESSED.css +17 -0
  2. css/aye-admin-3.1.css +0 -47
  3. css/aye-admin-3.1.min.css +0 -1
  4. css/aye-admin.css +1 -50
  5. css/aye-admin.min.css +0 -1
  6. css/{aye-main.css → aye-dynamic UNCOMPRESSED.css} +0 -0
  7. css/{aye-main.min.css → aye-dynamic.css} +0 -0
  8. css/aye-tinymce-button UNCOMPRESSED.css +6 -0
  9. css/aye-tinymce-button-3.1 UNCOMPRESSED.css +3 -0
  10. css/aye-tinymce-button-3.1.css +1 -0
  11. css/aye-tinymce-button.css +1 -0
  12. images/Facebook.png +0 -0
  13. images/Google+.png +0 -0
  14. images/RSS.png +0 -0
  15. images/Thumbs.db +0 -0
  16. images/Twitter.png +0 -0
  17. images/themefuse_banner.jpg +0 -0
  18. includes/artiss-plugin-ads.php +0 -172
  19. includes/aye-add-mce-button.php +3 -12
  20. includes/aye-add-scripts.php +9 -28
  21. includes/aye-add-to-admin-bar.php +43 -54
  22. includes/aye-admin-config.php +92 -107
  23. includes/aye-deprecated.php +1 -1
  24. includes/aye-display-about.php +17 -27
  25. includes/aye-display-instructions.php +0 -31
  26. includes/aye-display-readme.php +26 -0
  27. includes/aye-function-calls.php +7 -7
  28. includes/aye-generate-download-code.php +2 -2
  29. includes/aye-generate-embed-code.php +620 -627
  30. includes/aye-generate-shorturl-code.php +2 -2
  31. includes/aye-generate-thumbnail-code.php +10 -16
  32. includes/aye-generate-transcript-code.php +2 -2
  33. includes/aye-generate-widgets.php +133 -133
  34. includes/aye-options-general.php +109 -176
  35. includes/aye-options-lists.php +20 -26
  36. includes/aye-options-profiles.php +168 -175
  37. includes/aye-options-widgets.php +43 -37
  38. includes/aye-set-defaults.php +36 -93
  39. includes/aye-shared-functions.php +15 -71
  40. includes/aye-shortcodes.php +7 -7
  41. js/aye-ga-tracker UNCOMPRESSED.js +3 -0
  42. js/aye-ga-tracker.js +1 -0
  43. js/{aye-mce-button.php → aye-mce-button UNCOMPRESSED.js } +1 -11
  44. js/aye-mce-button.js +1 -0
  45. js/aye-mce-button.min.php +0 -3
  46. languages/youtube-embed.mo +0 -0
  47. languages/youtube-embed.po +312 -454
  48. readme.txt +16 -117
  49. screenshot-1.png +0 -0
  50. screenshot-2.png +0 -0
  51. screenshot-3.png +0 -0
  52. screenshot-4.png +0 -0
  53. screenshot-5.png +0 -0
  54. screenshot-6.png +0 -0
  55. screenshot-7.png +0 -0
  56. uninstall.php +3 -18
  57. youtube-embed.php +14 -19
css/aye-admin UNCOMPRESSED.css ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ytbox_grey {
2
+ background-color: #f1f1f1;
3
+ padding: 10px;
4
+ border: 1px solid #ddd;
5
+ }
6
+ .yt_heading {
7
+ font-weight: bold;
8
+ font-size: 1.1em;
9
+ }
10
+
11
+ #np-notepad ul {
12
+ list-style: disc;
13
+ }
14
+
15
+ #np-notepad ul, ol {
16
+ margin-left: 60px;
17
+ }
css/aye-admin-3.1.css DELETED
@@ -1,47 +0,0 @@
1
-
2
- /* Administration screen styles */
3
-
4
- .ytbox_grey {
5
- background-color: #f1f1f1;
6
- padding: 10px;
7
- border: 1px solid #ddd;
8
- }
9
- .yt_heading {
10
- font-weight: bold;
11
- font-size: 1.1em;
12
- }
13
-
14
- #np-notepad ul {
15
- list-style: disc;
16
- }
17
-
18
- #np-notepad ul, ol {
19
- margin-left: 60px;
20
- }
21
-
22
-
23
- /* Video dynamic resizing */
24
-
25
- .ye-container {
26
- position: relative;
27
- padding-bottom: 56.25%;
28
- padding-top: 30px;
29
- height: 0;
30
- overflow: hidden;
31
- }
32
-
33
- .ye-container iframe,
34
- .ye-container object,
35
- .ye-container embed {
36
- position: absolute;
37
- top: 0;
38
- left: 0;
39
- width: 100%;
40
- height: 100%;
41
- }
42
-
43
- /* TinyMCE button 3.1 */
44
-
45
- .wp_themeSkin span.mce_YouTube {
46
- background:url('../images/youtube_button_colour.png') no-repeat 0 0;
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/aye-admin-3.1.min.css DELETED
@@ -1 +0,0 @@
1
- .ytbox_grey{background-color:#f1f1f1;padding:10px;border:1px solid #ddd;}.yt_heading{font-weight:bold;font-size:1.1em;}#np-notepad ul{list-style:disc;}#np-notepad ul,ol{margin-left:60px;}.ye-container{position:relative;padding-bottom:56.25%;padding-top:30px;height:0;overflow:hidden;}.ye-container iframe,.ye-container object,.ye-container embed{position:absolute;top:0;left:0;width:100%;height:100%;}.wp_themeSkin span.mce_YouTube{background:url('../images/youtube_button_colour.png') no-repeat 0 0;}
 
css/aye-admin.css CHANGED
@@ -1,50 +1 @@
1
-
2
- /* Administration screen styles */
3
-
4
- .ytbox_grey {
5
- background-color: #f1f1f1;
6
- padding: 10px;
7
- border: 1px solid #ddd;
8
- }
9
- .yt_heading {
10
- font-weight: bold;
11
- font-size: 1.1em;
12
- }
13
-
14
- #np-notepad ul {
15
- list-style: disc;
16
- }
17
-
18
- #np-notepad ul, ol {
19
- margin-left: 60px;
20
- }
21
-
22
-
23
- /* Video dynamic resizing */
24
-
25
- .ye-container {
26
- position: relative;
27
- padding-bottom: 56.25%;
28
- padding-top: 30px;
29
- height: 0;
30
- overflow: hidden;
31
- }
32
-
33
- .ye-container iframe,
34
- .ye-container object,
35
- .ye-container embed {
36
- position: absolute;
37
- top: 0;
38
- left: 0;
39
- width: 100%;
40
- height: 100%;
41
- }
42
-
43
- /* TinyMCE button */
44
-
45
- .wp_themeSkin span.mce_YouTube {
46
- background:url('../images/youtube_button_b&w.png') no-repeat 0 0;
47
- }
48
- .wp_themeSkin span.mce_YouTube:hover {
49
- background:url('../images/youtube_button_colour.png') no-repeat 0 0;
50
- }
1
+ .ytbox_grey{background-color:#f1f1f1;padding:10px;border:1px solid #ddd;}.yt_heading{font-weight:bold;font-size:1.1em;}#np-notepad ul{list-style:disc;}#np-notepad ul,ol{margin-left:60px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/aye-admin.min.css DELETED
@@ -1 +0,0 @@
1
- .ytbox_grey{background-color:#f1f1f1;padding:10px;border:1px solid #ddd;}.yt_heading{font-weight:bold;font-size:1.1em;}#np-notepad ul{list-style:disc;}#np-notepad ul,ol{margin-left:60px;}.ye-container{position:relative;padding-bottom:56.25%;padding-top:30px;height:0;overflow:hidden;}.ye-container iframe,.ye-container object,.ye-container embed{position:absolute;top:0;left:0;width:100%;height:100%;}.wp_themeSkin span.mce_YouTube{background:url('../images/youtube_button_b&w.png') no-repeat 0 0;}.wp_themeSkin span.mce_YouTube:hover{background:url('../images/youtube_button_colour.png') no-repeat 0 0;}
 
css/{aye-main.css → aye-dynamic UNCOMPRESSED.css} RENAMED
File without changes
css/{aye-main.min.css → aye-dynamic.css} RENAMED
File without changes
css/aye-tinymce-button UNCOMPRESSED.css ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ .wp_themeSkin span.mce_YouTube {
2
+ background:url('../images/youtube_button_b&w.png') no-repeat 0 0;
3
+ }
4
+ .wp_themeSkin span.mce_YouTube:hover {
5
+ background:url('../images/youtube_button_colour.png') no-repeat 0 0;
6
+ }
css/aye-tinymce-button-3.1 UNCOMPRESSED.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ .wp_themeSkin span.mce_YouTube {
2
+ background:url('../images/youtube_button_colour.png') no-repeat 0 0;
3
+ }
css/aye-tinymce-button-3.1.css ADDED
@@ -0,0 +1 @@
 
1
+ .wp_themeSkin span.mce_YouTube{background:url('../images/youtube_button_colour.png') no-repeat 0 0;}
css/aye-tinymce-button.css ADDED
@@ -0,0 +1 @@
 
1
+ .wp_themeSkin span.mce_YouTube{background:url('../images/youtube_button_b&w.png') no-repeat 0 0;}.wp_themeSkin span.mce_YouTube:hover{background:url('../images/youtube_button_colour.png') no-repeat 0 0;}
images/Facebook.png ADDED
Binary file
images/Google+.png ADDED
Binary file
images/RSS.png ADDED
Binary file
images/Thumbs.db DELETED
Binary file
images/Twitter.png ADDED
Binary file
images/themefuse_banner.jpg ADDED
Binary file
includes/artiss-plugin-ads.php DELETED
@@ -1,172 +0,0 @@
1
- <?php
2
- /**
3
- * Artiss Plugin Ads (1.3)
4
- *
5
- * Generate an advert - intended for use within Artiss plugin administration screens/
6
- * All output is responsive and is image based.
7
- * No data is sent back to an external website (unless links are clicked on).
8
- *
9
- */
10
-
11
- /**
12
- * Generate Ad Code
13
- *
14
- * Combine 2 ads and add additional information
15
- *
16
- * @param string trans Translation name
17
- * @param string width Width of output
18
- * @uses artiss_fetch_ad_code Get a random advert
19
- */
20
-
21
- function artiss_plugin_ads( $trans, $width = 750 ) {
22
-
23
- $advertisers = 5;
24
-
25
- // Get first advert
26
-
27
- $ad_array = artiss_fetch_ad_code( rand( 1, $advertisers ) );
28
- $code1 = $ad_array[ 'code' ];
29
-
30
- // Now choose another advertiser
31
-
32
- $next_ad = $ad_array[ 'ad' ] + 1;
33
- if ( $next_ad > $advertisers ) { $next_ad = 1; }
34
-
35
- // Get a second advert
36
-
37
- $ad_array = artiss_fetch_ad_code( $next_ad );
38
- $code2 = $ad_array[ 'code' ];
39
-
40
- // Generate the advert code
41
-
42
- $newline = "\n";
43
-
44
- $code = '<p><div style="width: ' . $width . 'px; height: 125px; border: 1px solid #ddd; padding: 10px;">' . $newline;
45
- $code .= $code1 . $newline . $code2 . $newline;
46
- $code .= '<span style="font-weight: bold">' . __( 'Donate', $trans ) . '</span>' . $newline;
47
- $code .= '<br/>' . __( 'If you like this plugin and appreciate the effort being put into it, <a href="http://www.artiss.co.uk/donate">please consider donating</a>.', $trans ) . '<br/>' . $newline;
48
- $code .= '<br/><span style="font-weight: bold">' . __( 'Follow Me', $trans ) . '</span>' . $newline;
49
- $code .= '<br/>' . __( 'Please stay in touch with the latest news via one of the following social streams...', $trans ) . '<br/>' . $newline;
50
- $code .= '<div align="center" style="padding-top: 10px;">' . $newline;
51
- $code .= '<a href="http://www.twitter.com/artiss_tech"><img src="https://dl.dropbox.com/u/61522/Artiss.co.uk/Plugins/ads/Twitter.png" alt="' . __( 'Follow Artiss.co.uk on Twitter', $trans ) . '" title="' . __( 'Follow Artiss.co.uk on Twitter', $trans ) . '" style="margin-right: 20px;"></a>' . $newline;
52
- $code .= '<a href="http://www.facebook.com/artiss.co.uk"><img src="https://dl.dropbox.com/u/61522/Artiss.co.uk/Plugins/ads/Facebook.png" alt="' . __( 'Follow Artiss.co.uk on Facebook', $trans ) . '" title="' . __( 'Follow Artiss.co.uk on Facebook', $trans ) . '" style="margin-right: 20px;"></a>' . $newline;
53
- $code .= '<a href="https://plus.google.com/108446415028687420620?rel=author"><img src="https://dl.dropbox.com/u/61522/Artiss.co.uk/Plugins/ads/Google%2B.png" alt="' . __( 'Follow Artiss.co.uk on Google+', $trans ) . '" title="' . __( 'Follow Artiss.co.uk on Google+', $trans ) . '" style="margin-right: 20px;"></a>' . $newline;
54
- $code .= '<a href="http://www.artiss.co.uk/feed"><img src="https://dl.dropbox.com/u/61522/Artiss.co.uk/Plugins/ads/RSS.png" alt="' . __( 'Follow Artiss.co.uk on RSS feed', $trans ) . '" title="' . __( 'Follow Artiss.co.uk on RSS feed', $trans ) . '"></a>' . $newline;
55
- $code .= '</div></div></p>' . $newline;
56
-
57
- echo $code;
58
- return;
59
- }
60
-
61
- /**
62
- * Get a random advert
63
- *
64
- * Picks a random advert and generated the code for it
65
- *
66
- * @return array Code and advert numbers
67
- */
68
-
69
- function artiss_fetch_ad_code( $ad_number ) {
70
-
71
- $sub_ad = '';
72
-
73
- // iThemes
74
-
75
- if ( $ad_number == 1 ) {
76
-
77
- $sub_ad = rand( 1, 9 );
78
-
79
- if ( $sub_ad == 1 ) { $ad_code = '<a rel="nofollow" href="http://ithemes.com/member/go.php?r=32106&i=b0"><img src="http://ithemes.com/wp-content/uploads/2008/02/ithemes125ad.gif" border=0 alt="WordPress Themes" width=125 height=125></a>'; }
80
-
81
- if ( $sub_ad == 2 ) { $ad_code = '<a href="http://ithemes.com/member/go.php?r=32106&i=b1"><img src="http://ithemes.com/wp-content/uploads/2008/11/ithemes-ad1.jpg" border=0 alt="WordPress Themes" width=125 height=125></a>'; }
82
-
83
- if ( $sub_ad == 3 ) { $ad_code = '<a href="http://ithemes.com/member/go.php?r=32106&i=b2"><img src="http://ithemes.com/wp-content/uploads/2009/02/flexx125x125.jpg" border=0 alt="Flexx WP Blog Theme" width=125 height=125></a>'; }
84
-
85
- if ( $sub_ad == 4 ) { $ad_code = '<a href="http://ithemes.com/member/go.php?r=32106&i=b5"><img src="http://ithemes.com/graphics/allaccessad1.jpg" border=0 alt="All Access Pass - 30+ WP Themes" width=125 height=125></a>'; }
86
-
87
- if ( $sub_ad == 5 ) { $ad_code = '<a href="http://ithemes.com/member/go.php?r=32106&i=b15"><img src="http://ithemes.com/graphics/backupbuddy-125.gif" border=0 alt="Backup WordPress Easily" width=125 height=125></a>'; }
88
-
89
- if ( $sub_ad == 6 ) { $ad_code = '<a href="http://ithemes.com/member/go.php?r=32106&i=b17"><img src="http://ithemes.com/graphics/pluginbuddy_ads/pb-mobile-static.png" border=0 alt="PluginBuddy Mobile" width=125 height=125></a>'; }
90
-
91
- if ( $sub_ad == 7 ) { $ad_code = '<a href="http://ithemes.com/member/go.php?r=32106&i=b23"><img src="http://ithemes.com/graphics/builder-ads/builderforum125.png" border=0 alt="iThemes Builder" width=125 height=125></a>'; }
92
-
93
- if ( $sub_ad == 8 ) { $ad_code = '<a href="http://ithemes.com/member/go.php?r=32106&i=b25"><img src="http://ithemes.com/graphics/pluginbuddy_ads/ebuddy-125.png" border=0 alt="EmailBuddy" width=125 height=125></a>'; }
94
-
95
- if ( $sub_ad == 9 ) { $ad_code = '<a href="http://ithemes.com/member/go.php?r=32106&i=b27"><img src="http://affiliates.ithemes.com/files/2010/11/fxEa.loopbuddy125.png" border=0 alt="LoopBuddy from PluginBuddy.com" width=125 height=125></a>'; }
96
-
97
- }
98
-
99
- // Tribulant
100
-
101
- if ( $ad_number == 2 ) {
102
-
103
- $sub_ad = rand( 1, 7 );
104
-
105
- if ( $sub_ad == 1 ) { $ad_code = '<a href="http://tribulant.com/plugins/view/10/wordpress-shopping-cart-plugin?a_aid=artisscouk&amp;a_bid=67d9e505" target=""><img src="http://tribulant.postaffiliatepro.com/accounts/default1/banners/shopping-cart-small.jpg" alt="wordpress-shopping-cart-plugin" title="wordpress-shopping-cart-plugin" width="125" height="125" /></a>'; }
106
-
107
- if ( $sub_ad == 2 ) { $ad_code = '<a href="http://tribulant.com/plugins/view/1/wordpress-mailing-list-plugin?a_aid=artisscouk&amp;a_bid=48d79f09" target=""><img src="http://tribulant.postaffiliatepro.com/accounts/default1/banners/newsletter-small.jpg" alt="wordpress-newsletters-plugin" title="wordpress-newsletters-plugin" width="125" height="125" /></a>'; }
108
-
109
- if ( $sub_ad == 3 ) { $ad_code = '<a href="http://tribulant.com/products/view/12/wordpress-whois-plugin?a_aid=artisscouk&amp;a_bid=4d629414" target=""><img src="http://tribulant.postaffiliatepro.com/accounts/default1/banners/domain-whois-small.jpg" alt="wordpress-whois-plugin" title="wordpress-whois-plugin" width="125" height="125" /></a>'; }
110
-
111
- if ( $sub_ad == 4 ) { $ad_code = '<a href="http://tribulant.com/products/view/9/wordpress-lightbox-plugin?a_aid=artisscouk&amp;a_bid=9acc8d37" target=""><img src="http://tribulant.postaffiliatepro.com/accounts/default1/banners/lightbox-js-small.jpg" alt="wordpress-lightbox-js-plugin" title="wordpress-lightbox-js-plugin" width="125" height="125" /></a>'; }
112
-
113
- if ( $sub_ad == 5 ) { $ad_code = '<a href="http://tribulant.com/plugins/view/8/wordpress-faqs-plugin?a_aid=artisscouk&amp;a_bid=b9082471" target=""><img src="http://tribulant.postaffiliatepro.com/accounts/default1/banners/questions-small.jpg" alt="wordpress-faqs-plugin" title="wordpress-faqs-plugin" width="125" height="125" /></a>'; }
114
-
115
- if ( $sub_ad == 6 ) { $ad_code = '<a href="http://tribulant.com/plugins/view/7/wordpress-custom-fields-plugin?a_aid=artisscouk&amp;a_bid=38fc0021" target=""><img src="http://tribulant.postaffiliatepro.com/accounts/default1/banners/custom-fields-small.jpg" alt="wordpress-custom-fields-plugin" title="wordpress-custom-fields-plugin" width="125" height="125" /></a>'; }
116
-
117
- if ( $sub_ad == 7 ) { $ad_code = '<a href="http://tribulant.com/plugins/view/2/wordpress-banner-rotator-plugin?a_aid=artisscouk&amp;a_bid=418973f2" target=""><img src="http://tribulant.postaffiliatepro.com/accounts/default1/banners/banner-rotator-small.jpg" alt="wordpress-banners-plugin" title="wordpress-banners-plugin" width="125" height="125" /></a>'; }
118
-
119
- }
120
-
121
- // WP Download Manager
122
-
123
- if ( $ad_number == 3 ) {
124
-
125
- $sub_ad = rand( 1, 3 );
126
-
127
- $ad_code = '<a href="http://www.wpdownloadmanager.com/?affid=dartiss" target="_top"><img src="https://dl.dropbox.com/u/61522/Artiss.co.uk/Plugins/ads/webMkt_banner_125x125_' . $sub_ad . '.jpg" alt="WP Download Manager" title="WP Download Manager" width="125" height="125" /></a>';
128
-
129
- }
130
-
131
- // Solostream
132
-
133
- if ( $ad_number == 4 ) {
134
-
135
- $sub_ad = rand( 1, 2 );
136
-
137
- if ( $sub_ad == 1 ) { $ad_code = '<a href="http://www.solostream.com/amember/go.php?r=7855&i=b0"><img src="http://www.solostream.com/images/solo-banner-125-1.gif" border=0 alt="Premium WordPress Themes" width=125 height=125 /></a>'; }
138
-
139
- if ( $sub_ad == 2 ) { $ad_code = '<a href="http://www.solostream.com/amember/go.php?r=7855&i=b1"><img src="http://www.solostream.com/images/solo-banner-125-2.gif" border=0 alt="Premium WordPress Themes" width=125 height=125 /></a>'; }
140
-
141
- }
142
-
143
- // ManageWP
144
-
145
- if ( $ad_number == 5 ) {
146
-
147
- $sub_ad = rand( 1, 2 );
148
-
149
- if ( $sub_ad == 1 ) { $ad_code = '<a href="https://managewp.com/?utm_source=A&utm_medium=Banner&utm_content=mwp_banner_4_125x125&utm_campaign=A&utm_mrl=52"><img src="https://managewp.com/banners/affiliate/mwp_banner_4_125x125.jpg" /></a>'; }
150
-
151
- if ( $sub_ad == 2 ) { $ad_code = '<a href="https://managewp.com/?utm_source=A&utm_medium=Banner&utm_content=mwp_banner_5_125x125&utm_campaign=A&utm_mrl=52"><img src="https://managewp.com/banners/affiliate/mwp_banner_5_125x125.jpg" /></a>'; }
152
-
153
- }
154
-
155
- // Add NOFOLLOW to the ad
156
-
157
- $ad_code = '<a rel="nofollow"' . substr( $ad_code, 2 );
158
-
159
- // Add STYLE to image
160
-
161
- $pos = strpos( $ad_code, '<img ' );
162
- $ad_code = substr( $ad_code, 0, $pos + 5 ) . 'style="float: left; padding-right: 10px;" ' . substr( $ad_code, $pos + 5 );
163
-
164
- // Add the details into an array and return it
165
-
166
- $return[ 'code' ] = $ad_code;
167
- $return[ 'ad' ] = $ad_number;
168
- $return[ 'sub-ad' ] = $sub_ad;
169
-
170
- return $return;
171
- }
172
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/aye-add-mce-button.php CHANGED
@@ -19,19 +19,10 @@
19
 
20
  function youtube_embed_button() {
21
 
22
- // Ensure user is in rich editor and button option is switched on
23
-
24
- if ( get_user_option( 'rich_editing' ) == 'true' ) {
25
-
26
  $options = aye_set_general_defaults();
27
- if ( $options[ 'editor_button' ] != '' ) {
28
-
29
- // Ensure shortcode cookie is set
30
-
31
- $editor_sc = aye_set_editor_sc();
32
-
33
- // Add filters
34
 
 
35
  add_filter( 'mce_external_plugins', 'add_youtube_embed_mce_plugin' );
36
  add_filter( 'mce_buttons', 'register_youtube_embed_button' );
37
  }
@@ -67,7 +58,7 @@ function register_youtube_embed_button( $buttons ) {
67
  */
68
 
69
  function add_youtube_embed_mce_plugin( $plugin_array ) {
70
- $plugin_array[ 'YouTube' ] = plugins_url() . '/youtube-embed/js/aye-mce-button.min.php';
71
  return $plugin_array;
72
  }
73
  ?>
19
 
20
  function youtube_embed_button() {
21
 
22
+ if ( current_user_can( 'edit_posts' ) ) {
 
 
 
23
  $options = aye_set_general_defaults();
 
 
 
 
 
 
 
24
 
25
+ if ( ( get_user_option( 'rich_editing' ) == 'true' ) && ( $options[ 'editor_button' ] != '' ) ) {
26
  add_filter( 'mce_external_plugins', 'add_youtube_embed_mce_plugin' );
27
  add_filter( 'mce_buttons', 'register_youtube_embed_button' );
28
  }
58
  */
59
 
60
  function add_youtube_embed_mce_plugin( $plugin_array ) {
61
+ $plugin_array[ 'YouTube' ] = plugins_url() . '/youtube-embed/js/aye-mce-button.js';
62
  return $plugin_array;
63
  }
64
  ?>
includes/aye-add-scripts.php CHANGED
@@ -7,31 +7,6 @@
7
  * @package Artiss-YouTube-Embed
8
  */
9
 
10
- // Switch on shortcodes in widgets, if requested
11
-
12
- if ( !is_admin() ) {
13
- $options = get_option( 'youtube_embed_general' );
14
- if ( $options[ 'widgets' ] == 1 ) { add_filter( 'widget_text', 'do_shortcode', SHORTCODE_PRIORITY ); }
15
- }
16
-
17
- /**
18
- * Plugin initialisation
19
- *
20
- * Loads the plugin's translated strings and the plugins' JavaScript
21
- *
22
- * @since 2.5.5
23
- */
24
-
25
- function aye_plugin_init() {
26
-
27
- $language_dir = plugin_basename( dirname( __FILE__ ) ) . '/languages/';
28
-
29
- load_plugin_textdomain( 'youtube-embed', false, $language_dir );
30
-
31
- }
32
-
33
- add_action( 'init', 'aye_plugin_init' );
34
-
35
  /**
36
  * Add scripts to theme
37
  *
@@ -42,9 +17,11 @@ add_action( 'init', 'aye_plugin_init' );
42
 
43
  function aye_main_scripts() {
44
 
45
- wp_register_style( 'aye_dynamic', plugins_url( '/youtube-embed/css/aye-main.min.css' ) );
 
 
46
 
47
- wp_enqueue_style( 'aye_dynamic' );
48
 
49
  }
50
 
@@ -60,10 +37,14 @@ add_action( 'wp_enqueue_scripts', 'aye_main_scripts' );
60
 
61
  function aye_admin_css() {
62
 
 
 
 
 
63
  global $wp_version;
64
  if ( ( float ) $wp_version >= 3.2 ) { $version = ''; } else { $version = '-3.1'; }
65
 
66
- wp_enqueue_style( 'tinymce_button', plugins_url() . '/youtube-embed/css/aye-admin' . $version . '.min.css' );
67
 
68
  }
69
 
7
  * @package Artiss-YouTube-Embed
8
  */
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  /**
11
  * Add scripts to theme
12
  *
17
 
18
  function aye_main_scripts() {
19
 
20
+ wp_enqueue_script( 'aye_ga_js', plugins_url( '/youtube-embed/js/aye-ga-tracker.js' ) );
21
+
22
+ wp_register_style( 'aye_dynamic', plugins_url( '/youtube-embed/css/aye-dynamic.css' ) );
23
 
24
+ wp_enqueue_style( 'aye_dynamic' );
25
 
26
  }
27
 
37
 
38
  function aye_admin_css() {
39
 
40
+ wp_enqueue_style( 'aye_admin', plugins_url() . '/youtube-embed/css/aye-admin.css' );
41
+
42
+ wp_enqueue_style( 'aye_dynamic', plugins_url() . '/youtube-embed/css/aye-dynamic.css' );
43
+
44
  global $wp_version;
45
  if ( ( float ) $wp_version >= 3.2 ) { $version = ''; } else { $version = '-3.1'; }
46
 
47
+ wp_enqueue_style( 'tinymce_button', plugins_url() . '/youtube-embed/css/aye-tinymce-button' . $version . '.css' );
48
 
49
  }
50
 
includes/aye-add-to-admin-bar.php CHANGED
@@ -21,9 +21,9 @@
21
 
22
  function aye_admin_bar_render_3_1() {
23
 
24
- global $wp_version;
25
 
26
- if ( current_user_can( 'delete_plugins' ) && ( ( float ) $wp_version >= 3.1 ) && ( ( float ) $wp_version < 3.3 ) ) {
27
 
28
  $options = aye_set_general_defaults();
29
 
@@ -33,8 +33,8 @@ function aye_admin_bar_render_3_1() {
33
  $wp_admin_bar -> add_menu( array(
34
  'parent' => 'appearance',
35
  'id' => 'aye-options',
36
- 'title' => __( 'YouTube Embed', 'youtube-embed' ),
37
- 'href' => admin_url( 'admin.php?page=aye-profile-options' ),
38
  'meta' => false ) );
39
  }
40
  }
@@ -55,63 +55,52 @@ add_action( 'wp_before_admin_bar_render', 'aye_admin_bar_render_3_1' );
55
 
56
  function aye_admin_bar_render_3_3( $meta = TRUE ) {
57
 
58
- global $wp_version;
59
 
60
- if ( ( float ) $wp_version >= 3.3 ) {
61
 
62
- $options = aye_set_general_defaults();
63
 
64
- $profile_access = $options[ 'profile_access' ];
65
- $list_access = $options[ 'list_access' ];
66
 
67
- if ( $options[ 'admin_bar' ] != '' ) {
68
 
69
- global $wp_admin_bar;
 
70
 
71
- if ( !is_user_logged_in() ) { return; }
72
- if ( !is_admin_bar_showing() ) { return; }
 
73
 
74
- $wp_admin_bar -> add_menu( array(
75
- 'id' => 'aye-menu',
76
- 'title' => __( 'YouTube Embed', 'youtube-embed' ) ) );
77
-
78
- if ( function_exists( 'wp_readme_parser' ) ) {
79
- $wp_admin_bar -> add_menu( array(
80
- 'parent' => 'aye-menu',
81
- 'id' => 'aye-readme',
82
- 'title' => __( 'Instructions', 'youtube-embed' ),
83
- 'href' => admin_url( 'admin.php?page=aye-support-instructions' ),
84
- 'meta' => array( 'target' => '_blank' ) ) );
85
- }
86
-
87
- if ( current_user_can( 'delete_plugins' ) ) {
88
- $wp_admin_bar -> add_menu( array(
89
- 'parent' => 'aye-menu',
90
- 'id' => 'aye-options',
91
- 'title' => __( 'Options', 'youtube-embed' ),
92
- 'href' => admin_url( 'admin.php?page=aye-general-options' ),
93
- 'meta' => array( 'target' => '_blank' ) ) );
94
- }
95
-
96
- if ( current_user_can( $profile_access ) ) {
97
- $wp_admin_bar -> add_menu( array(
98
- 'parent' => 'aye-menu',
99
- 'id' => 'aye-profile',
100
- 'title' => __( 'Profiles', 'youtube-embed' ),
101
- 'href' => admin_url( 'admin.php?page=aye-profile-options' ),
102
- 'meta' => array( 'target' => '_blank' ) ) );
103
- }
104
-
105
- if ( current_user_can( $list_access ) ) {
106
- $wp_admin_bar -> add_menu( array(
107
- 'parent' => 'aye-menu',
108
- 'id' => 'aye-lists',
109
- 'title' => __( 'Lists', 'youtube-embed' ),
110
- 'href' => admin_url( 'admin.php?page=aye-list-options' ),
111
- 'meta' => array( 'target' => '_blank' ) ) );
112
- }
113
- }
114
- }
115
  }
116
 
117
  add_action( 'admin_bar_menu', 'aye_admin_bar_render_3_3', 40 );
21
 
22
  function aye_admin_bar_render_3_1() {
23
 
24
+ global $wp_version;
25
 
26
+ if ( current_user_can( 'edit_plugins' ) && ( ( float ) $wp_version >= 3.1 ) && ( ( float ) $wp_version < 3.3 ) ) {
27
 
28
  $options = aye_set_general_defaults();
29
 
33
  $wp_admin_bar -> add_menu( array(
34
  'parent' => 'appearance',
35
  'id' => 'aye-options',
36
+ 'title' => __( 'YouTube Embed' ),
37
+ 'href' => admin_url( 'admin.php?page=youtube-embed-profiles' ),
38
  'meta' => false ) );
39
  }
40
  }
55
 
56
  function aye_admin_bar_render_3_3( $meta = TRUE ) {
57
 
58
+ global $wp_version;
59
 
60
+ if ( ( float ) $wp_version >= 3.3 ) {
61
 
62
+ $options = aye_set_general_defaults();
63
 
64
+ if ( $options[ 'admin_bar' ] != '' ) {
 
65
 
66
+ global $wp_admin_bar;
67
 
68
+ if ( !is_user_logged_in() ) { return; }
69
+ if ( !is_super_admin() || !is_admin_bar_showing() ) { return; }
70
 
71
+ $wp_admin_bar -> add_menu( array(
72
+ 'id' => 'aye-menu',
73
+ 'title' => __( 'YouTube Embed' ) ) );
74
 
75
+ $wp_admin_bar -> add_menu( array(
76
+ 'parent' => 'aye-menu',
77
+ 'id' => 'aye-options',
78
+ 'title' => __( 'Options' ),
79
+ 'href' => admin_url( 'admin.php?page=aye-general-options' ),
80
+ 'meta' => array( 'target' => '_blank' ) ) );
81
+
82
+ $wp_admin_bar -> add_menu( array(
83
+ 'parent' => 'aye-menu',
84
+ 'id' => 'aye-profile',
85
+ 'title' => __( 'Profiles' ),
86
+ 'href' => admin_url( 'admin.php?page=aye-profile-options' ),
87
+ 'meta' => array( 'target' => '_blank' ) ) );
88
+
89
+ $wp_admin_bar -> add_menu( array(
90
+ 'parent' => 'aye-menu',
91
+ 'id' => 'aye-lists',
92
+ 'title' => __( 'Lists' ),
93
+ 'href' => admin_url( 'admin.php?page=aye-list-options' ),
94
+ 'meta' => array( 'target' => '_blank' ) ) );
95
+
96
+ $wp_admin_bar -> add_menu( array(
97
+ 'parent' => 'aye-menu',
98
+ 'id' => 'aye-readme',
99
+ 'title' => __( 'README' ),
100
+ 'href' => admin_url( 'admin.php?page=aye-support-readme' ),
101
+ 'meta' => array( 'target' => '_blank' ) ) );
102
+ }
103
+ }
 
 
 
 
 
 
 
 
 
 
 
 
104
  }
105
 
106
  add_action( 'admin_bar_menu', 'aye_admin_bar_render_3_3', 40 );
includes/aye-admin-config.php CHANGED
@@ -7,15 +7,6 @@
7
  * @package Artiss-YouTube-Embed
8
  */
9
 
10
- /**
11
- * Show Admin Messages
12
- *
13
- * Display messages on the administration screen
14
- *
15
- * @since 2.6
16
- *
17
- */
18
-
19
  /**
20
  * Add Settings link to plugin list
21
  *
@@ -60,9 +51,9 @@ function aye_set_plugin_meta( $links, $file ) {
60
 
61
  if ( strpos( $file, 'youtube-embed.php' ) !== false ) {
62
 
63
- $links = array_merge( $links, array( '<a href="admin.php?page=aye-display-about">' . __( 'Support', 'youtube-embed' ) . '</a>' ) );
64
 
65
- $links = array_merge( $links, array( '<a href="http://www.artiss.co.uk/donate">' . __( 'Donate', 'youtube-embed' ) . '</a>' ) );
66
  }
67
 
68
  return $links;
@@ -82,65 +73,59 @@ add_filter( 'plugin_row_meta', 'aye_set_plugin_meta', 10, 2 );
82
 
83
  function aye_menu_initialise() {
84
 
85
- // Get level access for profile and list screens.
86
 
87
- $options = aye_set_general_defaults();
88
- $profile_access = $options[ 'profile_access' ];
89
- $list_access = $options[ 'list_access' ];
90
 
91
- // Depending on WordPress version and available functions decide which (if any) contextual help system to use
92
 
93
- $contextual_help = aye_contextual_help_type();
94
 
95
- // Add main admin option
96
 
97
- add_menu_page( __( 'About Artiss YouTube Embeds', 'youtube-embed' ), __( 'YouTube', 'youtube-embed' ), 'edit_posts', 'aye-support-about', 'aye_support_about', plugins_url() . '/youtube-embed/images/menu_icon.png' );
98
 
99
- // Add about sub-menu
100
 
101
- if ( $contextual_help == 'new' ) { global $aye_about_hook; }
102
 
103
- $aye_about_hook = add_submenu_page( 'aye-support-about', __( 'About Artiss YouTube Embed', 'youtube-embed' ), __( 'About', 'youtube-embed' ), 'edit_posts', 'aye-support-about', 'aye_support_about' );
104
 
105
- if ( $contextual_help == 'new' ) { add_action( 'load-' . $aye_about_hook, 'aye_add_about_help' ); }
106
 
107
- if ( $contextual_help == 'old' ) { add_contextual_help( $aye_about_hook, aye_about_help() ); }
108
 
109
- // Add instructions sub-menu
110
 
111
- if ( function_exists( 'wp_readme_parser' ) ) {
112
- add_submenu_page( 'aye-support-about', __( 'Artiss YouTube Embed Instructions', 'youtube-embed' ), __( 'Instructions', 'youtube-embed' ), 'edit_posts', 'aye-support-instructions', 'aye_support_instructions' );
113
- }
114
 
115
- // Add options sub-menu
116
 
117
- if ( $contextual_help == 'new' ) { global $aye_options_hook; }
118
 
119
- $aye_options_hook = add_submenu_page( 'aye-support-about', __( 'Artiss YouTube Embed Options', 'youtube-embed' ), __( 'Options', 'youtube-embed' ), 'delete_plugins', 'aye-general-options', 'aye_general_options' );
120
 
121
- if ( $contextual_help == 'new' ) { add_action( 'load-' . $aye_options_hook, 'aye_add_options_help' ); }
122
 
123
- if ( $contextual_help == 'old' ) { add_contextual_help( $aye_options_hook, aye_options_help() ); }
124
 
125
- // Add profiles sub-menu
126
 
127
- if ( $contextual_help == 'new' ) { global $aye_profiles_hook; }
128
 
129
- $aye_profiles_hook = add_submenu_page( 'aye-support-about', __( 'Artiss YouTube Embed Profiles', 'youtube-embed' ), __( 'Profiles', 'youtube-embed' ), $profile_access, 'aye-profile-options', 'aye_profile_options' );
 
 
130
 
131
- if ( $contextual_help == 'new' ) { add_action( 'load-' . $aye_profiles_hook, 'aye_add_profiles_help' ); }
132
 
133
- if ( $contextual_help == 'old' ) { add_contextual_help( $aye_profiles_hook, aye_profiles_help() ); }
134
 
135
- // Add lists sub-menu
136
 
137
- if ( $contextual_help == 'new' ) { global $aye_lists_hook; }
138
 
139
- $aye_lists_hook = add_submenu_page( 'aye-support-about', __( 'Artiss YouTube Embed Lists', 'youtube-embed' ), __( 'Lists', 'youtube-embed' ), $list_access, 'aye-list-options', 'aye_list_options' );
140
-
141
- if ( $contextual_help == 'new' ) { add_action( 'load-' . $aye_lists_hook, 'aye_add_lists_help' ); }
142
-
143
- if ( $contextual_help == 'old' ) { add_contextual_help( $aye_lists_hook, aye_lists_help() ); }
144
 
145
  }
146
 
@@ -158,19 +143,19 @@ add_action( 'admin_menu', 'aye_menu_initialise' );
158
 
159
  function aye_contextual_help_type() {
160
 
161
- global $wp_version;
162
 
163
- $type = false;
164
 
165
- if ( ( float ) $wp_version >= 3.3 ) {
166
- $type = 'new';
167
- } else {
168
- if ( function_exists( 'add_contextual_help' ) ) {
169
- $type = 'old';
170
- }
171
- }
172
 
173
- return $type;
174
  }
175
 
176
  /**
@@ -216,15 +201,15 @@ function aye_list_options() {
216
  }
217
 
218
  /**
219
- * Include instructions screen
220
  *
221
- * Display the instructions
222
  *
223
  * @since 2.4
224
  */
225
 
226
- function aye_support_instructions() {
227
- include_once( WP_PLUGIN_DIR . '/youtube-embed/includes/aye-display-instructions.php' );
228
  }
229
 
230
  /**
@@ -253,12 +238,12 @@ function aye_support_about() {
253
 
254
  function aye_add_options_help() {
255
 
256
- global $aye_options_hook;
257
- $screen = get_current_screen();
258
 
259
- if ( $screen->id != $aye_options_hook ) { return; }
260
 
261
- $screen -> add_help_tab( array( 'id' => 'aye-options-help-tab', 'title' => __( 'Help', 'youtube-embed' ), 'content' => aye_options_help() ) );
262
  }
263
 
264
  /**
@@ -273,12 +258,12 @@ function aye_add_options_help() {
273
 
274
  function aye_options_help() {
275
 
276
- $help_text = '<p>' . __( 'This screen allows you to select non-specific options for the Artiss YouTube Embed plugin. For the default embedding settings, please select the <a href="admin.php?page=aye-profile-options">Profiles</a> administration option.', 'youtube-embed' ) . '</p>';
277
- $help_text .= '<p>' . __( 'Remember to click the Save Settings button at the bottom of the screen for new settings to take effect.', 'youtube-embed' ) . '</p>';
278
- $help_text .= '<p><strong>' . __( 'For more information:', 'youtube-embed' ) . '</strong></p>';
279
- $help_text .= '<p><a href="http://www.artiss.co.uk/youtube-embed">' . __( 'Artiss YouTube Embed Plugin Documentation', 'youtube-embed' ) . '</a></p>';
280
- $help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation', 'youtube-embed' ) . '</a></p>';
281
- $help_text .= '<h4>' . __( 'This plugin, and all support, is supplied for free, but <a title="Donate" href="http://artiss.co.uk/donate" target="_blank">donations</a> are always welcome.', 'youtube-embed' ) . '</h4>';
282
 
283
  return $help_text;
284
  }
@@ -295,12 +280,12 @@ function aye_options_help() {
295
 
296
  function aye_add_profiles_help() {
297
 
298
- global $aye_profiles_hook;
299
- $screen = get_current_screen();
300
 
301
- if ( $screen->id != $aye_profiles_hook ) { return; }
302
 
303
- $screen -> add_help_tab( array( 'id' => 'aye-profiles-help-tab', 'title' => __( 'Help', 'youtube-embed' ), 'content' => aye_profiles_help() ) );
304
  }
305
 
306
  /**
@@ -315,13 +300,13 @@ function aye_add_profiles_help() {
315
 
316
  function aye_profiles_help() {
317
 
318
- $help_text = '<p>' . __( 'This screen allows you to set the options for the default and additional profiles. If you don\'t specify a specific parameter when displaying your YouTube video then the default profile option will be used instead. Additional profiles, which you may name, can be used as well and used as required.', 'youtube-embed' ) . '</p>';
319
- $help_text .= '<p>' . __( 'Remember to click the Save Settings button at the bottom of the screen for new settings to take effect.', 'youtube-embed' ) . '</p>';
320
  $help_text .= '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
321
- $help_text .= '<p><a href="http://www.artiss.co.uk/youtube-embed">' . __( 'Artiss YouTube Embed Plugin Documentation', 'youtube-embed' ) . '</a></p>';
322
- $help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation', 'youtube-embed' ) . '</a></p>';
323
- $help_text .= '<p><a href="http://embedplus.com/">' . __( 'EmbedPlus website', 'youtube-embed' ) . '</a></p>';
324
- $help_text .= '<h4>' . __( 'This plugin, and all support, is supplied for free, but <a title="Donate" href="http://artiss.co.uk/donate" target="_blank">donations</a> are always welcome.', 'youtube-embed' ) . '</h4>';
325
 
326
  return $help_text;
327
  }
@@ -338,12 +323,12 @@ function aye_profiles_help() {
338
 
339
  function aye_add_lists_help() {
340
 
341
- global $aye_lists_hook;
342
- $screen = get_current_screen();
343
 
344
- if ( $screen->id != $aye_lists_hook ) { return; }
345
 
346
- $screen -> add_help_tab( array( 'id' => 'aye-lists-help-tab', 'title' => __( 'Help', 'youtube-embed' ), 'content' => aye_lists_help() ) );
347
  }
348
 
349
  /**
@@ -358,12 +343,12 @@ function aye_add_lists_help() {
358
 
359
  function aye_lists_help() {
360
 
361
- $help_text = '<p>' . __( 'This screen allows you to create lists of YouTube videos, which may be named. These lists can then be used in preference to a single video ID.', 'youtube-embed' ) . '</p>';
362
- $help_text .= '<p>' . __( 'Remember to click the Save Settings button at the bottom of the screen for new settings to take effect.', 'youtube-embed' ) . '</p>';
363
- $help_text .= '<p><strong>' . __( 'For more information:', 'youtube-embed' ) . '</strong></p>';
364
- $help_text .= '<p><a href="http://www.artiss.co.uk/youtube-embed">' . __( 'Artiss YouTube Embed Plugin Documentation', 'youtube-embed' ) . '</a></p>';
365
- $help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation', 'youtube-embed' ) . '</a></p>';
366
- $help_text .= '<h4>' . __( 'This plugin, and all support, is supplied for free, but <a title="Donate" href="http://artiss.co.uk/donate" target="_blank">donations</a> are always welcome.', 'youtube-embed' ) . '</h4>';
367
 
368
  return $help_text;
369
  }
@@ -380,12 +365,12 @@ function aye_lists_help() {
380
 
381
  function aye_add_about_help() {
382
 
383
- global $aye_about_hook;
384
- $screen = get_current_screen();
385
 
386
- if ( $screen->id != $aye_about_hook ) { return; }
387
 
388
- $screen -> add_help_tab( array( 'id' => 'aye-about-help-tab', 'title' => __( 'Help', 'youtube-embed' ), 'content' => aye_about_help() ) );
389
  }
390
 
391
  /**
@@ -400,11 +385,11 @@ function aye_add_about_help() {
400
 
401
  function aye_about_help() {
402
 
403
- $help_text = '<p>' . __( 'This screen provides useful information about this plugin along with methods of support.', 'youtube-embed' ) . '</p>';
404
- $help_text .= '<p><strong>' . __( 'For more information:', 'youtube-embed' ) . '</strong></p>';
405
- $help_text .= '<p><a href="http://www.artiss.co.uk/youtube-embed">' . __( 'Artiss YouTube Embed Plugin Documentation', 'youtube-embed' ) . '</a></p>';
406
- $help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation', 'youtube-embed' ) . '</a></p>';
407
- $help_text .= '<h4>' . __( 'This plugin, and all support, is supplied for free, but <a title="Donate" href="http://artiss.co.uk/donate" target="_blank">donations</a> are always welcome.', 'youtube-embed' ) . '</h4>';
408
 
409
  return $help_text;
410
  }
@@ -431,9 +416,9 @@ global $wp_version;
431
 
432
  if ( get_option( 'youtube_embed_activated' ) && ( ( float ) $wp_version >= 3.3 ) ) {
433
 
434
- add_action( 'admin_enqueue_scripts', 'aye_admin_enqueue_scripts' );
435
 
436
- delete_option( 'youtube_embed_activated' );
437
  }
438
 
439
  /**
@@ -446,10 +431,10 @@ if ( get_option( 'youtube_embed_activated' ) && ( ( float ) $wp_version >= 3.3 )
446
 
447
  function aye_admin_enqueue_scripts() {
448
 
449
- wp_enqueue_style( 'wp-pointer' );
450
- wp_enqueue_script( 'wp-pointer' );
451
 
452
- add_action( 'admin_print_footer_scripts', 'aye_admin_print_footer_scripts' );
453
  }
454
 
455
  /**
@@ -462,10 +447,10 @@ function aye_admin_enqueue_scripts() {
462
 
463
  function aye_admin_print_footer_scripts() {
464
 
465
- $pointer_content = '<h3>' . __( 'Welcome to Artiss YouTube Embed', 'youtube-embed' ) . '</h3>';
466
- $pointer_content .= '<p style="font-style:italic;">' . __( 'Thank you for installing this plugin.', 'youtube-embed' ) . '</p>';
467
- $pointer_content .= '<p>' . __( 'These new menu options will allow you to configure your videos to just how you want them and provide links for help and support.', 'youtube-embed' ) . '</p>';
468
- $pointer_content .= '<p>' . __( 'Even if you do nothing else, please visit the Profiles option to check your default video values.', 'youtube-embed' ) . '</p>';
469
  ?>
470
  <script>
471
  jQuery(function () {
7
  * @package Artiss-YouTube-Embed
8
  */
9
 
 
 
 
 
 
 
 
 
 
10
  /**
11
  * Add Settings link to plugin list
12
  *
51
 
52
  if ( strpos( $file, 'youtube-embed.php' ) !== false ) {
53
 
54
+ $links = array_merge( $links, array( '<a href="admin.php?page=aye-display-about">' . __( 'Support' ) . '</a>' ) );
55
 
56
+ $links = array_merge( $links, array( '<a href="http://www.artiss.co.uk/donate">' . __( 'Donate' ) . '</a>' ) );
57
  }
58
 
59
  return $links;
73
 
74
  function aye_menu_initialise() {
75
 
76
+ // Depending on WordPress version and available functions decide which (if any) contextual help system to use
77
 
78
+ $contextual_help = aye_contextual_help_type();
 
 
79
 
80
+ // Add main admin option
81
 
82
+ add_menu_page( __( 'Artiss YouTube Embed Settings' ), __( 'YouTube' ), 'manage_options', 'aye-general-options', 'aye_general_options', plugins_url() . '/youtube-embed/images/menu_icon.png' );
83
 
84
+ // Add options sub-menu
85
 
86
+ if ( $contextual_help == 'new' ) { global $aye_options_hook; }
87
 
88
+ $aye_options_hook = add_submenu_page( 'aye-general-options', __( 'Artiss YouTube Embed Options' ), __( 'Options' ), 'edit_posts', 'aye-general-options', 'aye_general_options' );
89
 
90
+ if ( $contextual_help == 'new' ) { add_action( 'load-' . $aye_options_hook, 'aye_add_options_help' ); }
91
 
92
+ if ( $contextual_help == 'old' ) { add_contextual_help( $aye_options_hook, aye_options_help() ); }
93
 
94
+ // Add profiles sub-menu
95
 
96
+ if ( $contextual_help == 'new' ) { global $aye_profiles_hook; }
97
 
98
+ $aye_profiles_hook = add_submenu_page( 'aye-general-options', __( 'Artiss YouTube Embed Profiles' ), __( 'Profiles' ), 'edit_posts', 'aye-profile-options', 'aye_profile_options' );
99
 
100
+ if ( $contextual_help == 'new' ) { add_action( 'load-' . $aye_profiles_hook, 'aye_add_profiles_help' ); }
 
 
101
 
102
+ if ( $contextual_help == 'old' ) { add_contextual_help( $aye_profiles_hook, aye_profiles_help() ); }
103
 
104
+ // Add lists sub-menu
105
 
106
+ if ( $contextual_help == 'new' ) { global $aye_lists_hook; }
107
 
108
+ $aye_lists_hook = add_submenu_page( 'aye-general-options', __( 'Artiss YouTube Embed Lists' ), __( 'Lists' ), 'edit_posts', 'aye-list-options', 'aye_list_options' );
109
 
110
+ if ( $contextual_help == 'new' ) { add_action( 'load-' . $aye_lists_hook, 'aye_add_lists_help' ); }
111
 
112
+ if ( $contextual_help == 'old' ) { add_contextual_help( $aye_lists_hook, aye_lists_help() ); }
113
 
114
+ // Add readme sub-menu
115
 
116
+ if ( function_exists( 'wp_readme_parser' ) ) {
117
+ add_submenu_page( 'aye-general-options', __( 'Artiss YouTube Embed README' ), __( 'README' ), 'edit_posts', 'aye-support-readme', 'aye_support_readme' );
118
+ }
119
 
120
+ // Add about sub-menu
121
 
122
+ if ( $contextual_help == 'new' ) { global $aye_about_hook; }
123
 
124
+ $aye_about_hook = add_submenu_page( 'aye-general-options', __( 'About Artiss YouTube Embed' ), __( 'About' ), 'edit_posts', 'aye-support-about', 'aye_support_about' );
125
 
126
+ if ( $contextual_help == 'new' ) { add_action( 'load-' . $aye_about_hook, 'aye_add_about_help' ); }
127
 
128
+ if ( $contextual_help == 'old' ) { add_contextual_help( $aye_about_hook, aye_about_help() ); }
 
 
 
 
129
 
130
  }
131
 
143
 
144
  function aye_contextual_help_type() {
145
 
146
+ global $wp_version;
147
 
148
+ $type = false;
149
 
150
+ if ( ( float ) $wp_version >= 3.3 ) {
151
+ $type = 'new';
152
+ } else {
153
+ if ( function_exists( 'add_contextual_help' ) ) {
154
+ $type = 'old';
155
+ }
156
+ }
157
 
158
+ return $type;
159
  }
160
 
161
  /**
201
  }
202
 
203
  /**
204
+ * Include README screen
205
  *
206
+ * Parse and display the README instructions
207
  *
208
  * @since 2.4
209
  */
210
 
211
+ function aye_support_readme() {
212
+ include_once( WP_PLUGIN_DIR . '/youtube-embed/includes/aye-display-readme.php' );
213
  }
214
 
215
  /**
238
 
239
  function aye_add_options_help() {
240
 
241
+ global $aye_options_hook;
242
+ $screen = get_current_screen();
243
 
244
+ if ( $screen->id != $aye_options_hook ) { return; }
245
 
246
+ $screen -> add_help_tab( array( 'id' => 'aye-options-help-tab', 'title' => __( 'Help' ), 'content' => aye_options_help() ) );
247
  }
248
 
249
  /**
258
 
259
  function aye_options_help() {
260
 
261
+ $help_text = '<p>' . __( 'This screen allows you to select non-specific options for the Artiss YouTube Embed plugin. For the default embedding settings, please select the <a href="admin.php?page=aye-profile-options">Profiles</a> administration option.' ) . '</p>';
262
+ $help_text .= '<p>' . __( 'Remember to click the Save Settings button at the bottom of the screen for new settings to take effect.' ) . '</p>';
263
+ $help_text .= '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
264
+ $help_text .= '<p><a href="http://www.artiss.co.uk/artiss-youtube-embed">' . __( 'Artiss YouTube Embed Plugin Documentation' ) . '</a></p>';
265
+ $help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation' ) . '</a></p>';
266
+ $help_text .= '<h4>' . __( 'This plugin, and all support, is supplied for free, but <a title="Donate" href="http://artiss.co.uk/donate" target="_blank">donations</a> are always welcome.' ) . '</h4>';
267
 
268
  return $help_text;
269
  }
280
 
281
  function aye_add_profiles_help() {
282
 
283
+ global $aye_profiles_hook;
284
+ $screen = get_current_screen();
285
 
286
+ if ( $screen->id != $aye_profiles_hook ) { return; }
287
 
288
+ $screen -> add_help_tab( array( 'id' => 'aye-profiles-help-tab', 'title' => __( 'Help' ), 'content' => aye_profiles_help() ) );
289
  }
290
 
291
  /**
300
 
301
  function aye_profiles_help() {
302
 
303
+ $help_text = '<p>' . __( 'This screen allows you to set the options for the default and additional profiles. If you don\'t specify a specific parameter when displaying your YouTube video then the default profile option will be used instead. Additional profiles, which you may name, can be used as well and used as required.' ) . '</p>';
304
+ $help_text .= '<p>' . __( 'Remember to click the Save Settings button at the bottom of the screen for new settings to take effect.' ) . '</p>';
305
  $help_text .= '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
306
+ $help_text .= '<p><a href="http://www.artiss.co.uk/artiss-youtube-embed">' . __( 'Artiss YouTube Embed Plugin Documentation' ) . '</a></p>';
307
+ $help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation' ) . '</a></p>';
308
+ $help_text .= '<p><a href="http://embedplus.com/">' . __( 'EmbedPlus website' ) . '</a></p>';
309
+ $help_text .= '<h4>' . __( 'This plugin, and all support, is supplied for free, but <a title="Donate" href="http://artiss.co.uk/donate" target="_blank">donations</a> are always welcome.' ) . '</h4>';
310
 
311
  return $help_text;
312
  }
323
 
324
  function aye_add_lists_help() {
325
 
326
+ global $aye_lists_hook;
327
+ $screen = get_current_screen();
328
 
329
+ if ( $screen->id != $aye_lists_hook ) { return; }
330
 
331
+ $screen -> add_help_tab( array( 'id' => 'aye-lists-help-tab', 'title' => __( 'Help' ), 'content' => aye_lists_help() ) );
332
  }
333
 
334
  /**
343
 
344
  function aye_lists_help() {
345
 
346
+ $help_text = '<p>' . __( 'This screen allows you to create lists of YouTube videos, which may be named. These lists can then be used in preference to a single video ID.' ) . '</p>';
347
+ $help_text .= '<p>' . __( 'Remember to click the Save Settings button at the bottom of the screen for new settings to take effect.' ) . '</p>';
348
+ $help_text .= '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
349
+ $help_text .= '<p><a href="http://www.artiss.co.uk/artiss-youtube-embed">' . __( 'Artiss YouTube Embed Plugin Documentation' ) . '</a></p>';
350
+ $help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation' ) . '</a></p>';
351
+ $help_text .= '<h4>' . __( 'This plugin, and all support, is supplied for free, but <a title="Donate" href="http://artiss.co.uk/donate" target="_blank">donations</a> are always welcome.' ) . '</h4>';
352
 
353
  return $help_text;
354
  }
365
 
366
  function aye_add_about_help() {
367
 
368
+ global $aye_about_hook;
369
+ $screen = get_current_screen();
370
 
371
+ if ( $screen->id != $aye_about_hook ) { return; }
372
 
373
+ $screen -> add_help_tab( array( 'id' => 'aye-about-help-tab', 'title' => __( 'Help' ), 'content' => aye_about_help() ) );
374
  }
375
 
376
  /**
385
 
386
  function aye_about_help() {
387
 
388
+ $help_text = '<p>' . __( 'This screen provides useful information about this plugin along with methods of support.' ) . '</p>';
389
+ $help_text .= '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
390
+ $help_text .= '<p><a href="http://www.artiss.co.uk/artiss-youtube-embed">' . __( 'Artiss YouTube Embed Plugin Documentation' ) . '</a></p>';
391
+ $help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation' ) . '</a></p>';
392
+ $help_text .= '<h4>' . __( 'This plugin, and all support, is supplied for free, but <a title="Donate" href="http://artiss.co.uk/donate" target="_blank">donations</a> are always welcome.' ) . '</h4>';
393
 
394
  return $help_text;
395
  }
416
 
417
  if ( get_option( 'youtube_embed_activated' ) && ( ( float ) $wp_version >= 3.3 ) ) {
418
 
419
+ add_action( 'admin_enqueue_scripts', 'aye_admin_enqueue_scripts' );
420
 
421
+ delete_option( 'youtube_embed_activated' );
422
  }
423
 
424
  /**
431
 
432
  function aye_admin_enqueue_scripts() {
433
 
434
+ wp_enqueue_style( 'wp-pointer' );
435
+ wp_enqueue_script( 'wp-pointer' );
436
 
437
+ add_action( 'admin_print_footer_scripts', 'aye_admin_print_footer_scripts' );
438
  }
439
 
440
  /**
447
 
448
  function aye_admin_print_footer_scripts() {
449
 
450
+ $pointer_content = '<h3>' . __( 'Welcome to Artiss YouTube Embed' ) . '</h3>';
451
+ $pointer_content .= '<p style="font-style:italic;">' . __( 'Thank you for installing this plugin.' ) . '</p>';
452
+ $pointer_content .= '<p>' . __( 'These new menu options will allow you to configure your videos to just how you want them and provide links for help and support.' ) . '</p>';
453
+ $pointer_content .= '<p>' . __( 'Even if you do nothing else, please visit the Profiles option to check your default video values.' ) . '</p>';
454
  ?>
455
  <script>
456
  jQuery(function () {
includes/aye-deprecated.php CHANGED
@@ -52,7 +52,7 @@ function youtube_playlist_embed( $content, $paras, $style = '' ) {
52
  */
53
 
54
  function get_playlist_download( $id = '' ) {
55
- echo aye_error( __( 'This function does not support playlists', 'youtube-embed' ) );
56
  return;
57
  }
58
  ?>
52
  */
53
 
54
  function get_playlist_download( $id = '' ) {
55
+ echo aye_error( __( 'This function does not support playlists' ) );
56
  return;
57
  }
58
  ?>
includes/aye-display-about.php CHANGED
@@ -11,51 +11,41 @@
11
  <div class="wrap" style="width: 1010px;">
12
  <div class="icon32"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
13
 
14
- <h2><?php _e( 'About Artiss YouTube Embed', 'youtube-embed' ); ?></h2>
15
 
16
- <?php
17
-
18
- // Display ads
19
-
20
- $options = aye_set_general_defaults();
21
- if ( $options[ 'donated'] != 1 ) { artiss_plugin_ads( 'youtube-embed', 990 ); }
22
- ?>
23
-
24
- <div class="updated fade"><p>Have you voted for which features of YouTube Embed you'd like to retain in version 3? <a href="http://www.artiss.co.uk/youtube-embed/youtube-embed-features-vote" target="_new">Click here</a> to vote!</p></div>
25
-
26
- <p><?php echo sprintf( __( 'You are using Artiss YouTube Embed version %s. It was written by David Artiss.', 'youtube-embed' ), youtube_embed_version ); ?></p>
27
 
28
- <a href="http://www.youtube.com/"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/poweredby.png" alt="<?php _e( 'Powered by YouTube', 'youtube-embed' ); ?>" title="<?php _e( 'Powered by YouTube', 'youtube-embed' ); ?>" align="right" /></a>
29
 
30
  <?php
31
 
32
- echo '<h3>' . __( 'Copyrights', 'youtube-embed' ) . '</h3>';
33
 
34
- echo '<p>' . __( 'YouTube, and all associated logos, is the copyright of Google Inc.', 'youtube-embed' ) . '</p>';
35
 
36
- echo '<p>' . __( 'EmbedPlus is copyright. Read the <a href="http://embedplus.com/terms.aspx" target="_blank">Terms &amp; Conditions of Use</a>.', 'youtube-embed' ) . '</p>';
37
 
38
- echo '<h3>' . __( 'Acknowledgements', 'youtube-embed' ) . '</h3>';
39
 
40
- echo '<p>' . __( 'Images have been compressed with <a href="http://www.smushit.com/ysmush.it/">Smush.it</a>.', 'youtube-embed' ) . '</p>';
41
 
42
- echo '<p>' . __( 'JavaScript has been compressed with <a href="http://javascriptcompressor.com/">JavaScript Compressor</a>.', 'youtube-embed' ) . '</p>';
43
 
44
- echo '<p>' . __( 'YouTube icons are courtesy of <a href="http://www.youtube.com/t/creators_downloads">YouTube</a>. Other icons are by <a href="http://p.yusukekamiyamane.com/">Yusuke Kamiyamane</a>.', 'youtube-embed' ) . '</p>';
45
 
46
- echo '<h3>' . __( 'Support Information', 'youtube-embed' ) . '</h3>';
47
 
48
- echo '<p>' . __( 'Useful support information and links can be found by clicking on the Help tab at the top of each of the Artiss YouTube Embed administration screens.', 'youtube-embed' ) . '</p>';
49
 
50
- echo '<h4>' . __( 'This plugin, and all support, is supplied for free, but <a title="Donate" href="http://artiss.co.uk/donate" target="_blank">donations</a> are always welcome.', 'youtube-embed' ) . '</h4>';
51
 
52
- echo '<h3>' . __( 'Stay in Touch', 'youtube-embed' ) . '</h3>';
53
 
54
- echo '<p>' . __( '<a href="http://www.artiss.co.uk/wp-plugins">See the full list</a> of Artiss plugins, including beta releases.', 'youtube-embed' ) . '</p>';
55
 
56
- echo '<p>' . __( '<a href="http://www.twitter.com/artiss_tech">Follow Artiss.co.uk</a> on Twitter.', 'youtube-embed' ) . '</p>';
57
 
58
- echo '<p>' . __( '<a href="http://www.artiss.co.uk/feed">Subscribe</a> to the Artiss.co.uk news feed.', 'youtube-embed' ) . '</p>';
59
 
60
  ?>
61
  </div>
11
  <div class="wrap" style="width: 1010px;">
12
  <div class="icon32"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
13
 
14
+ <h2><?php _e( 'About Artiss YouTube Embed' ); ?></h2>
15
 
16
+ <p><?php echo sprintf( __( 'You are using Artiss YouTube Embed version %s. It was written by David Artiss.' ), youtube_embed_version ); ?></p>
 
 
 
 
 
 
 
 
 
 
17
 
18
+ <a href="http://www.youtube.com/"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/poweredby.png" alt="Powered by YouTube" title="Powered by YouTube" align="right" /></a>
19
 
20
  <?php
21
 
22
+ echo '<h3>' . __( 'Copyrights' ) . '</h3>';
23
 
24
+ echo '<p>' . __( 'YouTube, and all associated logos, is the copyright of Google Inc.' ) . '</p>';
25
 
26
+ echo '<p>' . __( 'EmbedPlus is copyright. Read the <a href="http://embedplus.com/terms.aspx" target="_blank">Terms &amp; Conditions of Use</a>.' ) . '</p>';
27
 
28
+ echo '<h3>' . __( 'Acknowledgements' ) . '</h3>';
29
 
30
+ echo '<p>' . __( 'Images have been compressed with <a href="http://www.smushit.com/ysmush.it/">Smush.it</a>.' ) . '</p>';
31
 
32
+ echo '<p>' . __( 'JavaScript has been compressed with <a href="http://javascriptcompressor.com/">JavaScript Compressor</a>.' ) . '</p>';
33
 
34
+ echo '<p>' . __( 'YouTube icons are courtesy of <a href="http://www.youtube.com/t/creators_downloads">YouTube</a>. Other icons are by <a href="http://p.yusukekamiyamane.com/">Yusuke Kamiyamane</a>.' ) . '</p>';
35
 
36
+ echo '<h3>' . __( 'Support Information' ) . '</h3>';
37
 
38
+ echo '<p>' . __( 'Useful support information and links can be found by clicking on the Help tab at the top of each of the Artiss YouTube Embed administration screens.' ) . '</p>';
39
 
40
+ echo '<h4>' . __( 'This plugin, and all support, is supplied for free, but <a title="Donate" href="http://artiss.co.uk/donate" target="_blank">donations</a> are always welcome.' ) . '</h4>';
41
 
42
+ echo '<h3>' . __( 'Stay in Touch' ) . '</h3>';
43
 
44
+ echo '<p>' . __( '<a href="http://www.artiss.co.uk/wp-plugins">See the full list</a> of Artiss plugins, including beta releases.' ) . '</p>';
45
 
46
+ echo '<p>' . __( '<a href="http://www.twitter.com/artiss_tech">Follow Artiss.co.uk</a> on Twitter.' ) . '</p>';
47
 
48
+ echo '<p>' . __( '<a href="http://www.artiss.co.uk/feed">Subscribe</a> to the Artiss.co.uk news feed.' ) . '</p>';
49
 
50
  ?>
51
  </div>
includes/aye-display-instructions.php DELETED
@@ -1,31 +0,0 @@
1
- <?php
2
- /**
3
- * Instructions Page
4
- *
5
- * Display the instructions
6
- *
7
- * @package Artiss-YouTube-Embed
8
- * @since 2.4
9
- */
10
- ?>
11
- <div class="wrap">
12
- <div class="icon32" id="icon-edit-pages"></div>
13
-
14
- <h2><?php _e( 'Artiss YouTube Embed Instructions', 'youtube-embed' ); ?></h2>
15
-
16
- <?php
17
- $options = aye_set_general_defaults();
18
- if ( $options[ 'donated'] != 1 ) { artiss_plugin_ads( 'youtube-embed', 990 ); }
19
- ?>
20
-
21
- <div class="updated fade"><p>Have you voted for which features of YouTube Embed you'd like to retain in version 3? <a href="http://www.artiss.co.uk/youtube-embed/youtube-embed-features-vote" target="_new">Click here</a> to vote!</p></div>
22
-
23
- <?php
24
- if ( !function_exists( 'wp_readme_parser' ) ) {
25
- echo '<p>You shouldn\'t be able to see this but I guess that odd things can happen!<p>';
26
- echo '<p>To display the instructions you must install the <a href="http://wordpress.org/extend/plugins/wp-readme-parser/">README Parser plugin</a>.</p>';
27
- } else {
28
- echo wp_readme_parser( array( 'exclude' => 'meta,upgrade notice,screenshots,support,changelog,links,installation,licence', 'ignore' => 'For help with this plugin,,for more information and advanced options ' ), 'http://plugins.svn.wordpress.org/youtube-embed/tags/' . youtube_embed_version . '/readme.txt' );
29
- }
30
- ?>
31
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/aye-display-readme.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * README Page
4
+ *
5
+ * Display the README instructions
6
+ *
7
+ * @package Artiss-YouTube-Embed
8
+ * @since 2.4
9
+ */
10
+ ?>
11
+ <div class="wrap" style="width: 1010px;">
12
+ <div class="icon32" id="icon-edit-pages"></div>
13
+
14
+ <?php $plugin = 'Artiss YouTube Embed'; ?>
15
+
16
+ <h2><?php _e( $plugin . ' README' ); ?></h2>
17
+
18
+ <?php
19
+ if ( !function_exists( 'wp_readme_parser' ) ) {
20
+ echo '<p>You shouldn\'t be able to see this but I guess that odd things can happen!<p>';
21
+ echo '<p>To display the README you must install the <a href="http://wordpress.org/extend/plugins/wp-readme-parser/">README Parser plugin</a>.</p>';
22
+ } else {
23
+ echo wp_readme_parser( array( 'exclude' => 'meta,upgrade notice,screenshots,support,changelog,links,installation,licence', 'ignore' => 'For help with this plugin,,for more information and advanced options ' ), 'http://plugins.svn.wordpress.org/youtube-embed/tags/' . youtube_embed_version . '/readme.txt' );
24
+ }
25
+ ?>
26
+ </div>
includes/aye-function-calls.php CHANGED
@@ -53,6 +53,7 @@ function youtube_video_embed( $content, $paras = '', $style = '' ) {
53
  $color = aye_get_parameters( $paras, 'color' );
54
  $theme = aye_get_parameters( $paras, 'theme' );
55
  $https = aye_get_parameters( $paras, 'ssl' );
 
56
  $dynamic = aye_get_parameters( $paras, 'dynamic' );
57
  $search = aye_get_parameters( $paras, 'search' );
58
  $user = aye_get_parameters( $paras, 'user' );
@@ -63,7 +64,7 @@ function youtube_video_embed( $content, $paras = '', $style = '' ) {
63
  // Set up Autohide parameter
64
  $autohide = aye_set_autohide( $autohide );
65
 
66
- echo aye_generate_youtube_code( $content, $type, $width, $height, aye_convert( $fullscreen ), aye_convert( $related ), aye_convert( $autoplay ), aye_convert( $loop ), $start, aye_convert( $info ), aye_convert_3( $annotation ), aye_convert( $cc ), $style, aye_convert( $link ), aye_convert( $react ), $stop, aye_convert( $sweetspot ), aye_convert( $disablekb ), $ratio, $autohide, $controls, $profile, $list, aye_convert( $audio ), $template, aye_convert( $hd ), $color, $theme, aye_convert( $https ), aye_convert( $dynamic ), aye_convert( $search ), aye_convert( $user ) );
67
  return;
68
  }
69
 
@@ -81,10 +82,9 @@ function youtube_video_embed( $content, $paras = '', $style = '' ) {
81
  * @param string $paras Parameters
82
  * @param string $style CSS information
83
  * @param string $alt Alt text
84
- * @parm string $nolink Whether to add a link or not
85
  */
86
 
87
- function youtube_thumb_embed( $content, $paras = '', $style = '', $alt = '', $nolink = '' ) {
88
 
89
  $class = aye_get_parameters( $paras, 'class' );
90
  $rel = aye_get_parameters( $paras, 'rel' );
@@ -93,7 +93,7 @@ function youtube_thumb_embed( $content, $paras = '', $style = '', $alt = '', $no
93
  $height = aye_get_parameters( $paras, 'height' );
94
  $version = aye_get_parameters( $paras, 'version' );
95
 
96
- echo aye_generate_thumbnail_code( $content, $style, $class, $rel, $target, $width, $height, $alt, $version, $nolink );
97
 
98
  return;
99
  }
@@ -159,7 +159,7 @@ function get_youtube_transcript_xml ( $id ) {
159
  if ( strlen( $embed_type ) > 1 ) {
160
  echo aye_error( $embed_type );
161
  } else {
162
- echo aye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) );
163
  }
164
  return;
165
  }
@@ -170,7 +170,7 @@ function get_youtube_transcript_xml ( $id ) {
170
 
171
  // Check success and return appropriate output
172
  if ( $xml[ 'rc' ] > 0 ) {
173
- echo aye_error( sprintf( __( 'Could not fetch the transcript file %s.', 'youtube-embed' ), $id ) );
174
  return;
175
  } else {
176
  return $xml;
@@ -220,7 +220,7 @@ function get_youtube_name( $id ) {
220
  if ( strlen( $embed_type ) > 1 ) {
221
  echo aye_error( $embed_type );
222
  } else {
223
- echo aye_error( sprintf( __ ( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) );
224
  }
225
 
226
  // Return the video title
53
  $color = aye_get_parameters( $paras, 'color' );
54
  $theme = aye_get_parameters( $paras, 'theme' );
55
  $https = aye_get_parameters( $paras, 'ssl' );
56
+ $title = aye_get_parameters( $paras, 'title' );
57
  $dynamic = aye_get_parameters( $paras, 'dynamic' );
58
  $search = aye_get_parameters( $paras, 'search' );
59
  $user = aye_get_parameters( $paras, 'user' );
64
  // Set up Autohide parameter
65
  $autohide = aye_set_autohide( $autohide );
66
 
67
+ echo aye_generate_youtube_code( $content, $type, $width, $height, aye_convert( $fullscreen ), aye_convert( $related ), aye_convert( $autoplay ), aye_convert( $loop ), $start, aye_convert( $info ), aye_convert_3( $annotation ), aye_convert( $cc ), $style, aye_convert( $link ), aye_convert( $react ), $stop, aye_convert( $sweetspot ), aye_convert( $disablekb ), $ratio, $autohide, aye_convert( $controls ), $profile, $list, aye_convert( $audio ), $template, aye_convert( $hd ), $color, $theme, aye_convert( $https ), $title, aye_convert( $dynamic ), aye_convert( $search ), aye_convert( $user ) );
68
  return;
69
  }
70
 
82
  * @param string $paras Parameters
83
  * @param string $style CSS information
84
  * @param string $alt Alt text
 
85
  */
86
 
87
+ function youtube_thumb_embed( $content, $paras = '', $style = '', $alt = '' ) {
88
 
89
  $class = aye_get_parameters( $paras, 'class' );
90
  $rel = aye_get_parameters( $paras, 'rel' );
93
  $height = aye_get_parameters( $paras, 'height' );
94
  $version = aye_get_parameters( $paras, 'version' );
95
 
96
+ echo aye_generate_thumbnail_code( $content, $style, $class, $rel, $target, $width, $height, $alt, $version );
97
 
98
  return;
99
  }
159
  if ( strlen( $embed_type ) > 1 ) {
160
  echo aye_error( $embed_type );
161
  } else {
162
+ echo aye_error( sprintf( __( 'The YouTube ID of %s is invalid.' ), $id ) );
163
  }
164
  return;
165
  }
170
 
171
  // Check success and return appropriate output
172
  if ( $xml[ 'rc' ] > 0 ) {
173
+ echo aye_error( sprintf( __( 'Could not fetch the transcript file %s.' ), $id ) );
174
  return;
175
  } else {
176
  return $xml;
220
  if ( strlen( $embed_type ) > 1 ) {
221
  echo aye_error( $embed_type );
222
  } else {
223
+ echo aye_error( sprintf( __ ( 'The YouTube ID of %s is invalid.' ), $id ) );
224
  }
225
 
226
  // Return the video title
includes/aye-generate-download-code.php CHANGED
@@ -20,7 +20,7 @@
20
 
21
  function aye_generate_download_code( $id ) {
22
 
23
- if ( $id == '' ) { return aye_error( __ ( 'No YouTube ID was found.', 'youtube-embed' ) ); }
24
 
25
  // Extract the ID if a full URL has been specified
26
  $id = aye_extract_id( $id );
@@ -31,7 +31,7 @@ function aye_generate_download_code( $id ) {
31
  if ( strlen( $embed_type ) > 1 ) {
32
  return aye_error( $embed_type );
33
  } else {
34
- return aye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) );
35
  }
36
  }
37
 
20
 
21
  function aye_generate_download_code( $id ) {
22
 
23
+ if ( $id == '' ) { return aye_error( __ ( 'No YouTube ID was found.' ) ); }
24
 
25
  // Extract the ID if a full URL has been specified
26
  $id = aye_extract_id( $id );
31
  if ( strlen( $embed_type ) > 1 ) {
32
  return aye_error( $embed_type );
33
  } else {
34
+ return aye_error( sprintf( __( 'The YouTube ID of %s is invalid.' ), $id ) );
35
  }
36
  }
37
 
includes/aye-generate-embed-code.php CHANGED
@@ -1,629 +1,622 @@
1
- <?php
2
- /**
3
- * Generate embed code
4
- *
5
- * Functions calls to generate the required YouTube code
6
- *
7
- * @package Artiss-YouTube-Embed
8
- */
9
-
10
- /**
11
- * Generate embed code
12
- *
13
- * Generate XHTML compatible YouTube embed code
14
- *
15
- * @since 2.0
16
- *
17
- * @uses aye_error Display an error
18
- * @uses aye_extract_id Get the video ID
19
- * @uses aye_validate_list Get the requested listr
20
- * @uses aye_validate_id Validate the video ID
21
- * @uses aye_validate_profile Get the requested profile
22
- * @uses aye_set_general_defaults Get general options
23
- * @uses aye_set_profile_defaults Set default profile options
24
- *
25
- * @param string $id Video ID
26
- * @param string $type Embed type
27
- * @param string $width Video width
28
- * @param string $height Video height
29
- * @param string $fullscreen Fullscreen button
30
- * @param string $related Show related info.
31
- * @param string $autoplay Start video automatically
32
- * @param string $loop Loop video to start
33
- * @param string $start Start in seconds
34
- * @param string $info Show video info.
35
- * @param string $annotation Annotations
36
  * @param string $cc Closed captions
37
- * @param string $style Stylesheet information
38
- * @param string $link Link back to YouTube
39
- * @param string $react Show EmbedPlus reactions
40
- * @param string $stop Stop in seconds
41
- * @param string $sweetspot Show EmbedPlus sweetspots
42
- * @param string $disablekb Disable keyboard controls
43
- * @param string $ratio Video size ratio
44
- * @param string $autohide Autohide controls
45
- * @param string $controls Display controls
46
- * @param string $profile Which profile to use
47
- * @param string $list_style How to use a list, if used
48
- * @param string $audio Only show controls, for audio playback
49
- * @param string $template Display template
50
- * @param string $hd Use HD, if available
51
- * @param string $color Progress bar colour
52
- * @param string $theme Use dark or light theme
53
- * @param string $https Use HTTPS for links
54
- * @param string $dynamic Show dynamic output
55
- * @param string $search Perform a search
56
- * @param string $user Look up user videos
57
- * @return string Code output
58
- */
59
-
60
- function aye_generate_youtube_code( $id = '', $type = '', $width = '', $height = '', $fullscreen = '', $related = '', $autoplay = '', $loop = '', $start = '', $info = '', $annotation = '', $cc = '', $style = '', $link = '', $react = '', $stop = '', $sweetspot = '', $disablekb = '', $ratio = '', $autohide = '', $controls = '', $profile = '', $list_style = '', $audio = '', $template = '', $hd = '', $color = '', $theme = '', $https = '', $dynamic = '', $search = '', $user = '' ) {
61
-
62
- // Ensure an ID is passed
63
-
64
- if ( $id == '' ) { return aye_error( __( 'No video/playlist ID has been supplied', 'youtube-embed' ) ); }
65
-
66
- // Get general options
67
-
68
- $general = aye_set_general_defaults();
69
-
70
- // Find the profile, if one is specified
71
-
72
- $profile = aye_validate_profile( $profile, $general[ 'profile_no' ] );
73
-
74
- // Get default values if no values are supplied
75
-
76
- $options = aye_set_profile_defaults( $profile );
77
-
78
- // If a user look-up or search has been requested, mis-out looking up list details and
79
- // simple assign it as an IFRAME video
80
-
81
- if ( ( $user == 0 ) && ( $search == 0 ) ) {
82
-
83
- // Check it's not a list
84
-
85
- $playlist_ids = '';
86
- $list = aye_validate_list( $id, $general[ 'list_no' ] );
87
- if ( !is_array( $list ) ) {
88
-
89
- // Check if certain parameters are included in the URL
90
-
91
- $width = aye_get_url_para( $id, 'w', $width );
92
- $height = aye_get_url_para( $id, 'h', $height );
93
-
94
- // Extract the ID if a full URL has been specified
95
-
96
- $id = aye_extract_id( $id );
97
-
98
- // Is it being previewed? In which case remove any cache
99
-
100
- if ( ( preg_match( '/p=([0-9]*)&preview=true/', $_SERVER['QUERY_STRING'] ) == 1 ) && ( $general[ 'preview' ] == 1 ) ) {
101
- delete_transient( 'aye_type_' . $id );
102
- delete_transient( 'aye_title_' . $id );
103
- }
104
-
105
- // Check what type of video it is and whether it's valid
106
-
107
- $return = aye_validate_id( $id, true );
108
- $embed_type = $return[ 'type' ];
109
-
110
- // If the video is invalid, output an appropriate error
111
-
112
- if ( ( $embed_type == '' ) or ( strlen ( $embed_type ) != 1 ) ) {
113
- if ( $embed_type == '' ) {
114
- $error = sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id );
115
- } else {
116
- $error = $embed_type;
117
- }
118
- $result = "\n<!-- YouTube Embed v" . youtube_embed_version . " | http://www.artiss.co.uk/youtube-embed -->\n";
119
- $result .= "<!-- " . $error . " -->\n" . aye_decode( $general[ 'error_message' ] ) . "\n<!-- End of YouTube Embed code -->\n";
120
- return $result;
121
- }
122
-
123
- } else {
124
-
125
- $return = '';
126
- $embed_type = 'v';
127
-
128
- // Randomize the video
129
-
130
- if ( $list_style == 'random' ) { shuffle( $list ); }
131
-
132
- // Extract one video randomly
133
-
134
- if ( $list_style == 'single' ) {
135
- $id = $list[ array_rand( $list, 1 ) ];
136
-
137
- // Build the playlist
138
-
139
- } else {
140
-
141
- $id = $list [ 0 ];
142
-
143
- // Build the playlist
144
-
145
- if ( count( $list ) > 1 ) {
146
- $loop = 1;
147
- while ( $loop < count( $list ) ) {
148
- if ( $playlist_ids != '' ) { $playlist_ids .= ','; }
149
- $list_id = aye_extract_id( $list[ $loop ] );
150
- $playlist_ids .= $list_id;
151
- $loop ++;
152
- }
153
- }
154
- }
155
- }
156
- }
157
-
158
- // Generate a cache key for the above passed parameters
159
-
160
- $cache_key = 'aye_video_' . md5( $id . $type . $width . $height . $fullscreen . $related . $autoplay . $loop . $start . $info . $annotation . $cc . $style . $link . $react . $stop . $sweetspot . $disablekb . $ratio . $autohide . $controls . $profile . $list_style . $audio . $template . $hd . $color . $theme . $https . $dynamic . $search . $user . serialize( $general ) . serialize( $options ) . serialize( $list ) . serialize( $return ) );
161
-
162
- // Try and get the output from cache. If it exists, return the code
163
-
164
- if ( ( $general[ 'embed_cache' ] != 0 ) && ( !is_feed() ) && ( $list_style != 'random' ) ) {
165
- $result = get_transient( $cache_key );
166
- if ( $result !== false) { return $result; }
167
- }
168
-
169
- $metadata = $general[ 'metadata' ];
170
-
171
- // Work out correct protocol to use - HTTP or HTTPS
172
-
173
- if ( $https == '' ) { $https = $options[ 'https' ]; }
174
- if ( $https == 1 ) { $https = 's'; } else { $https = ''; }
175
-
176
- // If this is a feed then display a thumbnail and/or text link to the original video
177
-
178
- if ( is_feed () ) {
179
- $result = '';
180
- if ( $playlist_ids != '' ) {
181
- $result .= '<p>'.__( 'A video list cannot be viewed within this feed - please view the original content', 'youtube-embed' ).".</p>\n";
182
- } else {
183
- $youtube_url = 'http' . $https . '://www.youtube.com/watch?' . $embed_type . '=' . $id;
184
- if ( ( $embed_type == 'v' ) && ( $general[ 'feed' ] != 't' ) ) { $result .= '<p><a href="' . $youtube_url . '"><img src="http://img.youtube.com/vi/' . $id . '/' . $general[ 'thumbnail' ] . ".jpg\"></a></p>\n"; }
185
- if ( ( $general ['feed'] != 'v' ) or ( $embed_type != 'v' ) ) { $result .= '<p><a href="' . $youtube_url . '">' . __( 'Click here to view the video on YouTube', 'youtube-embed' ) . "</a>.</p>\n"; }
186
- }
187
- return $result;
188
- }
189
-
190
- // If a dynamic size has been requested, check whether the width should be fixed
191
-
192
- $fixed = 0;
193
- if ( $dynamic == '' ) {
194
- $dynamic = $options[ 'dynamic' ];
195
- $fixed = $options[ 'fixed' ];
196
- } else {
197
- if ( $width != '' ) { $fixed = 1; }
198
- }
199
-
200
- // Only set width and height from defaults if both are missing
201
-
202
- if ( ( $width == '' ) && ( $height == '' ) ) {
203
-
204
- $width = $options[ 'width' ];
205
- $height = $options[ 'height' ];
206
- }
207
-
208
- // If controls parameter is not numeric then convert to 0 or 1
209
- // This is to maintain backwards compatibility after version 2.6
210
-
211
- if ( ( !is_numeric( $controls ) ) && ( $controls != '' ) ) {
212
- $controls = aye_convert( $controls );
213
- }
214
-
215
- // If values have not been pressed, use the default values
216
-
217
- if ( $fullscreen == '' ) { $fullscreen = $options[ 'fullscreen' ]; }
218
- if ( $related == '' ) { $related = $options[ 'related' ]; }
219
- if ( $autoplay == '' ) { $autoplay = $options[ 'autoplay' ]; }
220
- if ( $loop == '' ) { $loop = $options[ 'loop' ]; }
221
- if ( $info == '' ) { $info = $options[ 'info' ]; }
222
- if ( $annotation == '' ) { $annotation = $options[ 'annotation' ]; }
223
- if ( $cc == '' ) { $cc = $options[ 'cc' ]; }
224
- if ( $link == '' ) { $link = $options[ 'link' ]; }
225
- if ( $react == '' ) { $react = $options[ 'react' ]; }
226
- if ( $sweetspot == '' ) { $sweetspot = $options[ 'sweetspot' ]; }
227
- if ( $disablekb == '' ) { $disablekb = $options[ 'disablekb' ]; }
228
- if ( $autohide == '' ) { $autohide = $options[ 'autohide' ]; }
229
- if ( $controls == '' ) { $controls = $options[ 'controls' ]; }
230
- if ( $audio == '' ) { $audio = $options[ 'audio' ]; }
231
- if ( $hd == '' ) { $hd = $options[ 'hd' ]; }
232
- if ( $style == '' ) { $style = $options[ 'style' ]; }
233
- if ( $color == '' ) { $color = $options[ 'color' ]; }
234
- if ( $theme == '' ) { $theme = $options[ 'theme' ]; }
235
-
236
- $wmode = $options[ 'wmode' ];
237
-
238
- if ( $theme == '' ) { $theme = $options[ 'theme' ]; }
239
-
240
- // Build the required template
241
-
242
- if ( $template == '' ) { $template = $options[ 'template' ]; } else { $template = aye_decode( $template ); }
243
- if ( strpos( $template, '%video%' ) === false ) { $template = '%video%'; }
244
-
245
- // If a multi-play list has been specified and EmbedPlus selected, use fallback embedding method instead
246
-
247
- if ( ( $playlist_ids != '' ) && ( $type == 'm' ) && ( $list_style != 'single' ) ) { $type = $options[ 'fallback' ]; }
248
-
249
- // If looping and no playlist has been generated, add the current ID
250
- // This is a workaround for the AS3 player which won't otherwise loop
251
-
252
- if ( ( $loop == 1 ) && ( $embed_type != 'p' ) && ( $playlist_ids == '' ) ) { $playlist_ids = $id; }
253
-
254
- // If no type was specified, depending on whether this is a video or playlist, set the specific default
255
-
256
- if ( $type == '' ) {
257
- if ( $embed_type == 'v' ) {
258
- $type = $options[ 'type' ];
259
- } else {
260
- $type = $options[ 'playlist' ];
261
- }
262
- }
263
-
264
- // If a playlist, user or search was specified and this is is Chromeless, switch back to IFRAME to allow
265
-
266
- if ( ( ( $embed_type == 'p' ) or ( $user != 0 ) or ( $search != 0 ) ) && ( $type == 'c' ) ) { $type = 'v'; }
267
-
268
- // Set parameters without default values
269
-
270
- if ( $start == '' ) { $start = '0'; }
271
- if ( $stop == '' ) { $stop = '0'; }
272
-
273
- // If height or width is missing, calculate missing parameter using ratio
274
-
275
- if ( ( ( $width == '' ) or ( $height == '' ) ) && ( ( $width != '' ) or ( $height != '' ) ) ) {
276
- $ratio_to_use = '';
277
- if ( $ratio != '' ) {
278
-
279
- // Extract the ratio from the provided string
280
-
281
- $pos = strpos( $ratio, ':', 0 );
282
- if ( $pos !== false ) {
283
- $ratio_l = substr( $ratio, 0, $pos );
284
- $ratio_r = substr( $ratio, $pos + 1 );
285
- if ( ( is_numeric( $ratio_l ) ) && ( is_numeric( $ratio_r ) ) ) { $ratio_to_use = $ratio_l / $ratio_r; }
286
- }
287
- }
288
-
289
- // If no, or invalid, ratio supplied, calculate from the default video dimensions
290
-
291
- if ( $ratio_to_use == '' ) { $ratio_to_use = $options[ 'width' ] / $options[ 'height' ]; }
292
-
293
- // Complete the missing width or height using the ratio
294
-
295
- if ( $width == '' ) { $width = round( $height * $ratio_to_use, 0); }
296
- if ( $height == '' ) { $height = round( $width / $ratio_to_use, 0); }
297
- }
298
-
299
- // Set Frameborder output
300
-
301
- $frameborder = '';
302
- if ( isset( $general[ 'frameborder' ] ) ) { if ( $general[ 'frameborder' ] == 1 ) { $frameborder = 'frameborder="0" '; } }
303
-
304
- // If audio playback option is set, restrict the height to just show the player toolbar
305
-
306
- if ( $audio == '1' ) { $height = 27; }
307
-
308
- // Set up embed types
309
-
310
- $tab = '';
311
- $class = 'youtube-player';
312
- $paras = '';
313
-
314
- $embedplus = false;
315
- $swf = false;
316
- $iframe = false;
317
- $chromeless = false;
318
-
319
- if ( ( $type == 'm' ) && ( ( $user != 0 ) or ( $search != 0 ) ) ) { $type = $options[ 'fallback' ]; }
320
-
321
- if ( $type != 'v' ) {
322
- if ( $type == 'm' ) {
323
- $embedplus = true;
324
- $tab = "\t";
325
- $embedheight = $height + 32;
326
- $class = 'cantembedplus';
327
- $fallback = $options[ 'fallback' ];
328
- } else {
329
- if ( $type == "c" ) {
330
- $chromeless = true;
331
- } else {
332
- $swf = true;
333
- }
334
- }
335
- $paras .= '&amp;version=3';
336
- } else {
337
- $iframe = true;
338
- }
339
-
340
- // Generate parameters to add to URL
341
-
342
- if ( $options[ 'modest' ] == 1 ) { $paras .= '&amp;modestbranding=1'; }
343
- if ( $fullscreen == 1 ) { $paras .= '&amp;fs=1'; } else { $paras .= '&amp;fs=0'; }
344
- if ( $related != 1 ) { $paras .= '&amp;rel=0'; }
345
- if ( $autoplay == 1 ) { $paras .= '&amp;autoplay=1'; $paras_ep .= '&amp;autoplay=1'; }
346
- if ( $loop == 1 ) { $paras .= '&amp;loop=1'; }
347
- if ( $info != 1 ) { $paras .= '&amp;showinfo=0'; }
348
- if ( $annotation != 1 ) { $paras .= '&amp;iv_load_policy=3'; }
349
- if ( $cc == 1 ) { $paras .= '&amp;cc_load_policy=1'; }
350
- if ( $disablekb == 1 ) { $paras .= '&amp;disablekb=1'; }
351
- if ( $autohide != 2 ) { $paras .= '&amp;autohide=' . $autohide; }
352
- if ( $controls != 1 ) { $paras .= '&amp;controls=' . $controls; }
353
- if ( strtolower( $color ) != 'red' ) { $paras .= '&amp;color=' . strtolower( $color ); }
354
- if ( strtolower( $theme ) != 'dark' ) { $paras .= '&amp;theme=' . strtolower( $theme ); }
355
-
356
- // If not a playlist, add the playlist parameter
357
-
358
- if ( $playlist_ids != '' ) { $paras .= '&amp;playlist=' . $playlist_ids; }
359
-
360
- // Generate EmbedPlus parameters
361
-
362
- $paras_ep = '&amp;width=' . $width . '&amp;height=' . $height;
363
- if ( $react != 1 ) { $paras_ep .= '&amp;react=0'; }
364
- if ( $sweetspot != 1 ) { $paras_ep .= '&amp;sweetspot=0'; }
365
- if ( $hd == 1 ) { $paras_ep .= '&amp;hd=1'; }
366
-
367
- // Add start & stop parameters
368
-
369
- if ( $start != 0 ) { $paras .= '&amp;start=' . $start; $paras_ep .= '&amp;start=' . $start; }
370
- if ( $stop != 0 ) { $paras_ep .= '&amp;stop=' . $stop; $paras .= '&amp;end=' . $stop; }
371
-
372
- // Generate DIVs to wrap around video
373
-
374
- if ( $dynamic == 1) {
375
- $result = "<div class=\"ye-container\">\n";
376
- if ( $fixed == 1) { $result = '<div style="width: ' . $width . 'px; max-width: 100%">' . "\n" . $result; }
377
- }
378
-
379
- // Add EmbedPlus code
380
-
381
- if ( $embedplus ) {
382
- $result .= "<object type=\"application/x-shockwave-flash\" width=\"" . $width . "\" height=\"" . $embedheight . "\" data=\"http://getembedplus.com/embedplus.swf\" style=\"" . $style . "\" id=\"" . uniqid( 'ep_', true ) . "\" >\n";
383
- $result .= "\t<param value=\"http://getembedplus.com/embedplus.swf\" name=\"movie\" />\n";
384
- $result .= "\t<param value=\"high\" name=\"quality\" />\n";
385
- $result .= "\t<param value=\"" . $wmode . "\" name=\"wmode\" />\n";
386
- $result .= "\t<param value=\"always\" name=\"allowscriptaccess\" />\n";
387
- if ( $fullscreen == 1 ) { $result .= "\t<param name=\"allowFullScreen\" value=\"true\" />\n"; }
388
- $result .= "\t<param name=\"flashvars\" value=\"ytid=" . $id . $paras_ep . "\" />\n";
389
- }
390
-
391
- // Work out, depending on privacy settings, the main address to use
392
-
393
- $privacy = $general[ 'privacy' ];
394
-
395
- if ( $privacy == 2 ) {
396
- $do_not_track = aye_do_not_track();
397
- if ( $do_not_track ) { $privacy = 1; } else { $privacy = 0; }
398
- }
399
-
400
- if ( $privacy == 1 ) { $url_privacy = 'youtube-nocookie.com'; } else { $url_privacy = 'youtube.com'; }
401
-
402
- // Generate the first part of the embed URL along with the ID section
403
-
404
- if ( $chromeless ) {
405
- $embed_url = 'http' . $https . '://www.youtube.com/apiplayer';
406
- $id_paras = '?video_id=' . $id;
407
- } else {
408
- $embed_url = 'http' . $https . '://www.' . $url_privacy . '/';
409
- if ( $type == 'v' ) {
410
- $embed_url .= 'embed';
411
- } else {
412
- $embed_url .= 'v/';
413
- }
414
- $id_paras = $id;
415
- if ( $type == 'v' ) { $id_paras = '/' . $id_paras; }
416
- }
417
-
418
- // If a playlist, user or download build the ID appropriately
419
-
420
- if ( ( $embed_type == 'p' ) or ( $user != 0 ) or ( $search != 0 ) ) {
421
-
422
- $list_type = '';
423
- if ( $embed_type == 'p' ) { $list_type = 'playlist'; }
424
- if ( $user != 0 ) { $list_type = 'user_uploads'; }
425
- if ( $search != 0 ) { $list_type = 'search'; $id = urlencode( $id ); }
426
-
427
- $id_paras = '';
428
- if ( $type == 'p' ) { $id_paras .= 'videoseries'; }
429
- $id_paras .= '?listType=' . $list_type . '&amp;list=';
430
- if ( ( $embed_type == 'p' ) && ( strtolower( substr ( $id, 0, 2 ) ) != 'pl' ) ) { $id_paras .= 'PL'; }
431
- $id_paras .= $id;
432
- }
433
-
434
- // Combine URL parts together
435
-
436
- $embed_url .= $id_paras;
437
- if ( ( !strpos( $embed_url, '?' ) ) && ( substr( $paras, 0, 5 ) == '&amp;' ) ) { $paras = '?' . substr( $paras, 5 ); }
438
- $embed_url .= $paras;
439
-
440
- // Add AS3 YouTube embed code
441
-
442
- if ( ( $swf ) or ( $chromeless ) or ( ( $embedplus ) && ( ( $fallback == 'o' ) or ( $fallback == 'p' ) ) ) ) {
443
-
444
- $result .= $tab . "<object class=\"" . $class . "\" type=\"application/x-shockwave-flash\" data=\"" . $embed_url . "\" width=\"" . $width . "\" height=\"" . $height . "\" style=\"" . $style . "\"";
445
-
446
- if ( $metadata != 0 ) { $result .= " rel=\"media:video\" resource=\"http" . $https . "://www.youtube.com/" . $embed_type . "/" . $id ."\" xmlns:media=\"http://search.yahoo.com/searchmonkey/media/\""; }
447
- $result .= " >\n";
448
- if ( $metadata != 0 ) { $result .= $tab . "\t<a rel=\"media:thumbnail\" href=\"http://img.youtube.com/vi/" . $id . "/default.jpg\" /></a>\n"; }
449
- $result .= $tab . "\t<param name=\"movie\" value=\"" . $embed_url . "\" />\n";
450
- $result .= $tab . "\t<param name=\"wmode\" value=\"" . $wmode . "\" />\n";
451
- if ( $fullscreen == 1 ) { $result .= $tab . "\t<param name=\"allowFullScreen\" value=\"true\" />\n"; }
452
- if ( ( $link != 1 ) && ( $link != '' ) ) { $result .= $tab . "\t<param name=\"allowNetworking\" value=\"internal\" />\n"; }
453
- if ( ( $metadata != 0 ) && ( $return[ 'title' ] != '' ) ) { $result .= $tab . "\t<span property=\"media:title\" content=\"" . htmlentities( $return[ 'title' ] ) . "\" />\n"; }
454
- $result .= $tab . "</object>\n";
455
- }
456
-
457
- // Add IFRAME embed code
458
-
459
- if ( ( $iframe ) or ( ( $embedplus ) && ( $fallback == "v" ) ) ) {
460
- if ( $embed_type == "p" ) { $playlist_para = "p/"; } else { $playlist_para = ''; }
461
- $result .= $tab . '<iframe ' . $frameborder . 'style="border: 0;' . $style . '" class="' . $class . '" width="' . $width . '" height="' . $height . '" src="' . $embed_url . '&amp;wmode=' . $wmode . '"';
462
- if ( $fullscreen == 1 ) { $result .= ' allowfullscreen="allowfullscreen"'; }
463
- $result .= " ></iframe>\n";
464
- }
465
-
466
- // If using EmbedPlus, add the OBJECT closure tag
467
-
468
- if ( $embedplus ) { $result .= "</object>\n<!--[if lte IE 6]> <style type=\"text/css\">.cantembedplus{display:none;}</style><![endif]-->\n"; }
469
-
470
- // Now apply the template to the result
471
-
472
- $end_tag = '';
473
- if ( $dynamic == 1 ) {
474
- $end_tag .= "</div>\n";
475
- if ( $fixed == 1 ) { $end_tag .= "</div>\n"; }
476
- }
477
- $result = str_replace( '%video%', $result . $end_tag, $template );
478
-
479
- // Now add a commented header and trailer
480
-
481
- $result = "\n<!-- YouTube Embed v" . youtube_embed_version . " | http://www.artiss.co.uk/youtube-embed -->\n" . $result;
482
- $result .= "<!-- End of YouTube Embed code -->\n";
483
-
484
- // Cache the output
485
-
486
- if ( $general[ 'embed_cache' ] != 0 ) { set_transient( $cache_key, $result, 3600 * $general[ 'embed_cache' ] ); }
487
-
488
- return $result;
489
- }
490
-
491
- /**
492
- * Validate a supplied profile name
493
- *
494
- * Returns a profile number for a supplied name
495
- *
496
- * @since 2.0
497
- *
498
- * @param string $name The name of the profile to find
499
- * @param string $number The number of profiles available
500
- * @return string The profile number (defaults to 0)
501
- */
502
-
503
- function aye_validate_profile( $name, $number ) {
504
-
505
- $profile = 0;
506
- $name = strtolower( $name );
507
-
508
- if ( ( $name != '' ) && ( $name != 'default' ) ) {
509
-
510
- // Loop around, fetching in profile names
511
-
512
- $loop = 1;
513
- while ( ( $loop <= $number ) && ( $profile == 0 ) ) {
514
- if ( ( $name == $loop ) or ( $name == 'Profile ' . $loop ) ) {
515
- $profile = $loop;
516
- } else {
517
- $profiles = get_option( 'youtube_embed_profile' . $loop );
518
- $profname = strtolower( $profiles[ 'name' ] );
519
- if ( $profname == $name ) { $profile = $loop; }
520
- }
521
- $loop ++;
522
- }
523
- }
524
- return $profile;
525
- }
526
-
527
- /**
528
- * Validate a supplied list name
529
- *
530
- * Returns a list for a supplied list number or name name - blank if not a valid list
531
- *
532
- * @since 2.0
533
- *
534
- * @param string $name The name of the list to find
535
- * @param string $number The number of lists available
536
- * @return string The list (defaults to blank)
537
- */
538
-
539
- function aye_validate_list( $name, $number ) {
540
-
541
- $list = '';
542
-
543
- // If the parameter contains commas, assume to be a comma seperated list and move into an array
544
-
545
- if ( strpos( $name, ',' ) !== false ) {
546
- $list = explode( ',', $name );
547
- } else {
548
-
549
- // No comma, so check if this is a named list
550
-
551
- $name = strtolower( $name );
552
-
553
- if ( $name != '' ) {
554
-
555
- // Loop around, fetching in profile names
556
-
557
- $loop = 1;
558
- while ( ( $loop <= $number ) && ( $list == '' ) ) {
559
- $listfiles = get_option( 'youtube_embed_list' . $loop );
560
- if ( ( $name == strval( $loop ) ) or ( $name == 'List ' . $loop ) ) {
561
- $list = $listfiles[ 'list' ];
562
- } else {
563
- $listname = strtolower( $listfiles[ 'name' ] );
564
- if ( $listname == $name ) { $list = $listfiles[ 'list' ]; }
565
- }
566
- $loop ++;
567
- }
568
- }
569
- if ( $list != '' ) { $list = explode( "\n", $list ); }
570
- }
571
- return $list;
572
- }
573
-
574
- /**
575
- * Get URL parameters
576
- *
577
- * Extract a requested parameter from a URL
578
- *
579
- * @since 2.0
580
- *
581
- * @param string $id The ID of the video
582
- * @param string $para The parameter to extract
583
- * @param string $current The current parameter value
584
- * @return string The parameter value
585
- */
586
-
587
- function aye_get_url_para( $id, $para, $current ) {
588
-
589
- // Look for an ampersand
590
-
591
- $start_pos = false;
592
- if ( strpos( $id, '&amp;' . $para . '=' ) !== false ) { $start_pos = strpos( $id, '&amp;' . $para . '=' ) + 6 + strlen( $para ); }
593
-
594
- // If a parameter was found, look for the end of it
595
-
596
- if ( $start_pos !== false ) {
597
- $end_pos = strpos( $id, '&amp;', $start_pos + 1 );
598
- if ( !$end_pos ) { $end_pos = strlen( $id ); }
599
-
600
- // Extract the parameter and return it
601
-
602
- $current = substr( $id, $start_pos, $end_pos - $start_pos );
603
- }
604
-
605
- return $current;
606
- }
607
-
608
- /**
609
- * Decode a string
610
- *
611
- * Decode an HTML encoded string. I'm not using htmlspecialchars_decode to maintain
612
- * PHP 4 compatibility.
613
- *
614
- * @since 2.0.3
615
- *
616
- * @param string $encoded The encoded string
617
- * @return string The decoded string
618
- */
619
-
620
- function aye_decode( $encoded ) {
621
-
622
- $find = array( '&amp;', '&quot;', '&#039;', '&lt;', '&gt;' );
623
- $replace = array( '&', '"', "'", '<', '>' );
624
-
625
- $decoded = str_replace( $find, $replace, $encoded );
626
-
627
- return $decoded;
628
- }
629
  ?>
1
+ <?php
2
+ /**
3
+ * Generate embed code
4
+ *
5
+ * Functions calls to generate the required YouTube code
6
+ *
7
+ * @package Artiss-YouTube-Embed
8
+ */
9
+
10
+ /**
11
+ * Generate embed code
12
+ *
13
+ * Generate XHTML compatible YouTube embed code
14
+ *
15
+ * @since 2.0
16
+ *
17
+ * @uses aye_error Display an error
18
+ * @uses aye_extract_id Get the video ID
19
+ * @uses aye_validate_list Get the requested listr
20
+ * @uses aye_validate_id Validate the video ID
21
+ * @uses aye_validate_profile Get the requested profile
22
+ * @uses aye_set_general_defaults Get general options
23
+ * @uses aye_set_profile_defaults Set default profile options
24
+ *
25
+ * @param string $id Video ID
26
+ * @param string $type Embed type
27
+ * @param string $width Video width
28
+ * @param string $height Video height
29
+ * @param string $fullscreen Fullscreen button
30
+ * @param string $related Show related info.
31
+ * @param string $autoplay Start video automatically
32
+ * @param string $loop Loop video to start
33
+ * @param string $start Start in seconds
34
+ * @param string $info Show video info.
35
+ * @param string $annotation Annotations
36
  * @param string $cc Closed captions
37
+ * @param string $style Stylesheet information
38
+ * @param string $link Link back to YouTube
39
+ * @param string $react Show EmbedPlus reactions
40
+ * @param string $stop Stop in seconds
41
+ * @param string $sweetspot Show EmbedPlus sweetspots
42
+ * @param string $disablekb Disable keyboard controls
43
+ * @param string $ratio Video size ratio
44
+ * @param string $autohide Autohide controls
45
+ * @param string $controls Display controls
46
+ * @param string $profile Which profile to use
47
+ * @param string $list_style How to use a list, if used
48
+ * @param string $audio Only show controls, for audio playback
49
+ * @param string $template Display template
50
+ * @param string $hd Use HD, if available
51
+ * @param string $color Progress bar colour
52
+ * @param string $theme Use dark or light theme
53
+ * @param string $https Use HTTPS for links
54
+ * @param string $title Video title
55
+ * @param string $dynamic Show dynamic output
56
+ * @param string $search Perform a search
57
+ * @param string $user Look up user videos
58
+ * @return string Code output
59
+ */
60
+
61
+ function aye_generate_youtube_code( $id = '', $type = '', $width = '', $height = '', $fullscreen = '', $related = '', $autoplay = '', $loop = '', $start = '', $info = '', $annotation = '', $cc = '', $style = '', $link = '', $react = '', $stop = '', $sweetspot = '', $disablekb = '', $ratio = '', $autohide = '', $controls = '', $profile = '', $list_style = '', $audio = '', $template = '', $hd = '', $color = '', $theme = '', $https = '', $title = '', $dynamic = '', $search = '', $user = '' ) {
62
+
63
+ // Ensure an ID is passed
64
+
65
+ if ( $id == '' ) { return aye_error( __( 'No video/playlist ID has been supplied' ) ); }
66
+
67
+ // Get general options
68
+
69
+ $general = aye_set_general_defaults();
70
+
71
+ // Find the profile, if one is specified
72
+
73
+ $profile = aye_validate_profile( $profile, $general[ 'profile_no' ] );
74
+
75
+ // Get default values if no values are supplied
76
+
77
+ $options = aye_set_profile_defaults( $profile );
78
+
79
+ // If a user look-up or search has been requested, mis-out looking up list details and
80
+ // simple assign it as an IFRAME video
81
+
82
+ if ( ( $user == 0 ) && ( $search == 0 ) ) {
83
+
84
+ // Check it's not a list
85
+
86
+ $playlist_ids = '';
87
+ $list = aye_validate_list( $id, $general[ 'list_no' ] );
88
+ if ( !is_array( $list ) ) {
89
+
90
+ // Check if certain parameters are included in the URL
91
+
92
+ $width = aye_get_url_para( $id, 'w', $width );
93
+ $height = aye_get_url_para( $id, 'h', $height );
94
+
95
+ // Extract the ID if a full URL has been specified
96
+
97
+ $id = aye_extract_id( $id );
98
+
99
+ // Is it being previewed? In which case remove any cache
100
+
101
+ if ( ( preg_match( '/p=([0-9]*)&preview=true/', $_SERVER['QUERY_STRING'] ) == 1 ) && ( $general[ 'preview' ] == 1 ) ) {
102
+ delete_transient( 'aye_type_' . $id );
103
+ delete_transient( 'aye_title_' . $id );
104
+ }
105
+
106
+ // Check what type of video it is and whether it's valid
107
+
108
+ $return = aye_validate_id( $id, true );
109
+ $title = $return['title'];
110
+ $embed_type = $return[ 'type' ];
111
+
112
+ // If the video is invalid, output an appropriate error
113
+
114
+ if ( ( $embed_type == '' ) or ( strlen ( $embed_type ) != 1 ) ) {
115
+ if ( $embed_type == '' ) {
116
+ $error = 'The YouTube ID of ' . $id . ' is invalid.';
117
+ } else {
118
+ $error = $embed_type;
119
+ }
120
+ $result = "\n<!-- YouTube Embed v" . youtube_embed_version . " | http://www.artiss.co.uk/artiss-youtube-embed -->\n";
121
+ $result .= "<!-- " . $error . " -->\n" . aye_decode( $general[ 'error_message' ] ) . "\n<!-- End of YouTube Embed code -->\n";
122
+ return $result;
123
+ }
124
+
125
+ } else {
126
+
127
+ $embed_type = 'v';
128
+
129
+ // Randomize the video
130
+
131
+ if ( $list_style == 'random' ) { shuffle( $list ); }
132
+
133
+ // Extract one video randomly
134
+
135
+ if ( $list_style == 'single' ) {
136
+ $id = $list[ array_rand( $list, 1 ) ];
137
+
138
+ // Build the playlist
139
+
140
+ } else {
141
+
142
+ $id = $list [ 0 ];
143
+ $title = '';
144
+
145
+ // Build the playlist
146
+
147
+ if ( count( $list ) > 1 ) {
148
+ $loop = 1;
149
+ while ( $loop < count( $list ) ) {
150
+ if ( $playlist_ids != '' ) { $playlist_ids .= ','; }
151
+ $list_id = aye_extract_id( $list[ $loop ] );
152
+ $playlist_ids .= $list_id;
153
+ $loop ++;
154
+ }
155
+ }
156
+ }
157
+ }
158
+ }
159
+
160
+ // Generate a cache key for the above passed parameters
161
+
162
+ $cache_key = 'aye_video_' . base64_encode( sha1( $id . $type . $width . $height . $fullscreen . $related . $autoplay . $loop . $start . $info . $annotation . $cc . $style . $link . $react . $stop . $sweetspot . $disablekb . $ratio . $autohide . $controls . $profile . $list_style . $audio . $template . $hd . $color . $theme . $https . $dynamic . $search . $user . $title . print_r( $general, true ) . print_r( $options, true ) . print_r( $list, true ) ) );
163
+
164
+ // Try and get the output from cache. If it exists, return the code
165
+
166
+ if ( ( $general[ 'embed_cache' ] != 0 ) && ( !is_feed() ) ) {
167
+ $result = get_transient( $cache_key );
168
+ if ( $result !== false) { return $result; }
169
+ }
170
+
171
+ $metadata = $general[ 'metadata' ];
172
+
173
+ // Work out correct protocol to use - HTTP or HTTPS
174
+
175
+ if ( $https == '' ) { $https = $options[ 'https' ]; }
176
+ if ( $https == 1 ) { $https = 's'; } else { $https = ''; }
177
+
178
+ // If this is a feed then display a thumbnail and/or text link to the original video
179
+
180
+ if ( is_feed () ) {
181
+ $result = '';
182
+ if ( $playlist_ids != '' ) {
183
+ $result .= '<p>'.__('A video list cannot be viewed within this feed - please view the original content').".</p>\n";
184
+ } else {
185
+ $youtube_url = 'http' . $https . '://www.youtube.com/watch?' . $embed_type . '=' . $id;
186
+ if ( ( $embed_type == 'v' ) && ( $general[ 'feed' ] != 't' ) ) { $result .= '<p><a href="' . $youtube_url . '"><img src="http://img.youtube.com/vi/' . $id . '/' . $general[ 'thumbnail' ] . ".jpg\"></a></p>\n"; }
187
+ if ( ( $general ['feed'] != 'v' ) or ( $embed_type != 'v' ) ) { $result .= '<p><a href="' . $youtube_url . '">' . __( 'Click here to view the video on YouTube' ) . "</a>.</p>\n"; }
188
+ }
189
+ return $result;
190
+ }
191
+
192
+ // If a dynamic size has been requested, check whether the width should be fixed
193
+
194
+ $fixed = 0;
195
+ if ( $dynamic == '' ) {
196
+ $dynamic = $options[ 'dynamic' ];
197
+ $fixed = $options[ 'fixed' ];
198
+ } else {
199
+ if ( $width != '' ) { $fixed = 1; }
200
+ }
201
+
202
+ // Only set width and height from defaults if both are missing
203
+
204
+ if ( ( $width == '' ) && ( $height == '' ) ) {
205
+
206
+ $width = $options[ 'width' ];
207
+ $height = $options[ 'height' ];
208
+ }
209
+
210
+ // If values have not been pressed, use the default values
211
+
212
+ if ( $fullscreen == '' ) { $fullscreen = $options[ 'fullscreen' ]; }
213
+ if ( $related == '' ) { $related = $options[ 'related' ]; }
214
+ if ( $autoplay == '' ) { $autoplay = $options[ 'autoplay' ]; }
215
+ if ( $loop == '' ) { $loop = $options[ 'loop' ]; }
216
+ if ( $info == '' ) { $info = $options[ 'info' ]; }
217
+ if ( $annotation == '' ) { $annotation = $options[ 'annotation' ]; }
218
+ if ( $cc == '' ) { $cc = $options[ 'cc' ]; }
219
+ if ( $link == '' ) { $link = $options[ 'link' ]; }
220
+ if ( $react == '' ) { $react = $options[ 'react' ]; }
221
+ if ( $sweetspot == '' ) { $sweetspot = $options[ 'sweetspot' ]; }
222
+ if ( $disablekb == '' ) { $disablekb = $options[ 'disablekb' ]; }
223
+ if ( $autohide == '' ) { $autohide = $options[ 'autohide' ]; }
224
+ if ( $controls == '' ) { $controls = $options[ 'controls' ]; }
225
+ if ( $audio == '' ) { $audio = $options[ 'audio' ]; }
226
+ if ( $hd == '' ) { $hd = $options[ 'hd' ]; }
227
+ if ( $style == '' ) { $style = $options[ 'style' ]; }
228
+ if ( $color == '' ) { $color = $options[ 'color' ]; }
229
+ if ( $theme == '' ) { $theme = $options[ 'theme' ]; }
230
+
231
+ $wmode = $options[ 'wmode' ];
232
+
233
+ if ( $theme == '' ) { $theme = $options[ 'theme' ]; }
234
+
235
+ // Build the required template
236
+
237
+ if ( $template == '' ) { $template = $options[ 'template' ]; } else { $template = aye_decode( $template ); }
238
+ if ( strpos( $template, '%video%' ) === false ) { $template = '%video%'; }
239
+
240
+ // If a multi-play list has been specified and EmbedPlus selected, use fallback embedding method instead
241
+
242
+ if ( ( $playlist_ids != '' ) && ( $type == 'm' ) && ( $list_style != 'single' ) ) { $type = $options[ 'fallback' ]; }
243
+
244
+ // If looping and no playlist has been generated, add the current ID
245
+ // This is a workaround for the AS3 player which won't otherwise loop
246
+
247
+ if ( ( $loop == 1 ) && ( $embed_type != 'p' ) && ( $playlist_ids == '' ) ) { $playlist_ids = $id; }
248
+
249
+ // If no type was specified, depending on whether this is a video or playlist, set the specific default
250
+
251
+ if ( $type == '' ) {
252
+ if ( $embed_type == 'v' ) {
253
+ $type = $options[ 'type' ];
254
+ } else {
255
+ $type = $options[ 'playlist' ];
256
+ }
257
+ }
258
+
259
+ // If a playlist, user or search was specified and this is is Chromeless, switch back to IFRAME to allow
260
+
261
+ if ( ( ( $embed_type == 'p' ) or ( $user != 0 ) or ( $search != 0 ) ) && ( $type == 'c' ) ) { $type = 'v'; }
262
+
263
+ // Set parameters without default values
264
+
265
+ if ( $start == '' ) { $start = '0'; }
266
+ if ( $stop == '' ) { $stop = '0'; }
267
+
268
+ // If height or width is missing, calculate missing parameter using ratio
269
+
270
+ if ( ( ( $width == '' ) or ( $height == '' ) ) && ( ( $width != '' ) or ( $height != '' ) ) ) {
271
+ $ratio_to_use = '';
272
+ if ( $ratio != '' ) {
273
+
274
+ // Extract the ratio from the provided string
275
+
276
+ $pos = strpos( $ratio, ':', 0 );
277
+ if ( $pos !== false ) {
278
+ $ratio_l = substr( $ratio, 0, $pos );
279
+ $ratio_r = substr( $ratio, $pos + 1 );
280
+ if ( ( is_numeric( $ratio_l ) ) && ( is_numeric( $ratio_r ) ) ) { $ratio_to_use = $ratio_l / $ratio_r; }
281
+ }
282
+ }
283
+
284
+ // If no, or invalid, ratio supplied, calculate from the default video dimensions
285
+
286
+ if ( $ratio_to_use == '' ) { $ratio_to_use = $options[ 'width' ] / $options[ 'height' ]; }
287
+
288
+ // Complete the missing width or height using the ratio
289
+
290
+ if ( $width == '' ) { $width = round( $height * $ratio_to_use, 0); }
291
+ if ( $height == '' ) { $height = round( $width / $ratio_to_use, 0); }
292
+ }
293
+
294
+ // Set Frameborder output
295
+
296
+ if ( isset( $general[ 'frameborder' ] ) ) { if ( $general[ 'frameborder' ] == 1 ) { $frameborder = 'frameborder="0" '; } else { $frameborder = ''; } }
297
+
298
+ // If audio playback option is set, restrict the height to just show the player toolbar
299
+
300
+ if ( $audio == '1' ) { $height = 27; }
301
+
302
+ // Set up embed types
303
+
304
+ $tab = '';
305
+ $class = 'youtube-player';
306
+ $paras = '';
307
+
308
+ $embedplus = false;
309
+ $swf = false;
310
+ $iframe = false;
311
+ $chromeless = false;
312
+
313
+ if ( ( $type == 'm' ) && ( ( $user != 0 ) or ( $search != 0 ) ) ) { $type = $options[ 'fallback' ]; }
314
+
315
+ if ( $type != 'v' ) {
316
+ $paras .= '&amp;modestbranding=1';
317
+ if ( $type == 'm' ) {
318
+ $embedplus = true;
319
+ $tab = "\t";
320
+ $embedheight = $height + 32;
321
+ $class = 'cantembedplus';
322
+ $fallback = $options[ 'fallback' ];
323
+ } else {
324
+ if ( $type == "c" ) {
325
+ $chromeless = true;
326
+ } else {
327
+ $swf = true;
328
+ }
329
+ }
330
+ $paras .= '&amp;version=3';
331
+ } else {
332
+ $iframe = true;
333
+ }
334
+
335
+ // Generate parameters to add to URL
336
+
337
+ if ( $fullscreen == 1 ) { $paras .= '&amp;fs=1'; } else { $paras .= '&amp;fs=0'; }
338
+ if ( $related != 1 ) { $paras .= '&amp;rel=0'; }
339
+ if ( $autoplay == 1 ) { $paras .= '&amp;autoplay=1'; $paras_ep .= '&amp;autoplay=1'; }
340
+ if ( $loop == 1 ) { $paras .= '&amp;loop=1'; }
341
+ if ( $info != 1 ) { $paras .= '&amp;showinfo=0'; }
342
+ if ( $annotation != 1 ) { $paras .= '&amp;iv_load_policy=3'; }
343
+ if ( $cc == 1 ) { $paras .= '&amp;cc_load_policy=1'; }
344
+ if ( $disablekb == 1 ) { $paras .= '&amp;disablekb=1'; }
345
+ if ( $autohide != 2 ) { $paras .= '&amp;autohide=' . $autohide; }
346
+ if ( $controls != 1 ) { $paras .= '&amp;controls=0'; }
347
+ if ( strtolower( $color ) != 'red' ) { $paras .= '&amp;color=' . strtolower( $color ); }
348
+ if ( strtolower( $theme ) != 'dark' ) { $paras .= '&amp;theme=' . strtolower( $theme ); }
349
+ if ( $title != '' ) { $paras .= '&amp;title=' . urlencode( $title ); }
350
+
351
+ // If not a playlist, add the playlist parameter
352
+
353
+ if ( $playlist_ids != '' ) { $paras .= '&amp;playlist=' . $playlist_ids; }
354
+
355
+ // Generate EmbedPlus parameters
356
+
357
+ $paras_ep = '&amp;width=' . $width . '&amp;height=' . $height;
358
+ if ( $react != 1 ) { $paras_ep .= '&amp;react=0'; }
359
+ if ( $sweetspot != 1 ) { $paras_ep .= '&amp;sweetspot=0'; }
360
+ if ( $hd == 1 ) { $paras_ep .= '&amp;hd=1'; }
361
+
362
+ // Add start & stop parameters
363
+
364
+ if ( $start != 0 ) { $paras .= '&amp;start=' . $start; $paras_ep .= '&amp;start=' . $start; }
365
+ if ( $stop != 0 ) { $paras_ep .= '&amp;stop=' . $stop; $paras .= '&amp;end=' . $stop; }
366
+
367
+ // Generate DIVs to wrap around video
368
+
369
+ if ( $dynamic == 1) {
370
+ $result = "<div class=\"ye-container\">\n";
371
+ if ( $fixed == 1) { $result = '<div style="width: ' . $width . 'px; max-width: 100%">' . $result; }
372
+ }
373
+
374
+ // Add EmbedPlus code
375
+
376
+ if ( $embedplus ) {
377
+ $result .= "<object type=\"application/x-shockwave-flash\" width=\"" . $width . "\" height=\"" . $embedheight . "\" data=\"http://getembedplus.com/embedplus.swf\" style=\"" . $style . "\" id=\"" . uniqid( 'ep_', true ) . "\" >\n";
378
+ $result .= "\t<param value=\"http://getembedplus.com/embedplus.swf\" name=\"movie\" />\n";
379
+ $result .= "\t<param value=\"high\" name=\"quality\" />\n";
380
+ $result .= "\t<param value=\"" . $wmode . "\" name=\"wmode\" />\n";
381
+ $result .= "\t<param value=\"always\" name=\"allowscriptaccess\" />\n";
382
+ if ( $fullscreen == 1 ) { $result .= "\t<param name=\"allowFullScreen\" value=\"true\" />\n"; }
383
+ $result .= "\t<param name=\"flashvars\" value=\"ytid=" . $id . $paras_ep . "\" />\n";
384
+ }
385
+
386
+ // Work out, depending on privacy settings, the main address to use
387
+
388
+ $privacy = $general[ 'privacy' ];
389
+ if ( $privacy == 1 ) {
390
+ $url_privacy = 'youtube-nocookie.com';
391
+ } else {
392
+ $url_privacy = 'youtube.com';
393
+ }
394
+
395
+ // Generate the first part of the embed URL along with the ID section
396
+
397
+ if ( $chromeless ) {
398
+ $embed_url = 'http' . $https . '://www.youtube.com/apiplayer';
399
+ $id_paras = '?video_id=' . $id;
400
+ } else {
401
+ $embed_url = 'http' . $https . '://www.' . $url_privacy . '/';
402
+ if ( $type == 'v' ) {
403
+ $embed_url .= 'embed';
404
+ } else {
405
+ $embed_url .= 'v/';
406
+ }
407
+ $id_paras = $id;
408
+ if ( $type == 'v' ) { $id_paras = '/' . $id_paras; }
409
+ }
410
+
411
+ // If a playlist, user or download build the ID appropriately
412
+
413
+ if ( ( $embed_type == 'p' ) or ( $user != 0 ) or ( $search != 0 ) ) {
414
+
415
+ $list_type = '';
416
+ if ( $embed_type == 'p' ) { $list_type = 'playlist'; }
417
+ if ( $user != 0 ) { $list_type = 'user_uploads'; }
418
+ if ( $search != 0 ) { $list_type = 'search'; $id = urlencode( $id ); }
419
+
420
+ $id_paras = '';
421
+ if ( $type == 'p' ) { $id_paras .= 'videoseries'; }
422
+ $id_paras .= '?listType=' . $list_type . '&amp;list=';
423
+ if ( ( $embed_type == 'p' ) && ( strtolower( substr ( $id, 0, 2 ) ) != 'pl' ) ) { $id_paras .= 'PL'; }
424
+ $id_paras .= $id;
425
+ }
426
+
427
+ // Combine URL parts together
428
+
429
+ $embed_url .= $id_paras;
430
+ if ( ( !strpos( $embed_url, '?' ) ) && ( substr( $paras, 0, 5 ) == '&amp;' ) ) { $paras = '?' . substr( $paras, 5 ); }
431
+ $embed_url .= $paras;
432
+
433
+ // Add AS3 YouTube embed code
434
+
435
+ if ( ( $swf ) or ( $chromeless ) or ( ( $embedplus ) && ( ( $fallback == 'o' ) or ( $fallback == 'p' ) ) ) ) {
436
+
437
+ $result .= $tab . "<object class=\"" . $class . "\" type=\"application/x-shockwave-flash\" data=\"" . $embed_url . "\" width=\"" . $width . "\" height=\"" . $height . "\" style=\"" . $style . "\"";
438
+
439
+ if ( $metadata != 0 ) { $result .= " rel=\"media:video\" resource=\"http" . $https . "://www.youtube.com/" . $embed_type . "/" . $id ."\" xmlns:media=\"http://search.yahoo.com/searchmonkey/media/\""; }
440
+ $result .= " >\n";
441
+ if ( $metadata != 0 ) { $result .= $tab . "\t<a rel=\"media:thumbnail\" href=\"http://img.youtube.com/vi/" . $id . "/default.jpg\" />\n"; }
442
+ $result .= $tab . "\t<param name=\"movie\" value=\"" . $embed_url . "\" />\n";
443
+ $result .= $tab . "\t<param name=\"wmode\" value=\"" . $wmode . "\" />\n";
444
+ if ( $fullscreen == 1 ) { $result .= $tab . "\t<param name=\"allowFullScreen\" value=\"true\" />\n"; }
445
+ if ( ( $link != 1 ) && ( $link != '' ) ) { $result .= $tab . "\t<param name=\"allowNetworking\" value=\"internal\" />\n"; }
446
+ if ( ( $metadata != 0 ) && ( $title != '' ) ) { $result .= $tab . "\t<span property=\"media:title\" content=\"" . htmlentities( $title ) . "\" />\n"; }
447
+ $result .= $tab . "</object>\n";
448
+ }
449
+
450
+ // Add IFRAME embed code
451
+
452
+ if ( ( $iframe ) or ( ( $embedplus ) && ( $fallback == "v" ) ) ) {
453
+ if ( $embed_type == "p" ) { $playlist_para = "p/"; } else { $playlist_para = ''; }
454
+ $result .= $tab . '<iframe ' . $frameborder . 'style="border: 0;' . $style . '" class="' . $class . '" width="' . $width . '" height="' . $height . '" src="' . $embed_url . '&amp;wmode=' . $wmode . '"';
455
+ if ( $fullscreen == 1 ) { $result .= ' allowfullscreen="allowfullscreen"'; }
456
+ $result .= " ></iframe>\n";
457
+ }
458
+
459
+ // If using EmbedPlus, add the OBJECT closure tag
460
+
461
+ if ( $embedplus ) { $result .= "</object>\n<!--[if lte IE 6]> <style type=\"text/css\">.cantembedplus{display:none;}</style><![endif]-->\n"; }
462
+
463
+ // Now apply the template to the result
464
+
465
+ $end_tag = '';
466
+ if ( $dynamic == 1 ) {
467
+ $end_tag .= '</div>';
468
+ if ( $fixed == 1 ) { $end_tag .= '</div>'; }
469
+ }
470
+ $result = str_replace( '%video%', $result . $end_tag . "\n", $template );
471
+
472
+ // Now add a commented header and trailer
473
+
474
+ $result = "\n<!-- YouTube Embed v" . youtube_embed_version . " | http://www.artiss.co.uk/artiss-youtube-embed -->\n" . $result;
475
+ $result .= "<!-- End of YouTube Embed code -->\n";
476
+
477
+ // Cache the output
478
+
479
+ if ( $general[ 'embed_cache' ] != 0 ) { set_transient( $cache_key, $result, 3600 * $general[ 'embed_cache' ] ); }
480
+
481
+ return $result;
482
+ }
483
+
484
+ /**
485
+ * Validate a supplied profile name
486
+ *
487
+ * Returns a profile number for a supplied name
488
+ *
489
+ * @since 2.0
490
+ *
491
+ * @param string $name The name of the profile to find
492
+ * @param string $number The number of profiles available
493
+ * @return string The profile number (defaults to 0)
494
+ */
495
+
496
+ function aye_validate_profile( $name, $number ) {
497
+
498
+ $profile = 0;
499
+ $name = strtolower( $name );
500
+
501
+ if ( ( $name != '' ) && ( $name != 'default' ) ) {
502
+
503
+ // Loop around, fetching in profile names
504
+
505
+ $loop = 1;
506
+ while ( ( $loop <= $number ) && ( $profile == 0 ) ) {
507
+ if ( ( $name == $loop ) or ( $name == 'Profile ' . $loop ) ) {
508
+ $profile = $loop;
509
+ } else {
510
+ $profiles = get_option( 'youtube_embed_profile' . $loop );
511
+ $profname = strtolower( $profiles[ 'name' ] );
512
+ if ( $profname == $name ) { $profile = $loop; }
513
+ }
514
+ $loop ++;
515
+ }
516
+ }
517
+ return $profile;
518
+ }
519
+
520
+ /**
521
+ * Validate a supplied list name
522
+ *
523
+ * Returns a list for a supplied list number or name name - blank if not a valid list
524
+ *
525
+ * @since 2.0
526
+ *
527
+ * @param string $name The name of the list to find
528
+ * @param string $number The number of lists available
529
+ * @return string The list (defaults to blank)
530
+ */
531
+
532
+ function aye_validate_list( $name, $number ) {
533
+
534
+ $list = '';
535
+
536
+ // If the parameter contains commas, assume to be a comma seperated list and move into an array
537
+
538
+ if ( strpos( $name, ',' ) !== false ) {
539
+ $list = explode( ',', $name );
540
+ } else {
541
+
542
+ // No comma, so check if this is a named list
543
+
544
+ $name = strtolower( $name );
545
+
546
+ if ( $name != '' ) {
547
+
548
+ // Loop around, fetching in profile names
549
+
550
+ $loop = 1;
551
+ while ( ( $loop <= $number ) && ( $list == '' ) ) {
552
+ $listfiles = get_option( 'youtube_embed_list' . $loop );
553
+ if ( ( $name == strval( $loop ) ) or ( $name == 'List ' . $loop ) ) {
554
+ $list = $listfiles[ 'list' ];
555
+ } else {
556
+ $listname = strtolower( $listfiles[ 'name' ] );
557
+ if ( $listname == $name ) { $list = $listfiles[ 'list' ]; }
558
+ }
559
+ $loop ++;
560
+ }
561
+ }
562
+ if ( $list != '' ) { $list = explode( "\n", $list ); }
563
+ }
564
+ return $list;
565
+ }
566
+
567
+ /**
568
+ * Get URL parameters
569
+ *
570
+ * Extract a requested parameter from a URL
571
+ *
572
+ * @since 2.0
573
+ *
574
+ * @param string $id The ID of the video
575
+ * @param string $para The parameter to extract
576
+ * @param string $current The current parameter value
577
+ * @return string The parameter value
578
+ */
579
+
580
+ function aye_get_url_para( $id, $para, $current ) {
581
+
582
+ // Look for an ampersand
583
+
584
+ $start_pos = false;
585
+ if ( strpos( $id, '&amp;' . $para . '=' ) !== false ) { $start_pos = strpos( $id, '&amp;' . $para . '=' ) + 6 + strlen( $para ); }
586
+
587
+ // If a parameter was found, look for the end of it
588
+
589
+ if ( $start_pos !== false ) {
590
+ $end_pos = strpos( $id, '&amp;', $start_pos + 1 );
591
+ if ( !$end_pos ) { $end_pos = strlen( $id ); }
592
+
593
+ // Extract the parameter and return it
594
+
595
+ $current = substr( $id, $start_pos, $end_pos - $start_pos );
596
+ }
597
+
598
+ return $current;
599
+ }
600
+
601
+ /**
602
+ * Decode a string
603
+ *
604
+ * Decode an HTML encoded string. I'm not using htmlspecialchars_decode to maintain
605
+ * PHP 4 compatibility.
606
+ *
607
+ * @since 2.0.3
608
+ *
609
+ * @param string $encoded The encoded string
610
+ * @return string The decoded string
611
+ */
612
+
613
+ function aye_decode( $encoded ) {
614
+
615
+ $find = array( '&amp;', '&quot;', '&#039;', '&lt;', '&gt;' );
616
+ $replace = array( '&', '"', "'", '<', '>' );
617
+
618
+ $decoded = str_replace( $find, $replace, $encoded );
619
+
620
+ return $decoded;
621
+ }
 
 
 
 
 
 
 
622
  ?>
includes/aye-generate-shorturl-code.php CHANGED
@@ -19,7 +19,7 @@ function aye_generate_shorturl_code( $id ) {
19
 
20
  // Check that an ID has been specified
21
  if ( $id == '' ) {
22
- return aye_error( __( 'No video ID has been supplied', 'youtube-embed' ) );
23
  } else {
24
 
25
  // Extract the ID if a full URL has been specified
@@ -31,7 +31,7 @@ function aye_generate_shorturl_code( $id ) {
31
  if ( strlen( $embed_type ) > 1 ) {
32
  return aye_error( $embed_type );
33
  } else {
34
- return aye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) );
35
  }
36
  }
37
 
19
 
20
  // Check that an ID has been specified
21
  if ( $id == '' ) {
22
+ return aye_error( __( 'No video ID has been supplied' ) );
23
  } else {
24
 
25
  // Extract the ID if a full URL has been specified
31
  if ( strlen( $embed_type ) > 1 ) {
32
  return aye_error( $embed_type );
33
  } else {
34
+ return aye_error( sprintf( __( 'The YouTube ID of %s is invalid.' ), $id ) );
35
  }
36
  }
37
 
includes/aye-generate-thumbnail-code.php CHANGED
@@ -19,12 +19,10 @@
19
  * @param string $width Width
20
  * @param string $height Height
21
  * @param string $alt ALT text
22
- * @param string $version Thumbnail version
23
- * @param string $nolink True or False, whether no link should be added
24
  * @return string $youtube_code Code
25
  */
26
 
27
- function aye_generate_thumbnail_code( $id, $style, $class, $rel, $target, $width, $height, $alt, $version, $nolink = false ) {
28
 
29
  // Extract the ID if a full URL has been specified
30
  $id = aye_extract_id( $id );
@@ -36,7 +34,7 @@ function aye_generate_thumbnail_code( $id, $style, $class, $rel, $target, $width
36
  if ( strlen( $embed_type ) > 1 ) {
37
  return aye_error( $embed_type );
38
  } else {
39
- return aye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) );
40
  }
41
  }
42
 
@@ -48,20 +46,16 @@ function aye_generate_thumbnail_code( $id, $style, $class, $rel, $target, $width
48
  if ( $version == 'end' ) { $version = 3; }
49
 
50
  // Now create the required code
51
- if ( $alt == '' ) { $alt = sprintf( __( 'YouTube Video %s' ), $id ); }
52
- if ( !$nolink ) {
53
- $youtube_code = '<a href="http://www.youtube.com/watch?v=' . $id . '"';
54
- if ( $style != '' ) { $youtube_code .= ' style="' . $style . '"'; }
55
- if ( $class != '' ) { $youtube_code .= ' class="' . $class . '"'; }
56
- if ( $rel != '' ) { $youtube_code .= ' rel="' . $rel . '"'; }
57
- if ( $target != '' ) { $youtube_code .= ' target="' . $target . '"'; }
58
- $youtube_code .= '>';
59
- }
60
- $youtube_code .= '<img src="http://img.youtube.com/vi/' . $id . '/' . $version . '.jpg"';
61
  if ( $width != '' ) { $youtube_code .= ' width="' . $width . 'px"'; }
62
  if ( $height != '' ) { $youtube_code .= ' height="' . $height . 'px"'; }
63
- $youtube_code .= ' alt="' . $alt . '"/>';
64
- if ( !$nolink ) { $youtube_code .= '</a>'; }
65
 
66
  return $youtube_code;
67
  }
19
  * @param string $width Width
20
  * @param string $height Height
21
  * @param string $alt ALT text
 
 
22
  * @return string $youtube_code Code
23
  */
24
 
25
+ function aye_generate_thumbnail_code( $id, $style, $class, $rel, $target, $width, $height, $alt, $version ) {
26
 
27
  // Extract the ID if a full URL has been specified
28
  $id = aye_extract_id( $id );
34
  if ( strlen( $embed_type ) > 1 ) {
35
  return aye_error( $embed_type );
36
  } else {
37
+ return aye_error( sprintf( __( 'The YouTube ID of %s is invalid.' ), $id ) );
38
  }
39
  }
40
 
46
  if ( $version == 'end' ) { $version = 3; }
47
 
48
  // Now create the required code
49
+ if ( $alt == '' ) { $alt = 'YouTube Video ' . $id; }
50
+ $youtube_code = '<a href="http://www.youtube.com/watch?v=' . $id . '"';
51
+ if ( $style != '' ) { $youtube_code .= ' style="' . $style . '"'; }
52
+ if ( $class != '' ) { $youtube_code .= ' class="' . $class . '"'; }
53
+ if ( $rel != '' ) { $youtube_code .= ' rel="' . $rel . '"'; }
54
+ if ( $target != '' ) { $youtube_code .= ' target="' . $target . '"'; }
55
+ $youtube_code .= '><img src="http://img.youtube.com/vi/' . $id . '/' . $version . '.jpg"';
 
 
 
56
  if ( $width != '' ) { $youtube_code .= ' width="' . $width . 'px"'; }
57
  if ( $height != '' ) { $youtube_code .= ' height="' . $height . 'px"'; }
58
+ $youtube_code .= ' alt="' . $alt . '"/></a>';
 
59
 
60
  return $youtube_code;
61
  }
includes/aye-generate-transcript-code.php CHANGED
@@ -35,7 +35,7 @@ function aye_generate_transcript( $id ) {
35
  if ( strlen( $embed_type ) > 1 ) {
36
  return aye_error( $embed_type );
37
  } else {
38
- return aye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) );
39
  }
40
  }
41
 
@@ -56,7 +56,7 @@ function aye_generate_transcript( $id ) {
56
 
57
  // If transcript file exists, strip and output
58
  if ( $return[ 'rc' ] == 0 ) {
59
- $output = "<!-- YouTube Embed v" . youtube_embed_version . " | http://www.artiss.co.uk/youtube-embed -->\n";
60
  $pos = 0;
61
  $eof = false;
62
 
35
  if ( strlen( $embed_type ) > 1 ) {
36
  return aye_error( $embed_type );
37
  } else {
38
+ return aye_error( sprintf( __( 'The YouTube ID of %s is invalid.' ), $id ) );
39
  }
40
  }
41
 
56
 
57
  // If transcript file exists, strip and output
58
  if ( $return[ 'rc' ] == 0 ) {
59
+ $output = "<!-- YouTube Embed v" . youtube_embed_version . " | http://www.artiss.co.uk/artiss-youtube-embed -->\n";
60
  $pos = 0;
61
  $eof = false;
62
 
includes/aye-generate-widgets.php CHANGED
@@ -9,138 +9,138 @@
9
 
10
  class YouTubeEmbedWidget extends WP_Widget {
11
 
12
- /**
13
- * Widget Constructor
14
- *
15
- * Call WP_Widget class to define widget
16
- *
17
- * @since 2.0
18
- *
19
- * @uses WP_Widget Standard WP_Widget class
20
- */
21
-
22
- function YouTubeEmbedWidget() {
23
- parent::WP_Widget( 'youtube_embed_widget',
24
- __( 'YouTube Embed', 'youtube-embed' ),
25
- array( 'description' => __( 'Embed YouTube Widget.', 'youtube-embed' ), 'class' => 'my-widget-class' )
26
- );
27
- }
28
-
29
- /**
30
- * Display widget
31
- *
32
- * Display the YouTube widget
33
- *
34
- * @since 2.0
35
- *
36
- * @uses generate_youtube_code Generate the required YouTube code
37
- *
38
- * @param string $args Arguments
39
- * @param string $instance Instance
40
- */
41
-
42
- function widget( $args, $instance ) {
43
- extract( $args, EXTR_SKIP );
44
-
45
- // Output the header
46
- echo $before_widget;
47
-
48
- // Extract title for heading
49
- $title = $instance[ 'titles' ];
50
-
51
- // Output title, if one exists
52
- if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }
53
-
54
- // Set the correct
55
- if ( $instance[ 'id_type' ] == 's' ) { $search = 1; } else { $search = ''; }
56
- if ( $instance[ 'id_type' ] == 'u' ) { $user = 1; } else { $user = ''; }
57
-
58
- // Generate the video and output it
59
- echo aye_generate_youtube_code ( $instance[ 'id' ],
60
- $instance[ 'type' ],
61
- $instance[ 'width' ],
62
- $instance[ 'height' ],
63
- '',
64
- '',
65
- $instance[ 'autoplay' ],
66
- $instance[ 'loop' ],
67
- $instance[ 'start' ],
68
- '',
69
- '',
70
- '',
71
- $instance[ 'style' ],
72
- '',
73
- '',
74
- $instance[ 'stop' ],
75
- '',
76
- '',
77
- '',
78
- '',
79
- '',
80
- $instance[ 'profile' ],
81
- $instance[ 'list' ],
82
- '',
83
- $instance[ 'template' ],
84
- '',
85
- '',
86
- '',
87
- '',
88
- $instance[ 'dynamic' ],
89
- $search,
90
- $user );
91
-
92
- // Output the trailer
93
- echo $after_widget;
94
- }
95
-
96
- /**
97
- * Widget update/save function
98
- *
99
- * Update and save widget
100
- *
101
- * @since 2.0
102
- *
103
- * @param string $new_instance New instance
104
- * @param string $old_instance Old instance
105
- * @return string Instance
106
- */
107
-
108
- function update( $new_instance, $old_instance ) {
109
-
110
- $instance = $old_instance;
111
- $instance[ 'titles' ] = strip_tags( $new_instance[ 'titles' ] );
112
- $instance[ 'id' ] = $new_instance[ 'id' ];
113
- $instance[ 'profile' ] = $new_instance[ 'profile' ];
114
- $instance[ 'type' ] = $new_instance[ 'type' ];
115
- $instance[ 'template' ] = $new_instance[ 'template' ];
116
- $instance[ 'style' ] = $new_instance[ 'style' ];
117
- $instance[ 'start' ] = $new_instance[ 'start' ];
118
- $instance[ 'autoplay' ] = $new_instance[ 'autoplay' ];
119
- $instance[ 'width' ] = $new_instance[ 'width' ];
120
- $instance[ 'height' ] = $new_instance[ 'height' ];
121
- $instance[ 'dynamic' ] = $new_instance[ 'dynamic' ];
122
- $instance[ 'list' ] = $new_instance[ 'list' ];
123
- $instance[ 'loop' ] = $new_instance[ 'loop' ];
124
- $instance[ 'stop' ] = $new_instance[ 'stop' ];
125
- $instance[ 'id_type' ] = $new_instance[ 'id_type' ];
126
-
127
- return $instance;
128
-
129
- }
130
-
131
- /**
132
- * Widget Admin control form
133
- *
134
- * Define admin file
135
- *
136
- * @since 2.0
137
- *
138
- * @param string $instance Instance
139
- */
140
-
141
- function form( $instance ) {
142
- include ( WP_PLUGIN_DIR . '/youtube-embed/includes/aye-options-widgets.php' );
143
- }
144
  }
145
 
146
  /**
@@ -152,7 +152,7 @@ class YouTubeEmbedWidget extends WP_Widget {
152
  */
153
 
154
  function youtube_embed_register_widgets() {
155
- register_widget( 'YouTubeEmbedWidget' );
156
  }
157
  add_action( 'widgets_init', 'youtube_embed_register_widgets' );
158
  ?>
9
 
10
  class YouTubeEmbedWidget extends WP_Widget {
11
 
12
+ /**
13
+ * Widget Constructor
14
+ *
15
+ * Call WP_Widget class to define widget
16
+ *
17
+ * @since 2.0
18
+ *
19
+ * @uses WP_Widget Standard WP_Widget class
20
+ */
21
+
22
+ function YouTubeEmbedWidget() {
23
+ parent::WP_Widget( 'youtube_embed_widget',
24
+ 'YouTube Embed',
25
+ array( 'description' => __( 'Embed YouTube Widget.' ), 'class' => 'my-widget-class' )
26
+ );
27
+ }
28
+
29
+ /**
30
+ * Display widget
31
+ *
32
+ * Display the YouTube widget
33
+ *
34
+ * @since 2.0
35
+ *
36
+ * @uses generate_youtube_code Generate the required YouTube code
37
+ *
38
+ * @param string $args Arguments
39
+ * @param string $instance Instance
40
+ */
41
+
42
+ function widget( $args, $instance ) {
43
+ extract( $args, EXTR_SKIP );
44
+
45
+ // Output the header
46
+ echo $before_widget;
47
+
48
+ // Extract title for heading
49
+ $title = $instance[ 'titles' ];
50
+
51
+ // Output title, if one exists
52
+ if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }
53
+
54
+ // Generate the video and output it
55
+ echo aye_generate_youtube_code ( $instance[ 'id' ],
56
+ $instance[ 'type' ],
57
+ $instance[ 'width' ],
58
+ $instance[ 'height' ],
59
+ '',
60
+ '',
61
+ $instance[ 'autoplay' ],
62
+ $instance[ 'loop' ],
63
+ $instance[ 'start' ],
64
+ '',
65
+ '',
66
+ '',
67
+ $instance[ 'style' ],
68
+ '',
69
+ '',
70
+ $instance[ 'stop' ],
71
+ '',
72
+ '',
73
+ '',
74
+ '',
75
+ '',
76
+ $instance[ 'profile' ],
77
+ $instance[ 'list' ],
78
+ '',
79
+ $instance[ 'template' ],
80
+ '',
81
+ '',
82
+ '',
83
+ '',
84
+ '',
85
+ $instance[ 'video_title' ],
86
+ $instance[ 'dynamic' ],
87
+ $instance[ 'search' ],
88
+ $instance[ 'user' ] );
89
+
90
+ // Output the trailer
91
+ echo $after_widget;
92
+ }
93
+
94
+ /**
95
+ * Widget update/save function
96
+ *
97
+ * Update and save widget
98
+ *
99
+ * @since 2.0
100
+ *
101
+ * @param string $new_instance New instance
102
+ * @param string $old_instance Old instance
103
+ * @return string Instance
104
+ */
105
+
106
+ function update( $new_instance, $old_instance ) {
107
+
108
+ $instance = $old_instance;
109
+ $instance[ 'titles' ] = strip_tags( $new_instance[ 'titles' ] );
110
+ $instance[ 'video_title' ] = strip_tags( $new_instance[ 'video_title' ] );#
111
+ $instance[ 'id' ] = $new_instance[ 'id' ];
112
+ $instance[ 'profile' ] = $new_instance[ 'profile' ];
113
+ $instance[ 'type' ] = $new_instance[ 'type' ];
114
+ $instance[ 'template' ] = $new_instance[ 'template' ];
115
+ $instance[ 'style' ] = $new_instance[ 'style' ];
116
+ $instance[ 'start' ] = $new_instance[ 'start' ];
117
+ $instance[ 'autoplay' ] = $new_instance[ 'autoplay' ];
118
+ $instance[ 'width' ] = $new_instance[ 'width' ];
119
+ $instance[ 'height' ] = $new_instance[ 'height' ];
120
+ $instance[ 'dynamic' ] = $new_instance[ 'dynamic' ];
121
+ $instance[ 'list' ] = $new_instance[ 'list' ];
122
+ $instance[ 'loop' ] = $new_instance[ 'loop' ];
123
+ $instance[ 'stop' ] = $new_instance[ 'stop' ];
124
+
125
+ if ( $new_instance[ 'id_type' ] == 's' ) { $instance[ 'search' ] = '1'; } else { $instance[ 'search' ] = '1'; }
126
+ if ( $new_instance[ 'id_type' ] == 'u' ) { $instance[ 'user' ] = '1'; } else { $instance[ 'user' ] = '1'; }
127
+
128
+ return $instance;
129
+ }
130
+
131
+ /**
132
+ * Widget Admin control form
133
+ *
134
+ * Define admin file
135
+ *
136
+ * @since 2.0
137
+ *
138
+ * @param string $instance Instance
139
+ */
140
+
141
+ function form( $instance ) {
142
+ include ( WP_PLUGIN_DIR . '/youtube-embed/includes/aye-options-widgets.php' );
143
+ }
144
  }
145
 
146
  /**
152
  */
153
 
154
  function youtube_embed_register_widgets() {
155
+ register_widget( 'YouTubeEmbedWidget' );
156
  }
157
  add_action( 'widgets_init', 'youtube_embed_register_widgets' );
158
  ?>
includes/aye-options-general.php CHANGED
@@ -11,80 +11,68 @@
11
  ?>
12
  <div class="wrap" style="width: 1010px;">
13
  <div class="icon32"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
14
- <h2><?php _e( 'Artiss YouTube Embed Options', 'youtube-embed' ); ?></h2>
15
 
16
  <?php
17
-
18
  // If options have been updated on screen, update the database
19
 
20
  if ( ( !empty( $_POST ) ) && ( check_admin_referer( 'youtube-embed-general', 'youtube_embed_general_nonce' ) ) ) {
21
 
22
- $options[ 'donated' ] = $_POST[ 'youtube_embed_donated' ];
23
- $options[ 'editor_button' ] = $_POST[ 'youtube_embed_editor_button' ];
24
- $options[ 'admin_bar' ] = $_POST[ 'youtube_embed_admin_bar' ];
25
- $options[ 'profile_no' ] = $_POST[ 'youtube_embed_profile_no' ];
26
 
27
  // If the number of profiles is less than zero, put it to 0
28
 
29
- if ( $options[ 'profile_no' ] < 0 ) { $options[ 'profile_no' ] = 0; }
30
 
31
- $options[ 'list_no' ] = $_POST[ 'youtube_embed_list_no' ];
32
 
33
  // If the number of lists is less than 1, put it to 1
34
 
35
  if ( $options[ 'list_no' ] < 1 ) { $options[ 'list_no' ] = 1; }
36
 
37
- $options[ 'embed_cache' ] = $_POST[ 'youtube_embed_embed_cache' ];
38
- $options[ 'info_cache' ] = $_POST[ 'youtube_embed_info_cache' ];
39
- $options[ 'transcript_cache' ] = $_POST[ 'youtube_embed_transcript_cache' ];
40
- $options[ 'fetch_title' ] = $_POST[ 'youtube_embed_fetch_title' ];
41
- $options[ 'alt_profile' ] = $_POST[ 'youtube_embed_alt_profile' ];
42
- $options[ 'alt_profile2' ] = $_POST[ 'youtube_embed_alt_profile2' ];
43
- $options[ 'bracket' ] = $_POST[ 'youtube_embed_bracket' ];
44
- $options[ 'alt' ] = $_POST[ 'youtube_embed_alt' ];
45
- $options[ 'other_profile' ] = $_POST[ 'youtube_embed_other_profile' ];
46
- $options[ 'comments' ] = $_POST[ 'youtube_embed_comments' ];
47
- $options[ 'comments_profile' ] = $_POST[ 'youtube_embed_comments_profile' ];
48
- $options[ 'metadata' ] = $_POST[ 'youtube_embed_metadata' ];
49
- $options[ 'feed' ] = $_POST[ 'youtube_embed_feed' ];
50
- $options[ 'api' ] = $_POST[ 'youtube_embed_api' ];
51
- $options[ 'error_message' ] = str_replace( '\"', '"', $_POST[ 'youtube_embed_error_message' ] );
52
- $options[ 'thumbnail' ] = $_POST[ 'youtube_embed_thumbnail' ];
53
- $options[ 'privacy' ] = $_POST[ 'youtube_embed_privacy' ];
54
- $options[ 'frameborder' ] = $_POST[ 'youtube_embed_frameborder' ];
55
- $options[ 'widgets' ] = $_POST[ 'youtube_embed_widgets' ];
56
- $options[ 'profile_access' ] = $_POST[ 'youtube_embed_profile_access' ];
57
- $options[ 'list_access' ] = $_POST[ 'youtube_embed_list_access' ];
58
 
59
  // Update the options
60
 
61
  update_option( 'youtube_embed_general', $options );
62
- $update_message = __( 'Settings Saved.', 'youtube-embed' );
63
 
64
  // Update the alternative shortcodes
65
 
66
- $shortcode[ 1 ] = $_POST[ 'youtube_embed_shortcode' ];
67
- $shortcode[ 1 ] = trim( $shortcode[ 1 ], '[]' );
68
 
69
- $shortcode[ 2 ] = $_POST[ 'youtube_embed_shortcode2' ];
70
- $shortcode[ 2 ] = trim( $shortcode[ 2 ], '[]' );
71
 
72
  update_option( 'youtube_embed_shortcode', $shortcode );
73
 
74
- // Update the editor button shortcode, including the cookie
75
-
76
- update_option( 'youtube_embed_editor_sc', $_POST[ 'youtube_embed_editor_sc' ] );
77
-
78
- $expiry = 2147483647; // January 2038 (maximum value to avoid the integer overflow of the 2038 bug)
79
- setcookie( 'aye_mce_shortcode', $_POST[ 'youtube_embed_editor_sc' ], $expiry, aye_get_cookie_path() );
80
 
81
- // If the option to clear the cache has been ticked run an SQL to clear them down
82
-
83
- if ( !empty( $_POST[ 'youtube_embed_clear_cache' ] ) ) {
84
- global $wpdb;
85
- $wpdb -> query( "DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_%ye_video_%' OR option_name LIKE '_transient_%ye_type_%' OR option_name LIKE '_transient_%ye_title_%'" );
86
- $update_message .= ' ' . __( 'Cache cleared.', 'youtube-embed' );
87
- }
88
 
89
  echo '<div class="updated fade"><p><strong>' . $update_message . "</strong></p></div>\n";
90
  }
@@ -94,257 +82,202 @@ if ( ( !empty( $_POST ) ) && ( check_admin_referer( 'youtube-embed-general', 'yo
94
  $options = aye_set_general_defaults();
95
  $shortcode = aye_set_shortcode_option();
96
  $url = aye_set_url_option();
97
- $editor_sc = aye_set_editor_sc();
98
-
99
- // Display ads
100
-
101
- if ( $options[ 'donated'] != 1 ) { artiss_plugin_ads( 'youtube-embed', 990 ); }
102
  ?>
103
 
104
- <div class="updated fade"><p>Have you voted for which features of YouTube Embed you'd like to retain in version 3? <a href="http://www.artiss.co.uk/youtube-embed/youtube-embed-features-vote" target="_new">Click here</a> to vote!</p></div>
105
-
106
- <p><?php _e( 'These are the general settings for Artiss YouTube Embed. Please select <a href="admin.php?page=aye-profile-options">Profiles</a> for default embedding settings.', 'youtube-embed' ); ?></p>
107
 
108
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ).'/wp-admin/admin.php?page=aye-general-options' ?>">
109
 
110
- <table class="form-table">
111
-
112
- <tr>
113
- <th scope="row"><?php _e( 'Remove Adverts', 'youtube-embed' ); ?></th>
114
- <td><input type="checkbox" name="youtube_embed_donated" value="1"<?php if ( $options[ 'donated' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( "If you've <a href=\"http://www.artiss.co.uk/donate\">donated</a>, tick here to remove the adverts from these administration screens", 'youtube-embed' ); ?></span></td>
115
- </tr>
116
-
117
- </table></br>
118
-
119
- <span class="yt_heading"><?php _e( 'Embedding', 'youtube-embed' ); ?></span>
120
 
121
  <table class="form-table">
122
  <tr>
123
- <th scope="row"><?php _e( 'Add Metadata', 'youtube-embed' ); ?></th>
124
- <td><input type="checkbox" name="youtube_embed_metadata" value="1"<?php if ( $options[ 'metadata' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Allow rich metadata to be added to code. <a href="http://www.artiss.co.uk/youtube-embed/further-help#ye-metadata">Learn more</a>', 'youtube-embed' ); ?></span></td>
125
  </tr>
126
 
127
  <tr>
128
- <th scope="row"><?php _e( 'Comment Embedding', 'youtube-embed' ); ?></th>
129
- <td><input type="checkbox" name="youtube_embed_comments" value="1"<?php if ( $options[ 'comments' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Allow YouTube URLs in comments - will display as embedded videos. <a href="http://www.artiss.co.uk/youtube-embed/further-help#ye-comments">Learn more</a>', 'youtube-embed' ); ?></span></td>
130
  </tr>
131
 
132
  <tr>
133
- <th scope="row">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Profile to use', 'youtube-embed' ); ?></th>
134
  <td><select name="youtube_embed_comments_profile">
135
  <?php aye_generate_profile_list( $options[ 'comments_profile' ], $options[ 'profile_no' ] ) ?>
136
  </select></td>
137
  </tr>
138
 
139
  <tr>
140
- <th scope="row"><?php _e( 'Feed', 'youtube-embed' ); ?></th>
141
  <td><select name="youtube_embed_feed">
142
- <option value="t"<?php if ( $options[ 'feed' ] == "t" ) { echo " selected='selected'"; } ?>><?php _e ( 'Text link', 'youtube-embed' ); ?></option>
143
- <option value="v"<?php if ( $options[ 'feed' ] == "v" ) { echo " selected='selected'"; } ?>><?php _e ( 'Thumbnail', 'youtube-embed' ); ?></option>
144
- <option value="b"<?php if ( $options[ 'feed' ] == "b" ) { echo " selected='selected'"; } ?>><?php _e ( 'Thumbnail &amp; Text Link', 'youtube-embed' ); ?></option>
145
- </select>&nbsp;<span class="description"><?php _e( 'Videos cannot be embedded in feeds. Select how you wish them to be shown instead', 'youtube-embed' ); ?></span></td>
146
  </tr>
147
 
148
  <tr>
149
- <th scope="row">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Thumbnail to use', 'youtube-embed' ); ?></th>
150
  <td><select name="youtube_embed_thumbnail">
151
- <option value="default"<?php if ( $options[ 'thumbnail' ] == "default" ) { echo " selected='selected'"; } ?>><?php _e ( 'Default', 'youtube-embed' ); ?></option>
152
- <option value="hqdefault"<?php if ( $options[ 'thumbnail' ] == "hqdefault" ) { echo " selected='selected'"; } ?>><?php _e ( 'Default (HQ)', 'youtube-embed' ); ?></option>
153
- <option value="1"<?php if ( $options[ 'thumbnail' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e ( 'Start', 'youtube-embed' ); ?></option>
154
- <option value="2"<?php if ( $options[ 'thumbnail' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e ( 'Middle', 'youtube-embed' ); ?></option>
155
- <option value="3"<?php if ( $options[ 'thumbnail' ] == "3" ) { echo " selected='selected'"; } ?>><?php _e ( 'End', 'youtube-embed' ); ?></option>
156
- </select>&nbsp;<span class="description"><?php _e( 'Which thumbnail to use', 'youtube-embed' ); ?></span></td>
157
- </tr>
158
-
159
- <tr>
160
- <th scope="row"><?php _e( 'Allow shortcodes in widgets', 'youtube-embed' ); ?></th>
161
- <td><input type="checkbox" name="youtube_embed_widgets" value="1"<?php if ( $options[ 'widgets' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Allow shortcodes to be used in widgets - this will apply to <strong>all</strong> widgets', 'youtube-embed' ); ?></span></td>
162
  </tr>
163
  </table>
164
 
165
- <br/><span class="yt_heading"><?php _e( 'Alternative Shortcodes', 'youtube-embed' ); ?></span><br/><br/><?php _e( '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>', 'youtube-embed' ); ?>
166
 
167
  <table class="form-table">
168
  <tr>
169
- <th scope="row"><?php _e( 'Alternative Shortcode 1', 'youtube-embed' ); ?></th>
170
  <td><input type="text" size="30" name="youtube_embed_shortcode" value="<?php echo $shortcode[ 1 ]; ?>"/></td>
171
  </tr>
172
 
173
  <tr>
174
- <th scope="row">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Profile to use', 'youtube-embed' ); ?></th>
175
  <td><select name="youtube_embed_alt_profile">
176
  <?php aye_generate_profile_list( $options[ 'alt_profile' ], $options[ 'profile_no' ] ) ?>
177
  </select></td>
178
  </tr>
179
 
180
  <tr>
181
- <th scope="row"><?php _e( 'Alternative Shortcode 2', 'youtube-embed' ); ?></th>
182
  <td><input type="text" size="30" name="youtube_embed_shortcode2" value="<?php echo $shortcode[ 2 ]; ?>"/></td>
183
  </tr>
184
 
185
  <tr>
186
- <th scope="row">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Profile to use', 'youtube-embed' ); ?></th>
187
  <td><select name="youtube_embed_alt_profile2">
188
  <?php aye_generate_profile_list( $options[ 'alt_profile2' ], $options[ 'profile_no' ] ) ?>
189
  </select></td>
190
  </tr>
191
  </table>
192
 
193
- <br/><span class="yt_heading"><?php _e( 'Migration', 'youtube-embed' ); ?></span><br/><br/><?php _e( 'Switch on compatibility with other embedding plugins. For more details on migrating from another plugin, please <a href="http://www.artiss.co.uk/youtube-embed/compatibility">click here</a>.', 'youtube-embed' ); ?>
194
 
195
  <table class="form-table">
196
  <tr>
197
- <th scope="row"><?php _e( 'Bracket Embedding', 'youtube-embed' ); ?></th>
198
- <td><input type="checkbox" name="youtube_embed_bracket" value="1"<?php if ( $options[ 'bracket' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Allow embedding using URLs within brackets. Activating impacts performance', 'youtube-embed' ); ?></span></td>
199
  </tr>
200
 
201
  <tr>
202
- <th scope="row"><?php _e( 'Alternative Embedding', 'youtube-embed' ); ?></th>
203
- <td><input type="checkbox" name="youtube_embed_alt" value="1"<?php if ( $options[ 'alt' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Allow all other types of embedding. Activating impacts performance', 'youtube-embed' ); ?></span></td>
204
  </tr>
205
 
206
  <tr>
207
- <th scope="row">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Profile to use', 'youtube-embed' ); ?></th>
208
  <td><select name="youtube_embed_other_profile">
209
  <?php aye_generate_profile_list( $options[ 'other_profile' ], $options[ 'profile_no' ] ) ?>
210
- </select>&nbsp;<span class="description"><?php _e( 'For above 2 options', 'youtube-embed' ); ?></span></td>
211
  </tr>
212
  </table>
213
 
214
- <br/><span class="yt_heading"><?php _e( 'Admin Options', 'youtube-embed' ); ?></span>
215
 
216
  <table class="form-table">
217
  <tr>
218
- <th scope="row"><?php _e( 'Show Editor Button', 'youtube-embed' ); ?></th>
219
- <td><input type="checkbox" name="youtube_embed_editor_button" value="1"<?php if ( $options[ 'editor_button' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Show the YouTube button on the post editor', 'youtube-embed' ); ?></span></td>
220
  </tr>
221
 
222
  <tr>
223
- <th scope="row"><?php _e( 'Editor Button Shortcode', 'youtube-embed' ); ?></th>
224
- <td><input type="text" size="20" name="youtube_embed_editor_sc" value="<?php echo $editor_sc; ?>"/>&nbsp;<span class="description"><?php _e( 'Shortcode for editor button to use.', 'youtube-embed' ); ?></span></td>
225
- </tr>
226
-
227
- <tr>
228
- <th scope="row"><?php _e( 'Add to Admin Bar', 'youtube-embed' ); ?></th>
229
- <td><input type="checkbox" name="youtube_embed_admin_bar" value="1"<?php if ( $options[ 'admin_bar' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Add link to options screen to Admin Bar', 'youtube-embed' ); ?></span></td>
230
- </tr>
231
-
232
- <tr>
233
- <th scope="row"><?php _e( 'Profiles Screen Access', 'youtube-embed' ); ?></th>
234
- <td><select name="youtube_embed_profile_access">
235
- <option value="delete_plugins"<?php if ( $options[ 'profile_access' ] == "delete_plugins" ) { echo " selected='selected'"; } ?>><?php _e ( 'Administrator', 'youtube-embed' ); ?></option>
236
- <option value="edit_pages"<?php if ( $options[ 'profile_access' ] == "edit_pages" ) { echo " selected='selected'"; } ?>><?php _e ( 'Editor', 'youtube-embed' ); ?></option>
237
- <option value="publish_posts"<?php if ( $options[ 'profile_access' ] == "publish_posts" ) { echo " selected='selected'"; } ?>><?php _e ( 'Author', 'youtube-embed' ); ?></option>
238
- <option value="edit_posts"<?php if ( $options[ 'profile_access' ] == "edit_posts" ) { echo " selected='selected'"; } ?>><?php _e ( 'Contributor', 'youtube-embed' ); ?></option>
239
- </select>&nbsp;<span class="description"><?php _e( 'Specify the user access required for the profiles screen', 'youtube-embed' ); ?></span></td>
240
- </tr>
241
-
242
- <tr>
243
- <th scope="row"><?php _e( 'Lists Screen Access', 'youtube-embed' ); ?></th>
244
- <td><select name="youtube_embed_list_access">
245
- <option value="delete_plugins"<?php if ( $options[ 'list_access' ] == "delete_plugins" ) { echo " selected='selected'"; } ?>><?php _e ( 'Administrator', 'youtube-embed' ); ?></option>
246
- <option value="edit_pages"<?php if ( $options[ 'list_access' ] == "edit_pages" ) { echo " selected='selected'"; } ?>><?php _e ( 'Editor', 'youtube-embed' ); ?></option>
247
- <option value="publish_posts"<?php if ( $options[ 'list_access' ] == "publish_posts" ) { echo " selected='selected'"; } ?>><?php _e ( 'Author', 'youtube-embed' ); ?></option>
248
- <option value="edit_posts"<?php if ( $options[ 'list_access' ] == "edit_posts" ) { echo " selected='selected'"; } ?>><?php _e ( 'Contributor', 'youtube-embed' ); ?></option>
249
- </select>&nbsp;<span class="description"><?php _e( 'Specify the user access required for the lists screen', 'youtube-embed' ); ?></span></td>
250
  </tr>
251
  </table>
252
 
253
- <br/><span class="yt_heading"><?php _e( 'Profile &amp; List Sizes', 'youtube-embed' ); ?></span>
254
 
255
  <table class="form-table">
256
  <tr>
257
- <th scope="row"><?php _e( 'Number of Profiles', 'youtube-embed' ); ?></th>
258
- <td><input type="text" size="2" maxlength="2" name="youtube_embed_profile_no" value="<?php echo $options[ 'profile_no' ]; ?>"/>&nbsp;<span class="description"><?php _e( 'Maximum number of profiles', 'youtube-embed' ); ?></span></td>
259
  </tr>
260
 
261
  <tr>
262
- <th scope="row"><?php _e( 'Number of Lists', 'youtube-embed' ); ?></th>
263
- <td><input type="text" size="2" maxlength="2" name="youtube_embed_list_no" value="<?php echo $options[ 'list_no' ]; ?>"/>&nbsp;<span class="description"><?php _e( 'Maximum number of lists', 'youtube-embed' ); ?></span></td>
264
  </tr>
265
  </table>
266
 
267
- <br/><span class="yt_heading"><?php _e( 'Performance', 'youtube-embed' ); ?></span>
268
 
269
  <table class="form-table">
270
  <tr>
271
- <th scope="row"><?php _e( 'Embed Cache', 'youtube-embed' ); ?></th>
272
- <td><input type="text" size="3" maxlength="3" name="youtube_embed_embed_cache" value="<?php echo $options[ 'embed_cache' ]; ?>"/>&nbsp;<span class="description"><?php _e( 'How many hours to retain embed output. 0 to switch off', 'youtube-embed' ); ?></span></td>
273
  </tr>
274
 
275
  <tr>
276
- <th scope="row"><?php _e( 'Video Information Cache', 'youtube-embed' ); ?></th>
277
- <td><input type="text" size="3" maxlength="3" name="youtube_embed_info_cache" value="<?php echo $options[ 'info_cache' ]; ?>"/>&nbsp;<span class="description"><?php _e( 'How many hours to retain video information, including it\'s validity. 0 to switch off', 'youtube-embed' ); ?></span></td>
278
  </tr>
279
 
280
  <tr>
281
- <th scope="row"><?php _e( 'Transcript Cache', 'youtube-embed' ); ?></th>
282
- <td><input type="text" size="3" maxlength="3" name="youtube_embed_transcript_cache" value="<?php echo $options[ 'transcript_cache' ]; ?>"/>&nbsp;<span class="description"><?php _e( 'How many hours to store transcripts for in cache. 0 to switch off', 'youtube-embed' ); ?></span></td>
283
- </tr></table>
284
 
285
  <?php
286
  global $wpdb;
287
- $video_cache = $wpdb -> get_var( "SELECT COUNT(*) FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_%ye_video_%'" );
288
- $type_cache = $wpdb -> get_var( "SELECT COUNT(*) FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_%ye_type_%'" );
289
- $title_cache = $wpdb -> get_var( "SELECT COUNT(*) FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_%ye_title_%'" );
290
-
291
- echo '<p>' . __( 'You currently have cache for', 'youtube_embed' ) . ' ' . number_format( $video_cache ) . ' video' . ( $video_cache <> 1 ? 's' : '' ) . ', ' . number_format( $type_cache ) . ' video type' . ( $type_cache <> 1 ? 's' : '' ) . ' ' . __( 'and', 'youtube_embed' ) . ' ' . number_format( $title_cache ) . ' title' . ( $title_cache <> 1 ? 's' : '' ) . ".</p>\n";
292
  ?>
293
 
294
- <table class="form-table"><tr>
295
- <th scope="row"><?php _e( 'Clear Cache', 'youtube-embed' ); ?></th>
296
- <td><input type="checkbox" name="youtube_embed_clear_cache" value="1">&nbsp;<span class="description"><?php _e( 'Select this option to remove all YouTube Embed cache.', 'youtube-embed' ); ?></span></td>
297
- </tr></table>
 
298
 
299
- <br/><span class="yt_heading"><?php _e( 'YouTube API', 'youtube-embed' ); ?></span>
300
 
301
- <p><?php _e( 'The YouTube API is used to validate video IDs and to determine if it is a video or playlist.', 'youtube-embed' ); ?></p>
302
 
303
  <table class="form-table">
304
  <tr>
305
- <th scope="row"><?php _e( 'API State', 'youtube-embed' ); ?></th>
306
  <td><select name="youtube_embed_api">
307
- <option value="0"<?php if ( $options[ 'api' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e ( 'API should not be used', 'youtube-embed' ); ?></option>
308
- <option value="1"<?php if ( $options[ 'api' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e ( 'HTTP API used and errors are reported', 'youtube-embed' ); ?></option>
309
- <option value="2"<?php if ( $options[ 'api' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e ( 'HTTPS API used and errors are reported', 'youtube-embed' ); ?></option>
310
- <option value="3"<?php if ( $options[ 'api' ] == "3" ) { echo " selected='selected'"; } ?>><?php _e ( 'HTTP API used and no errors are reported', 'youtube-embed' ); ?></option>
311
- <option value="4"<?php if ( $options[ 'api' ] == "4" ) { echo " selected='selected'"; } ?>><?php _e ( 'HTTPS API used and no errors are reported', 'youtube-embed' ); ?></option>
312
  </select></td>
313
  </tr>
314
  </table>
315
 
316
- <br/><span class="yt_heading"><?php _e( 'Error Reporting', 'youtube-embed' ); ?></span>
317
 
318
- <p><?php _e( 'Playback errors are within the XHTML source code as comments - parameter errors and other types are displayed on the post output.', 'youtube-embed' ); ?></p>
319
 
320
  <table class="form-table"><tr>
321
- <th scope="row"><?php _e( 'Video Playback Error Message', 'youtube-embed' ); ?></th>
322
- <td><input type="text" size="60" name="youtube_embed_error_message" value="<?php echo htmlspecialchars( $options[ 'error_message' ] ); ?>"/>&nbsp;<span class="description"><?php _e( 'This is the message that will be shown on the post', 'youtube-embed' ); ?></span></td>
323
  </tr></table>
324
 
325
- <br/><span class="yt_heading"><?php _e( 'Security', 'youtube-embed' ); ?></span>
326
 
327
  <table class="form-table"><tr>
328
-
329
- <tr>
330
- <th scope="row"><?php _e( 'Privacy-Enhanced Mode', 'youtube-embed' ); ?></th>
331
- <td><select name="youtube_embed_privacy">
332
- <option value="0"<?php if ( $options[ 'privacy' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e ( 'Cookies should always be stored', 'youtube-embed' ); ?></option>
333
- <option value="1"<?php if ( $options[ 'privacy' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e ( 'Cookies should never be stored', 'youtube-embed' ); ?></option>
334
- <option value="2"<?php if ( $options[ 'privacy' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e ( "Cookies should be stored based on user's Do Not Track setting", 'youtube-embed' ); ?></option>
335
- </select>&nbsp;<span class="description"><?php _e( 'Read more about <a href="http://donottrack.us/">Do Not Track</a>', 'youtube-embed' ); ?></span></td>
336
  </tr></table>
337
 
338
- <br/><span class="yt_heading"><?php _e( 'Compatibility', 'youtube-embed' ); ?></span>
339
 
340
  <table class="form-table"><tr>
341
- <th scope="row"><?php _e( 'Allow Frame Border on IFRAME', 'youtube-embed' ); ?></th>
342
- <td><input type="checkbox" name="youtube_embed_frameborder" value="1"<?php if ( $options[ 'frameborder' ] == '1' ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'FRAMEBORDER is not HTML5 compliant', 'youtube-embed' ); ?></span></td>
343
  </tr></table>
344
 
345
  <?php wp_nonce_field( 'youtube-embed-general','youtube_embed_general_nonce', true, true ); ?>
346
 
347
- <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( 'Save Settings', 'youtube-embed' ); ?>"/></p>
348
 
349
  </form>
350
 
11
  ?>
12
  <div class="wrap" style="width: 1010px;">
13
  <div class="icon32"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
14
+ <h2><?php _e( 'Artiss YouTube Embed Options' ); ?></h2>
15
 
16
  <?php
 
17
  // If options have been updated on screen, update the database
18
 
19
  if ( ( !empty( $_POST ) ) && ( check_admin_referer( 'youtube-embed-general', 'youtube_embed_general_nonce' ) ) ) {
20
 
21
+ $options[ 'editor_button' ] = $_POST[ 'youtube_embed_editor_button' ];
22
+ $options[ 'admin_bar' ] = $_POST[ 'youtube_embed_admin_bar' ];
23
+ if ( !empty( $_POST[ 'youtube_embed_profile_no' ] ) ) { $options[ 'profile_no' ] = $_POST[ 'youtube_embed_profile_no' ]; }
 
24
 
25
  // If the number of profiles is less than zero, put it to 0
26
 
27
+ if ( $options[ 'profile_no' ] < 0 ) { $options[ 'profile_no' ] = 0; }
28
 
29
+ if ( !empty( $_POST[ 'youtube_embed_list_no' ] ) ) { $options[ 'list_no' ] = $_POST[ 'youtube_embed_list_no' ]; }
30
 
31
  // If the number of lists is less than 1, put it to 1
32
 
33
  if ( $options[ 'list_no' ] < 1 ) { $options[ 'list_no' ] = 1; }
34
 
35
+ if ( !empty( $_POST[ 'youtube_embed_embed_cache' ] ) ) { $options[ 'embed_cache' ] = $_POST[ 'youtube_embed_embed_cache' ]; }
36
+ if ( !empty( $_POST[ 'youtube_embed_info_cache' ] ) ) { $options[ 'info_cache' ] = $_POST[ 'youtube_embed_info_cache' ]; }
37
+ if ( !empty( $_POST[ 'youtube_embed_transcript_cache' ] ) ) { $options[ 'transcript_cache' ] = $_POST[ 'youtube_embed_transcript_cache' ]; }
38
+ if ( !empty( $_POST[ 'youtube_embed_fetch_title' ] ) ) { $options[ 'fetch_title' ] = $_POST[ 'youtube_embed_fetch_title' ]; }
39
+ if ( !empty( $_POST[ 'youtube_embed_alt_profile' ] ) ) { $options[ 'alt_profile' ] = $_POST[ 'youtube_embed_alt_profile' ]; }
40
+ if ( !empty( $_POST[ 'youtube_embed_alt_profile2' ] ) ) { $options[ 'alt_profile2' ] = $_POST[ 'youtube_embed_alt_profile2' ]; }
41
+ $options[ 'bracket' ] = $_POST[ 'youtube_embed_bracket' ];
42
+ $options[ 'alt' ] = $_POST[ 'youtube_embed_alt' ];
43
+ if ( !empty( $_POST[ 'youtube_embed_other_profile' ] ) ) { $options[ 'other_profile' ] = $_POST[ 'youtube_embed_other_profile' ]; }
44
+ $options[ 'comments' ] = $_POST[ 'youtube_embed_comments' ];
45
+ if ( !empty( $_POST[ 'youtube_embed_comments_profile' ] ) ) { $options[ 'comments_profile' ] = $_POST[ 'youtube_embed_comments_profile' ]; }
46
+ $options[ 'metadata' ] = $_POST[ 'youtube_embed_metadata' ];
47
+ if ( !empty( $_POST[ 'youtube_embed_feed' ] ) ) { $options[ 'feed' ] = $_POST[ 'youtube_embed_feed' ]; }
48
+ if ( !empty( $_POST[ 'youtube_embed_api' ] ) ) { $options[ 'api' ] = $_POST[ 'youtube_embed_api' ]; }
49
+ if ( !empty( $_POST[ 'youtube_embed_error_message' ] ) ) { $options[ 'error_message' ] = htmlspecialchars( $_POST[ 'youtube_embed_error_message' ] ); }
50
+ if ( !empty( $_POST[ 'youtube_embed_thumbnail' ] ) ) { $options[ 'thumbnail' ] = $_POST[ 'youtube_embed_thumbnail' ]; }
51
+ $options[ 'privacy' ] = $_POST[ 'youtube_embed_privacy' ];
52
+ $options[ 'frameborder' ] = $_POST[ 'youtube_embed_frameborder' ];
 
 
 
53
 
54
  // Update the options
55
 
56
  update_option( 'youtube_embed_general', $options );
57
+ $update_message = __( 'Settings Saved.' );
58
 
59
  // Update the alternative shortcodes
60
 
61
+ $shortcode[ 1 ] = $_POST[ 'youtube_embed_shortcode' ];
62
+ $shortcode[ 1 ] = trim( $shortcode[ 1 ], '[]' );
63
 
64
+ $shortcode[ 2 ] = $_POST[ 'youtube_embed_shortcode2' ];
65
+ $shortcode[ 2 ] = trim( $shortcode[ 2 ], '[]' );
66
 
67
  update_option( 'youtube_embed_shortcode', $shortcode );
68
 
69
+ // If the option to clear the cache has been ticked run an SQL to clear them down
 
 
 
 
 
70
 
71
+ if ( !empty( $_POST[ 'youtube_embed_clear_cache' ] ) ) {
72
+ global $wpdb;
73
+ $wpdb -> query( "DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_%ye_video_%'" );
74
+ $update_message .= ' ' . __( 'Cache cleared.' );
75
+ }
 
 
76
 
77
  echo '<div class="updated fade"><p><strong>' . $update_message . "</strong></p></div>\n";
78
  }
82
  $options = aye_set_general_defaults();
83
  $shortcode = aye_set_shortcode_option();
84
  $url = aye_set_url_option();
 
 
 
 
 
85
  ?>
86
 
87
+ <p><?php _e( 'These are the general settings for Artiss YouTube Embed. Please select <a href="admin.php?page=aye-profile-options">Profiles</a> for default embedding settings.' ); ?></p>
 
 
88
 
89
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ).'/wp-admin/admin.php?page=aye-general-options' ?>">
90
 
91
+ <span class="yt_heading"><?php _e( 'Embedding' ); ?></span>
 
 
 
 
 
 
 
 
 
92
 
93
  <table class="form-table">
94
  <tr>
95
+ <th scope="row"><?php _e( 'Add Metadata' ); ?></th>
96
+ <td><input type="checkbox" name="youtube_embed_metadata" value="1"<?php if ( $options[ 'metadata' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Allow rich metadata to be added to code. <a href="http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-metadata">Learn more</a>' ); ?></span></td>
97
  </tr>
98
 
99
  <tr>
100
+ <th scope="row"><?php _e( 'Comment Embedding' ); ?></th>
101
+ <td><input type="checkbox" name="youtube_embed_comments" value="1"<?php if ( $options[ 'comments' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Allow YouTube URLs in comments - will display as embedded videos. <a href="http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-comments">Learn more</a>' ); ?></span></td>
102
  </tr>
103
 
104
  <tr>
105
+ <th scope="row">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Profile to use' ); ?></th>
106
  <td><select name="youtube_embed_comments_profile">
107
  <?php aye_generate_profile_list( $options[ 'comments_profile' ], $options[ 'profile_no' ] ) ?>
108
  </select></td>
109
  </tr>
110
 
111
  <tr>
112
+ <th scope="row"><?php _e( 'Feed' ); ?></th>
113
  <td><select name="youtube_embed_feed">
114
+ <option value="t"<?php if ( $options[ 'feed' ] == "t" ) { echo " selected='selected'"; } ?>><?php _e ( 'Text link' ); ?></option>
115
+ <option value="v"<?php if ( $options[ 'feed' ] == "v" ) { echo " selected='selected'"; } ?>><?php _e ( 'Thumbnail' ); ?></option>
116
+ <option value="b"<?php if ( $options[ 'feed' ] == "b" ) { echo " selected='selected'"; } ?>><?php _e ( 'Thumbnail &amp; Text Link' ); ?></option>
117
+ </select>&nbsp;<span class="description"><?php _e( 'Videos cannot be embedded in feeds. Select how you wish them to be shown instead' ); ?></span></td>
118
  </tr>
119
 
120
  <tr>
121
+ <th scope="row">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Thumbnail to use' ); ?></th>
122
  <td><select name="youtube_embed_thumbnail">
123
+ <option value="default"<?php if ( $options[ 'thumbnail' ] == "default" ) { echo " selected='selected'"; } ?>><?php _e ( 'Default' ); ?></option>
124
+ <option value="hqdefault"<?php if ( $options[ 'thumbnail' ] == "hqdefault" ) { echo " selected='selected'"; } ?>><?php _e ( 'Default (HQ)' ); ?></option>
125
+ <option value="1"<?php if ( $options[ 'thumbnail' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e ( 'Start' ); ?></option>
126
+ <option value="2"<?php if ( $options[ 'thumbnail' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e ( 'Middle' ); ?></option>
127
+ <option value="3"<?php if ( $options[ 'thumbnail' ] == "3" ) { echo " selected='selected'"; } ?>><?php _e ( 'End' ); ?></option>
128
+ </select>&nbsp;<span class="description"><?php _e( 'Which thumbnail to use' ); ?></span></td>
 
 
 
 
 
129
  </tr>
130
  </table>
131
 
132
+ <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>
133
 
134
  <table class="form-table">
135
  <tr>
136
+ <th scope="row"><?php _e( 'Alternative Shortcode 1' ); ?></th>
137
  <td><input type="text" size="30" name="youtube_embed_shortcode" value="<?php echo $shortcode[ 1 ]; ?>"/></td>
138
  </tr>
139
 
140
  <tr>
141
+ <th scope="row">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Profile to use' ); ?></th>
142
  <td><select name="youtube_embed_alt_profile">
143
  <?php aye_generate_profile_list( $options[ 'alt_profile' ], $options[ 'profile_no' ] ) ?>
144
  </select></td>
145
  </tr>
146
 
147
  <tr>
148
+ <th scope="row"><?php _e( 'Alternative Shortcode 2' ); ?></th>
149
  <td><input type="text" size="30" name="youtube_embed_shortcode2" value="<?php echo $shortcode[ 2 ]; ?>"/></td>
150
  </tr>
151
 
152
  <tr>
153
+ <th scope="row">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Profile to use' ); ?></th>
154
  <td><select name="youtube_embed_alt_profile2">
155
  <?php aye_generate_profile_list( $options[ 'alt_profile2' ], $options[ 'profile_no' ] ) ?>
156
  </select></td>
157
  </tr>
158
  </table>
159
 
160
+ <br/><span class="yt_heading"><?php _e( 'Migration' ); ?></span><br/><br/>Switch on compatibility with other embedding plugins. For more details on migrating from another plugin, please <a href="http://www.artiss.co.uk/artiss-youtube-embed/compatibility">click here</a>.
161
 
162
  <table class="form-table">
163
  <tr>
164
+ <th scope="row"><?php _e( 'Bracket Embedding' ); ?></th>
165
+ <td><input type="checkbox" name="youtube_embed_bracket" value="1"<?php if ( $options[ 'bracket' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Allow embedding using URLs within brackets. Activating impacts performance' ); ?></span></td>
166
  </tr>
167
 
168
  <tr>
169
+ <th scope="row"><?php _e( 'Alternative Embedding' ); ?></th>
170
+ <td><input type="checkbox" name="youtube_embed_alt" value="1"<?php if ( $options[ 'alt' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Allow all other types of embedding. Activating impacts performance' ); ?></span></td>
171
  </tr>
172
 
173
  <tr>
174
+ <th scope="row">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Profile to use' ); ?></th>
175
  <td><select name="youtube_embed_other_profile">
176
  <?php aye_generate_profile_list( $options[ 'other_profile' ], $options[ 'profile_no' ] ) ?>
177
+ </select>&nbsp;<span class="description"><?php _e( 'For above 2 options' ); ?></span></td>
178
  </tr>
179
  </table>
180
 
181
+ <br/><span class="yt_heading"><?php _e( 'Admin Options' ); ?></span>
182
 
183
  <table class="form-table">
184
  <tr>
185
+ <th scope="row"><?php _e( 'Show YouTube Button' ); ?></th>
186
+ <td><input type="checkbox" name="youtube_embed_editor_button" value="1"<?php if ( $options[ 'editor_button' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Show the YouTube button on the post editor' ); ?></span></td>
187
  </tr>
188
 
189
  <tr>
190
+ <th scope="row"><?php _e( 'Add to Admin Bar' ); ?></th>
191
+ <td><input type="checkbox" name="youtube_embed_admin_bar" value="1"<?php if ( $options[ 'admin_bar' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Add link to options screen to Admin Bar' ); ?></span></td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  </tr>
193
  </table>
194
 
195
+ <br/><span class="yt_heading"><?php _e( 'Profile &amp; List Sizes' ); ?></span>
196
 
197
  <table class="form-table">
198
  <tr>
199
+ <th scope="row"><?php _e( 'Number of Profiles' ); ?></th>
200
+ <td><input type="text" size="2" maxlength="2" name="youtube_embed_profile_no" value="<?php echo $options[ 'profile_no' ]; ?>"/>&nbsp;<span class="description"><?php _e( 'Maximum number of profiles' ); ?></span></td>
201
  </tr>
202
 
203
  <tr>
204
+ <th scope="row"><?php _e( 'Number of Lists' ); ?></th>
205
+ <td><input type="text" size="2" maxlength="2" name="youtube_embed_list_no" value="<?php echo $options[ 'list_no' ]; ?>"/>&nbsp;<span class="description"><?php _e( 'Maximum number of lists' ); ?></span></td>
206
  </tr>
207
  </table>
208
 
209
+ <br/><span class="yt_heading"><?php _e( 'Performance' ); ?></span>
210
 
211
  <table class="form-table">
212
  <tr>
213
+ <th scope="row"><?php _e( 'Embed Cache' ); ?></th>
214
+ <td><input type="text" size="3" maxlength="3" name="youtube_embed_embed_cache" value="<?php echo $options[ 'embed_cache' ]; ?>"/>&nbsp;<span class="description"><?php _e( 'How many hours to retain embed output. 0 to switch off' ); ?></span></td>
215
  </tr>
216
 
217
  <tr>
218
+ <th scope="row"><?php _e( 'Video Information Cache' ); ?></th>
219
+ <td><input type="text" size="3" maxlength="3" name="youtube_embed_info_cache" value="<?php echo $options[ 'info_cache' ]; ?>"/>&nbsp;<span class="description"><?php _e( 'How many hours to retain video information, including it\'s validity. 0 to switch off' ); ?></span></td>
220
  </tr>
221
 
222
  <tr>
223
+ <th scope="row"><?php _e( 'Transcript Cache' ); ?></th>
224
+ <td><input type="text" size="3" maxlength="3" name="youtube_embed_transcript_cache" value="<?php echo $options[ 'transcript_cache' ]; ?>"/>&nbsp;<span class="description"><?php _e( 'How many hours to store transcripts for in cache. 0 to switch off' ); ?></span></td>
225
+ </tr>
226
 
227
  <?php
228
  global $wpdb;
229
+ $numposts = $wpdb -> get_var( "SELECT COUNT(*) FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_%ye_video_%'" );
 
 
 
 
230
  ?>
231
 
232
+ <tr>
233
+ <th scope="row"><?php _e( 'Clear Cache' ); ?></th>
234
+ <td><input type="checkbox" name="youtube_embed_clear_cache" value="1">&nbsp;<span class="description"><?php echo sprintf ( __( 'Select this option to remove all YouTube Embed cache. You currently have %d cached video(s)' ), number_format( $numposts ) ); ?></span></td>
235
+ </tr>
236
+ </table>
237
 
238
+ <br/><span class="yt_heading"><?php _e( 'YouTube API' ); ?></span>
239
 
240
+ <p><?php _e( 'The YouTube API is used to validate video IDs and to determine if it is a video or playlist.' ); ?></p>
241
 
242
  <table class="form-table">
243
  <tr>
244
+ <th scope="row"><?php _e( 'API State' ); ?></th>
245
  <td><select name="youtube_embed_api">
246
+ <option value="0"<?php if ( $options[ 'api' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e ( 'API should not be used' ); ?></option>
247
+ <option value="1"<?php if ( $options[ 'api' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e ( 'HTTP API used and errors are reported' ); ?></option>
248
+ <option value="2"<?php if ( $options[ 'api' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e ( 'HTTPS API used and errors are reported' ); ?></option>
249
+ <option value="3"<?php if ( $options[ 'api' ] == "3" ) { echo " selected='selected'"; } ?>><?php _e ( 'HTTP API used and no errors are reported' ); ?></option>
250
+ <option value="4"<?php if ( $options[ 'api' ] == "4" ) { echo " selected='selected'"; } ?>><?php _e ( 'HTTPS API used and no errors are reported' ); ?></option>
251
  </select></td>
252
  </tr>
253
  </table>
254
 
255
+ <br/><span class="yt_heading"><?php _e( 'Error Reporting' ); ?></span>
256
 
257
+ <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>
258
 
259
  <table class="form-table"><tr>
260
+ <th scope="row"><?php _e( 'Video Playback Error Message' ); ?></th>
261
+ <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>
262
  </tr></table>
263
 
264
+ <br/><span class="yt_heading"><?php _e( 'Security' ); ?></span>
265
 
266
  <table class="form-table"><tr>
267
+ <th scope="row"><?php _e( 'Privacy-Enhanced Mode' ); ?></th>
268
+ <td><input type="checkbox" name="youtube_embed_privacy" value="1"<?php if ( $options[ 'privacy' ] == '1' ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'When on, the player on this site will not store cookies' ); ?></span></td>
 
 
 
 
 
 
269
  </tr></table>
270
 
271
+ <br/><span class="yt_heading"><?php _e( 'Compatability' ); ?></span>
272
 
273
  <table class="form-table"><tr>
274
+ <th scope="row"><?php _e( 'Allow Frame Border on IFRAME' ); ?></th>
275
+ <td><input type="checkbox" name="youtube_embed_frameborder" value="1"<?php if ( $options[ 'frameborder' ] == '1' ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'FRAMEBORDER is not HTML5 compliant' ); ?></span></td>
276
  </tr></table>
277
 
278
  <?php wp_nonce_field( 'youtube-embed-general','youtube_embed_general_nonce', true, true ); ?>
279
 
280
+ <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( 'Save Settings' ); ?>"/></p>
281
 
282
  </form>
283
 
includes/aye-options-lists.php CHANGED
@@ -12,7 +12,7 @@
12
 
13
  <div class="icon32"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
14
 
15
- <h2><?php _e( 'Artiss YouTube Embed Lists', 'youtube-embed' ); ?></h2>
16
 
17
  <?php
18
  // Set current list number
@@ -23,12 +23,12 @@ if ( $list_no == '' ) { $list_no = 1; }
23
  if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-general', 'youtube_embed_general_nonce' ) ) ) {
24
 
25
  $class = 'updated fade';
26
- $message = __( 'Settings Saved.', 'youtube-embed' );
27
  $new_id_list = '';
28
 
29
  if ( ( $_POST[ 'youtube_embed_video_list' ] == '' ) or ( $_POST[ 'youtube_embed_name' ] == '' ) ) {
30
  $class = 'error';
31
- $message = __( 'All fields must be completed.', 'youtube-embed' );
32
  } else {
33
  $id_array = explode( "\n", $_POST[ 'youtube_embed_video_list' ] );
34
  $loop = 0;
@@ -50,7 +50,7 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-g
50
  // If one or more IDs weren't valid, output an error
51
  if (!$valid) {
52
  $class = 'error';
53
- $message = __( 'Errors were found with your video list. See the list below for details.', 'youtube-embed' );
54
  }
55
  }
56
 
@@ -64,7 +64,7 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-g
64
  }
65
 
66
  if ( substr( $class, 0, 7 ) == 'updated' ) { update_option( 'youtube_embed_list' . $list_no, $options ); }
67
- echo '<div class="' . $class . '"><p><strong>' . $message . "</strong></p></div>\n";
68
  } else {
69
  $class = '';
70
  }
@@ -72,14 +72,8 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-g
72
  // Fetch options into an array
73
  if ( $class != "error" ) { $options = aye_set_list_defaults( $list_no ); }
74
  $general = aye_set_general_defaults();
75
-
76
- // Display ads
77
-
78
- if ( $general[ 'donated'] != 1 ) { artiss_plugin_ads( 'youtube-embed', 990 ); }
79
  ?>
80
 
81
- <div class="updated fade"><p>Have you voted for which features of YouTube Embed you'd like to retain in version 3? <a href="http://www.artiss.co.uk/youtube-embed/youtube-embed-features-vote" target="_new">Click here</a> to vote!</p></div>
82
-
83
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=aye-list-options'; ?>">
84
 
85
  <span class="alignright">
@@ -91,11 +85,11 @@ while ( $loop <= $general[ 'list_no' ] ) {
91
  $listfiles = get_option( 'youtube_embed_list' . $loop );
92
  $listname = $listfiles[ 'name' ];
93
 
94
- if ( $listname == '' ) { $listname = __( 'List', 'youtube-embed' ) . ' ' . $loop; }
95
- if ( strlen( $listname ) > 30 ) { $listname = substr( $listname, 0, 30 ) . '&#8230;'; }
96
  echo '<option value="' . $loop . '"';
97
  if ( $list_no == $loop ) { echo " selected='selected'"; }
98
- echo '>' . $listname . "</option>\n";
99
 
100
  $loop ++;
101
  }
@@ -104,25 +98,25 @@ while ( $loop <= $general[ 'list_no' ] ) {
104
  <input type="submit" name="List" class="button-secondary" value="<?php _e( 'Change list' ); ?>"/>
105
  </span><br/>
106
 
107
- <?php echo sprintf( __( 'These are the options for list ', 'youtube-embed' ), $list_no) . '<br/>' . __( 'Update the name, if required, and specify a list of YouTube video IDs. Use the drop-down on the right hand side to swap between lists.', 'youtube-embed' ); ?>
108
 
109
  <table class="form-table">
110
 
111
  <tr>
112
- <th scope="row"><?php _e( 'List name', 'youtube-embed' ); ?></th><td>
113
  <input type="text" size="20" name="youtube_embed_name" value="<?php echo $options[ 'name' ]; ?>"/>
114
- <?php echo '&nbsp;<span class="description">' . __( 'The name you wish to give this list', 'youtube-embed' ) . '</span>'; ?>
115
  </td></tr>
116
 
117
  <tr>
118
- <th scope="row"><?php _e( 'Video IDs (one per line)', 'youtube-embed' ); ?></th><td>
119
  <textarea name="youtube_embed_video_list" id="youtube_embed_video_list" cols="12" rows="10" class="widefat"><?php echo $options[ 'list' ]; ?></textarea>
120
  </td></tr>
121
  </table>
122
 
123
  <?php wp_nonce_field( 'youtube-embed-general','youtube_embed_general_nonce', true, true ); ?>
124
 
125
- <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( 'Save Settings', 'youtube-embed' ); ?>"/></p>
126
 
127
  </form>
128
 
@@ -133,7 +127,7 @@ if ( $options[ 'list' ] != '' ) {
133
 
134
  $id_array = explode( "\n", $options[ 'list' ] );
135
 
136
- echo "<table class=\"widefat\">\n<thead>\n\t<tr>\n\t\t<th>" . __( 'Video ID', 'youtube-embed' ) . "</th>\n\t\t<th>" . __( 'Video Title', 'youtube-embed' ) . "</th>\n\t\t<th>" . __( 'Status', 'youtube-embed' ) . "</th>\n\t</tr>\n</thead>\n<tbody>\n";
137
  $loop = 0;
138
 
139
  while ( $loop < count( $id_array ) ) {
@@ -149,18 +143,18 @@ if ( $options[ 'list' ] != '' ) {
149
  $type = $video_info[ 'type' ];
150
 
151
  if ( $type == 'p' ) {
152
- $text = __( 'This is a playlist', 'youtube-embed' );
153
  $status = '-1';
154
  } else {
155
  if ( $type == '' ) {
156
- $text = __( 'Invalid video ID', 'youtube-embed' );
157
  $status = '-2';
158
  } else {
159
  if ( strlen( $type ) != 1 ) {
160
- $text = __( 'YouTube API error', 'youtube-embed' );
161
  $status = '-3';
162
  } else {
163
- $text = __( 'Valid video', 'youtube-embed' );
164
  $status = '0';
165
  }
166
  }
@@ -178,10 +172,10 @@ if ( $options[ 'list' ] != '' ) {
178
 
179
  echo '"><img src="' . plugins_url() . '/youtube-embed/images/';
180
  if ( $status == 0 ) {
181
- $alt_text = __( 'The video ID is valid', 'youtube-embed' );
182
  echo 'tick.png" alt="' . $alt_text . '" title="' . $alt_text . '" ';
183
  } else {
184
- $alt_text = __( 'The video ID is invalid', 'youtube-embed' );
185
  echo 'cross.png" alt="' . $alt_text . '" title="' . $alt_text . '" ';
186
  }
187
 
12
 
13
  <div class="icon32"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
14
 
15
+ <h2><?php _e( 'Artiss YouTube Embed Lists' ); ?></h2>
16
 
17
  <?php
18
  // Set current list number
23
  if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-general', 'youtube_embed_general_nonce' ) ) ) {
24
 
25
  $class = 'updated fade';
26
+ $message = __( 'Settings Saved.' );
27
  $new_id_list = '';
28
 
29
  if ( ( $_POST[ 'youtube_embed_video_list' ] == '' ) or ( $_POST[ 'youtube_embed_name' ] == '' ) ) {
30
  $class = 'error';
31
+ $message = __( 'All fields must be completed.' );
32
  } else {
33
  $id_array = explode( "\n", $_POST[ 'youtube_embed_video_list' ] );
34
  $loop = 0;
50
  // If one or more IDs weren't valid, output an error
51
  if (!$valid) {
52
  $class = 'error';
53
+ $message = __( 'Errors were found with your video list. See the list below for details.' );
54
  }
55
  }
56
 
64
  }
65
 
66
  if ( substr( $class, 0, 7 ) == 'updated' ) { update_option( 'youtube_embed_list' . $list_no, $options ); }
67
+ echo '<div class="' . $class.'"><p><strong>' . __( $message ) . "</strong></p></div>\n";
68
  } else {
69
  $class = '';
70
  }
72
  // Fetch options into an array
73
  if ( $class != "error" ) { $options = aye_set_list_defaults( $list_no ); }
74
  $general = aye_set_general_defaults();
 
 
 
 
75
  ?>
76
 
 
 
77
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=aye-list-options'; ?>">
78
 
79
  <span class="alignright">
85
  $listfiles = get_option( 'youtube_embed_list' . $loop );
86
  $listname = $listfiles[ 'name' ];
87
 
88
+ if ( $listname == '' ) { $listname = __( 'List' ) . ' ' . $loop; }
89
+ if ( strlen( $listname ) > 30 ) { $listname = substr( $listname, 0, 30 ) . '&#8230;'; }
90
  echo '<option value="' . $loop . '"';
91
  if ( $list_no == $loop ) { echo " selected='selected'"; }
92
+ echo '>' . __( $listname ) . "</option>\n";
93
 
94
  $loop ++;
95
  }
98
  <input type="submit" name="List" class="button-secondary" value="<?php _e( 'Change list' ); ?>"/>
99
  </span><br/>
100
 
101
+ <?php echo sprintf( __( 'These are the options for list ' ), $list_no) . '<br/>' . __( 'Update the name, if required, and specify a list of YouTube video IDs. Use the drop-down on the right hand side to swap between lists.' ); ?>
102
 
103
  <table class="form-table">
104
 
105
  <tr>
106
+ <th scope="row"><?php _e( 'List name' ); ?></th><td>
107
  <input type="text" size="20" name="youtube_embed_name" value="<?php echo $options[ 'name' ]; ?>"/>
108
+ <?php echo '&nbsp;<span class="description">' . __( 'The name you wish to give this list' ) . '</span>'; ?>
109
  </td></tr>
110
 
111
  <tr>
112
+ <th scope="row"><?php _e( 'Video IDs (one per line)' ); ?></th><td>
113
  <textarea name="youtube_embed_video_list" id="youtube_embed_video_list" cols="12" rows="10" class="widefat"><?php echo $options[ 'list' ]; ?></textarea>
114
  </td></tr>
115
  </table>
116
 
117
  <?php wp_nonce_field( 'youtube-embed-general','youtube_embed_general_nonce', true, true ); ?>
118
 
119
+ <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( 'Save Settings' ); ?>"/></p>
120
 
121
  </form>
122
 
127
 
128
  $id_array = explode( "\n", $options[ 'list' ] );
129
 
130
+ echo '<table class=\"widefat\">\n<thead>\n\t<tr>\n\t\t<th>' . __( 'Video ID' ) . '</th>\n\t\t<th>' . __( 'Video Title' ) . '</th>\n\t\t<th>' . __( 'Status' ) . "</th>\n\t</tr>\n</thead>\n<tbody>\n";
131
  $loop = 0;
132
 
133
  while ( $loop < count( $id_array ) ) {
143
  $type = $video_info[ 'type' ];
144
 
145
  if ( $type == 'p' ) {
146
+ $text = __( 'This is a playlist' );
147
  $status = '-1';
148
  } else {
149
  if ( $type == '' ) {
150
+ $text = __( 'Invalid video ID' );
151
  $status = '-2';
152
  } else {
153
  if ( strlen( $type ) != 1 ) {
154
+ $text = __( 'YouTube API error' );
155
  $status = '-3';
156
  } else {
157
+ $text = __( 'Valid video' );
158
  $status = '0';
159
  }
160
  }
172
 
173
  echo '"><img src="' . plugins_url() . '/youtube-embed/images/';
174
  if ( $status == 0 ) {
175
+ $alt_text = __( 'The video ID is valid' );
176
  echo 'tick.png" alt="' . $alt_text . '" title="' . $alt_text . '" ';
177
  } else {
178
+ $alt_text = __( 'The video ID is invalid' );
179
  echo 'cross.png" alt="' . $alt_text . '" title="' . $alt_text . '" ';
180
  }
181
 
includes/aye-options-profiles.php CHANGED
@@ -8,83 +8,91 @@
8
  * @since 2.0
9
  */
10
  ?>
11
- <div class="wrap">
12
-
13
- <div style="width: 1010px;">
14
 
15
  <div class="icon32"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
16
 
17
- <h2><?php _e( 'Artiss YouTube Embed Profiles', 'youtube-embed' ); ?></h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
  <?php
20
-
21
  // Set current profile number
22
-
23
  if ( isset( $_POST[ 'youtube_embed_profile_no' ] ) ) { $profile_no = $_POST[ 'youtube_embed_profile_no' ]; } else { $profile_no = 0; }
24
  if ( $profile_no == '' ) { $profile_no = 0; }
25
 
26
  // If options have been updated on screen, update the database
27
-
28
  if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-profile' , 'youtube_embed_profile_nonce' ) ) ) {
29
 
30
- $options[ 'name' ] = $_POST[ 'youtube_embed_name' ];
31
- $options[ 'type' ] = $_POST[ 'youtube_embed_type' ];
32
- $options[ 'playlist' ] = $_POST[ 'youtube_embed_playlist' ];
33
  $options[ 'width' ] = $_POST[ 'youtube_embed_width' ];
34
- $options[ 'height' ] = $_POST[ 'youtube_embed_height' ];
35
 
36
- $options[ 'template' ] = htmlspecialchars_decode( $_POST[ 'youtube_embed_template' ] );
37
  if ( strpos( $options[ 'template' ], '%video%' ) === false ) { $options[ 'template' ] = '%video%'; }
38
 
39
- $options[ 'style' ] = $_POST[ 'youtube_embed_style' ];
40
- $options[ 'fullscreen' ] = $_POST[ 'youtube_embed_fullscreen' ];
41
- $options[ 'autoplay'] = $_POST[ 'youtube_embed_autoplay' ];
42
- $options[ 'loop'] = $_POST[ 'youtube_embed_loop' ];
43
- $options[ 'cc'] = $_POST[ 'youtube_embed_cc' ];
44
- $options[ 'annotation'] = $_POST[ 'youtube_embed_annotation' ];
45
- $options[ 'related'] = $_POST[ 'youtube_embed_related' ];
46
- $options[ 'info'] = $_POST[ 'youtube_embed_info' ];
47
- $options[ 'link'] = $_POST[ 'youtube_embed_link' ];
48
- $options[ 'react'] = $_POST[ 'youtube_embed_react' ];
49
- $options[ 'sweetspot'] = $_POST[ 'youtube_embed_sweetspot' ];
50
- $options[ 'disablekb'] = $_POST[ 'youtube_embed_disablekb' ];
51
- $options[ 'autohide'] = $_POST[ 'youtube_embed_autohide' ];
52
- $options[ 'controls'] = $_POST[ 'youtube_embed_controls' ];
53
- $options[ 'fallback'] = $_POST[ 'youtube_embed_fallback' ];
54
- $options[ 'wmode'] = $_POST[ 'youtube_embed_wmode' ];
55
- $options[ 'audio'] = $_POST[ 'youtube_embed_audio' ];
56
- $options[ 'hd'] = $_POST[ 'youtube_embed_hd' ];
57
- $options[ 'color' ] = $_POST[ 'youtube_embed_color' ];
58
- $options[ 'theme' ] = $_POST[ 'youtube_embed_theme' ];
59
- $options[ 'https' ] = $_POST[ 'youtube_embed_https' ];
60
- $options[ 'privacy' ] = $_POST[ 'youtube_embed_privacy' ];
61
- $options[ 'modest' ] = $_POST[ 'youtube_embed_modest' ];
62
- $options[ 'dynamic' ] = $_POST[ 'youtube_embed_dynamic' ];
63
- $options[ 'fixed' ] = $_POST[ 'youtube_embed_fixed' ];
64
-
65
- $default_size = $_POST[ 'youtube_embed_size' ];
66
 
67
  if ( $default_size !== '' ) {
68
  $options[ 'width' ] = ltrim( substr( $default_size, 0, 4 ), '0' );
69
  $options[ 'height'] = ltrim( substr( $default_size, -4, 4 ), '0' );
70
  }
71
 
72
- // Set width or height, if missing
73
-
74
- if ( ( $options[ 'width' ] == '' ) && ( $options[ 'height' ] == '' ) ) {
75
- if ( isset( $GLOBALS[ 'content_width' ] ) ) {
76
- $options[ 'width' ] = $GLOBALS[ 'content_width' ];
77
- } else {
78
- $options[ 'width' ] = 560;
79
- }
80
- $options[ 'height' ] = 27 + round( ( $options[ 'width' ] / 16 ) * 9, 0 );
81
- }
82
- if ( ( $options[ 'width' ] == '' ) && ( $options[ 'height' ] != '' ) ) {
83
- $options[ 'width' ] = round( ( $options[ 'height' ] / 9 ) * 16, 0 );
84
- }
85
- if ( ( $options[ 'width' ] != '' ) && ( $options[ 'height' ] == '' ) ) {
86
- $options[ 'height' ] = 27 + round( ( $options[ 'width' ] / 16 ) * 9, 0 );
87
- }
88
 
89
  update_option( 'youtube_embed_profile' . $profile_no, $options );
90
  echo '<div class="updated fade"><p><strong>' . __( $options[ 'name' ].' Profile Saved.' ) . "</strong></p></div>\n";
@@ -93,285 +101,270 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-p
93
  }
94
 
95
  // Video option button has been pressed
96
-
97
  if ( !empty( $_POST[ 'Video' ] ) ) { $video_type = $_POST[ 'youtube_embed_video_type' ]; } else { $video_type = 'd'; }
98
 
99
  // Fetch options into an array
100
-
101
  $options = aye_set_profile_defaults( $profile_no );
102
  $general = aye_set_general_defaults();
103
-
104
- // Display ads
105
-
106
- if ( $general[ 'donated'] != 1 ) { artiss_plugin_ads( 'youtube-embed', 990 ); }
107
  ?>
108
 
109
- <div class="updated fade"><p>Have you voted for which features of YouTube Embed you'd like to retain in version 3? <a href="http://www.artiss.co.uk/youtube-embed/youtube-embed-features-vote" target="_new">Click here</a> to vote!</p></div>
110
-
111
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=aye-profile-options' ?>">
112
 
113
  <span class="alignright">
114
  <select name="youtube_embed_profile_no">
115
  <?php aye_generate_profile_list( $profile_no, $general[ 'profile_no' ] ) ?>
116
  </select>
117
- <input type="submit" name="Profile" class="button-secondary" value="<?php _e( 'Change profile', 'youtube-embed' ); ?>"/>
118
  </span><br/>
119
 
120
  <?php
121
  if ( $profile_no == '0' ) {
122
- _e( 'These are the options for the default profile.', 'youtube-embed' );
123
  } else {
124
- sprintf( _e( 'These are the options for profile %s.', 'youtube-embed' ), $profile_no );
125
  }
126
- echo ' ' . __( 'Use the drop-down on the right hand side to swap between profiles.', 'youtube-embed' );
127
  ?>
128
 
129
  <table class="form-table">
130
 
131
  <tr>
132
- <th scope="row"><?php _e( 'Profile name', 'youtube-embed' ); ?></th><td>
133
  <input type="text" size="20" name="youtube_embed_name" value="<?php echo $options[ 'name' ]; ?>"<?php if ( $profile_no == 0 ) { echo ' readonly="readonly"'; } ?>/>
134
- <?php if ( $profile_no != 0 ) { echo '&nbsp;<span class="description">' . __( 'The name you wish to give this profile', 'youtube-embed' ) . '</span>'; } ?>
135
  </td></tr>
136
 
137
  <tr valign="top">
138
- <th scope="row"><?php _e( 'Video Embed Type', 'youtube-embed' ); ?></th>
139
- <td><span class="description"><?php _e( 'The type of player to use for videos.', 'youtube-embed' ); ?></span><br/>
140
- <input type="radio" name="youtube_embed_type" value="v"<?php if ( $options[ 'type' ] == "v" ) { echo ' checked="checked"'; } ?>/><?php echo '&nbsp;' . __( 'IFRAME', 'youtube-embed' ); ?><span class="description"><?php echo '&nbsp;' . __( 'Uses AS3 Flash player, if Flash is available. Alternatively, uses HTML5 player. This is the current YouTube default.', 'youtube-embed' ); ?></span><br/>
141
- <input type="radio" name="youtube_embed_type" value="p"<?php if ( $options[ 'type' ] == "p" ) { echo ' checked="checked"'; } ?>/><?php echo '&nbsp;' . __( 'OBJECT', 'youtube-embed' ); ?><span class="description"><?php echo '&nbsp;' . __( 'Use the AS3 Flash player.', 'youtube-embed' ); ?></span><br/>
142
- <input type="radio" name="youtube_embed_type" value="c"<?php if ( $options[ 'type' ] == "c" ) { echo ' checked="checked"'; } ?>/><?php echo '&nbsp;' . __( 'Chromeless', 'youtube-embed' ); ?><span class="description"><?php echo '&nbsp;' . __( 'Use the <a href="http://www.artiss.co.uk/youtube-embed/further-help#ye-chromeless">Chromeless</a> version of the AS3 Flash Player.', 'youtube-embed' ); ?></span><br/>
143
- <input type="radio" name="youtube_embed_type" value="m"<?php if ( $options[ 'type' ] == "m" ) { echo ' checked="checked"'; } ?>/><?php echo '&nbsp;' . __( 'EmbedPlus', 'youtube-embed' ); ?><span class="description"><?php echo '&nbsp;' . __( 'Use <a href="http://www.artiss.co.uk/youtube-embed/further-help#ye-embedplus">EmbedPlus</a>, if Flash is available.', 'youtube-embed' ); ?></span>
144
  </td>
145
  </tr>
146
 
147
  <tr valign="top">
148
- <th scope="row"><?php _e( 'Playlist Embed Type', 'youtube-embed' ); ?></th>
149
- <td><span class="description"><?php _e( 'The type of player to use when showing playlists.', 'youtube-embed' ); ?></span><br/>
150
- <input type="radio" name="youtube_embed_playlist" value="v"<?php if ( $options[ 'playlist' ] == "v" ) { echo ' checked="checked"'; } ?>/><?php echo '&nbsp;' . __( 'IFRAME', 'youtube-embed' ); ?><br/>
151
- <input type="radio" name="youtube_embed_playlist" value="o"<?php if ( $options[ 'playlist' ] == "o" ) { echo ' checked="checked"'; } ?>/><?php echo '&nbsp;' . __( 'OBJECT', 'youtube-embed' ); ?><br/>
152
  </td>
153
  </tr>
154
  </table>
155
 
156
- <br/><span class="yt_heading"><?php _e( 'Options For All Player Types', 'youtube-embed' ); ?></span>
157
 
158
  <table class="form-table">
159
  <tr>
160
- <th scope="row"><?php _e( 'Template', 'youtube-embed' ); ?></th>
161
- <td><input type="text" size="40" name="youtube_embed_template" value="<?php echo htmlspecialchars( $options[ 'template' ] ); ?>"/>&nbsp;<span class="description"><?php __( 'Wrapper for video output. Must include <code>%video%</code> tag to show video position', 'youtube-embed' ); ?></span></td>
162
  </tr>
163
 
164
  <tr>
165
- <th scope="row"><?php _e( 'Style', 'youtube-embed' ); ?></th>
166
- <td><input type="text" size="40" name="youtube_embed_style" value="<?php echo htmlspecialchars( $options[ 'style' ] ); ?>"/>&nbsp;<span class="description"><?php __( 'CSS elements to apply to video', 'youtube-embed' ); ?></span></td>
167
  </tr>
168
  </table>
169
 
170
  <table class="form-table ytbox_grey">
171
  <tr>
172
- <th scope="row"><?php _e( 'Video size', 'youtube-embed' ); ?></th>
173
- <td><input type="text" size="3" maxlength="3" name="youtube_embed_width" value="<?php echo $options[ 'width' ]; ?>"/>&nbsp;x&nbsp;<input type="text" size="3" maxlength="3" name="youtube_embed_height" value="<?php echo $options[ 'height' ]; ?>"/>&nbsp;<span class="description"><?php _e( 'The width x height of the video, in pixels', 'youtube-embed' ); ?></span></td>
174
  </tr>
175
 
176
  <tr valign="top">
177
- <th scope="row"><?php _e( 'Default Sizes', 'youtube-embed' ); ?></th>
178
  <td><select name="youtube_embed_size">
179
- <option value=""<?php if ( $default_size == '' ) { echo " selected='selected'"; } ?>><?php _e( 'Use above sizes', 'youtube-embed' ); ?></option>
180
  <option value="04800385"<?php if ( $default_size == "04800385" ) { echo " selected='selected'"; } ?>><?php echo '480x385 4:3'; ?></option>
181
  <option value="05600340"<?php if ( $default_size == "05600340" ) { echo " selected='selected'"; } ?>><?php echo '560x340 16:9'; ?></option>
182
  <option value="06400385"<?php if ( $default_size == "06400385" ) { echo " selected='selected'"; } ?>><?php echo '640x385 16:9'; ?></option>
183
  <option value="08530505"<?php if ( $default_size == "08530505" ) { echo " selected='selected'"; } ?>><?php echo '853x505 16:9'; ?></option>
184
  <option value="12800745"<?php if ( $default_size == "12800745" ) { echo " selected='selected'"; } ?>><?php echo '1280x745 16:9'; ?></option>
185
- </select>&nbsp;<span class="description"><?php _e( 'Select one of these default sizes to override the above video sizes', 'youtube-embed' ); ?></span></td>
186
  </tr>
187
 
188
  <tr>
189
- <th scope="row"><?php _e( 'Dynamically Resize', 'youtube-embed' ); ?></th>
190
- <td><input type="checkbox" name="youtube_embed_dynamic" value="1"<?php if ( $options[ 'dynamic' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Show full width and resize with the browser', 'youtube-embed' ); ?></span></td>
191
  </tr>
192
 
193
  <tr>
194
- <th scope="row">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Set Maximum Size', 'youtube-embed' ); ?></th>
195
- <td><input type="checkbox" name="youtube_embed_fixed" value="1"<?php if ( $options[ 'fixed' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Use above width to define maximum size', 'youtube-embed' ); ?></span></td>
196
  </tr>
197
  </table>
198
 
199
  <table class="form-table">
200
 
201
  <tr>
202
- <th scope="row"><?php _e( 'Audio Only', 'youtube-embed' ); ?></th>
203
- <td><input type="checkbox" name="youtube_embed_audio" value="1"<?php if ( $options[ 'audio' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Only show the toolbar for audio only playback', 'youtube-embed' ); ?></span></td>
204
  </tr>
205
 
206
  <tr>
207
- <th scope="row"><?php _e( 'Autoplay', 'youtube-embed' ); ?></th>
208
- <td><input type="checkbox" name="youtube_embed_autoplay" value="1"<?php if ( $options[ 'autoplay' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'The video will start playing when the player loads', 'youtube-embed' ); ?></span></td>
209
  </tr>
210
 
211
  </table>
212
 
213
- <br/><span class="yt_heading"><?php _e( 'Options Not Supported by EmbedPlus', 'youtube-embed' ); ?></span>
214
 
215
  <table class="form-table">
216
 
217
  <tr>
218
- <th scope="row"><?php _e( 'Auto hide', 'youtube-embed' ); ?></th>
219
  <td><select name="youtube_embed_autohide">
220
- <option value="0"<?php if ( $options[ 'autohide' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls &amp; progress bar remain visible', 'youtube-embed' ); ?></option>
221
- <option value="1"<?php if ( $options[ 'autohide' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls &amp; progress bar fade out', 'youtube-embed' ); ?></option>
222
- <option value="2"<?php if ( $options[ 'autohide' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e( 'Progress bar fades', 'youtube-embed' ); ?></option>
223
- </select>&nbsp;<span class="description"><?php _e( 'Video controls will automatically hide after a video begins playing', 'youtube-embed' ); ?></span></td>
224
  </tr>
225
 
226
  <tr>
227
- <th scope="row"><?php _e( 'Controls', 'youtube-embed' ); ?></th>
228
- <td><select name="youtube_embed_controls">
229
- <option value="0"<?php if ( $options[ 'controls' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls do not display &amp; Flash player loads immediately', 'youtube-embed' ); ?></option>
230
- <option value="1"<?php if ( $options[ 'controls' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls display &amp; Flash player loads immediately', 'youtube-embed' ); ?></option>
231
- <option value="2"<?php if ( $options[ 'controls' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls display &amp; Flash player loads once video starts', 'youtube-embed' ); ?></option>
232
- </select>&nbsp;<span class="description"><?php _e( 'Whether the video player controls will display. For AS3 player it also defines when the Flash player will load', 'youtube-embed' ); ?></span></td>
233
  </tr>
234
 
235
  <tr>
236
- <th scope="row">SSL</th>
237
- <td><input type="checkbox" name="youtube_embed_https" value="1"<?php if ( $options[ 'https' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Use SSL? <a href="http://www.google.com/support/youtube/bin/answer.py?answer=171780&expand=UseHTTPS#HTTPS">Read more</a>', 'youtube-embed' ); ?></span></td>
238
  </tr>
239
 
240
  <tr>
241
- <th scope="row"><?php _e( 'Loop Video', 'youtube-embed' ); ?></th>
242
- <td><input type="checkbox" name="youtube_embed_loop" value="1"<?php if ( $options[ 'loop' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Play the initial video again and again. In the case of a playlist, this will play the entire playlist and then start again at the first video', 'youtube-embed' ); ?></span></td>
243
  </tr>
244
 
245
  <tr>
246
- <th scope="row"><?php _e( 'Information', 'youtube-embed' ); ?></th>
247
- <td><input type="checkbox" name="youtube_embed_info" value="1"<?php if ( $options[ 'info' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Display the video title and uploader before the video starts. If displaying a playlist this will show video thumbnails', 'youtube-embed' ); ?></span></td>
248
  </tr>
249
 
250
  <tr>
251
- <th scope="row"><?php _e( 'Related Videos', 'youtube-embed' ); ?></th>
252
- <td><input type="checkbox" name="youtube_embed_related" value="1"<?php if ( $options[ 'related' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Load related videos once playback starts. Also toggles the search option.', 'youtube-embed' ); ?></span></td>
 
 
 
253
  </tr>
 
 
 
 
254
 
 
255
  <tr>
256
- <th scope="row"><?php _e( 'Theme', 'youtube-embed' ); ?></th>
257
- <td><select name="youtube_embed_theme">
258
- <option value="dark"<?php if ( $options[ 'theme' ] == "dark" ) { echo " selected='selected'"; } ?>><?php _e( 'Dark', 'youtube-embed' ); ?></option>
259
- <option value="light"<?php if ( $options[ 'theme' ] == "light" ) { echo " selected='selected'"; } ?>><?php _e( 'Light', 'youtube-embed' ); ?></option>
260
- </select>&nbsp;<span class="description"><?php _e( 'Display player controls within a dark or light control bar', 'youtube-embed' ); ?></span></td>
261
  </tr>
262
 
263
  <tr>
264
- <th scope="row"><?php _e( 'Progress Bar Colour', 'youtube-embed' ); ?></th>
265
- <td><select name="youtube_embed_color">
266
- <option value="red"<?php if ( $options[ 'color' ] == "red" ) { echo " selected='selected'"; } ?>><?php _e( 'Red', 'youtube-embed' ); ?></option>
267
- <option value="white"<?php if ( $options[ 'color' ] == "white" ) { echo " selected='selected'"; } ?>><?php _e( 'White (desaturated)', 'youtube-embed' ); ?></option>
268
- </select>&nbsp;<span class="description"><?php _e( 'The colour that will be used in the player\'s video progress bar to highlight the amount of the video that\'s already been seen', 'youtube-embed' ); ?></span></td>
269
  </tr>
270
 
271
  <tr>
272
- <th scope="row"><?php _e( 'Modest Branding', 'youtube-embed' ); ?></th>
273
- <td><input type="checkbox" name="youtube_embed_modest" value="1"<?php if ( $options[ 'modest' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Reduce branding on video.', 'youtube-embed' ); ?></span></td>
274
  </tr>
275
 
276
- </table>
277
-
278
- <br/><span class="yt_heading"><?php _e( 'Options for AS3 Player', 'youtube-embed' ); ?></span>
279
- <br/><br/><?php __( 'The following options are not supported if using EmbedPlus or if the IFRAME player uses HTML5.' ); ?>
280
-
281
- <table class="form-table">
282
  <tr>
283
- <th scope="row"><?php _e( 'Annotations', 'youtube-embed' ); ?></th>
284
- <td><input type="checkbox" name="youtube_embed_annotation" value="1"<?php if ( $options[ 'annotation' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Video annotations are shown by default', 'youtube-embed' ); ?></span></td>
285
  </tr>
286
 
287
  <tr>
288
- <th scope="row"><?php _e( 'Closed Captions', 'youtube-embed' ); ?></th>
289
- <td><input type="checkbox" name="youtube_embed_cc" value="1"<?php if ( $options[ 'cc' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Show closed captions (subtitles) by default, even if the user has turned captions off', 'youtube-embed' ); ?></span></td>
290
  </tr>
291
 
292
  <tr>
293
- <th scope="row"><?php _e( 'Disable Keyboard', 'youtube-embed' ); ?></th>
294
- <td><input type="checkbox" name="youtube_embed_disablekb" value="1"<?php if ( $options[ 'disablekb' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Disable the player keyboard controls', 'youtube-embed' ); ?></span></td>
295
  </tr>
296
 
297
  <tr>
298
- <th scope="row"><?php _e( 'Fullscreen', 'youtube-embed' ); ?></th>
299
- <td><input type="checkbox" name="youtube_embed_fullscreen" value="1"<?php if ( $options[ 'fullscreen' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'A button will allow the viewer to watch the video fullscreen', 'youtube-embed' ); ?></span></td>
 
 
 
300
  </tr>
301
 
302
  <tr>
303
- <th scope="row"><?php _e( 'Link to YouTube', 'youtube-embed' ); ?></th>
304
- <td><input type="checkbox" name="youtube_embed_link" value="1"<?php if ( $options[ 'link' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Video links back to YouTube when clicked', 'youtube-embed' ); ?></span></td>
305
  </tr>
306
-
307
  </table>
308
 
309
- <br/><span class="yt_heading"><?php _e( 'Options Not Supported by HTML5 Player', 'youtube-embed' ); ?></span>
310
 
311
  <table class="form-table">
312
  <tr valign="top">
313
- <th scope="row"><?php _e( 'Window Mode', 'youtube-embed' ); ?></th>
314
  <td><select name="youtube_embed_wmode">
315
- <option value="opaque"<?php if ( $options[ 'wmode' ] == "opaque" ) { echo " selected='selected'"; } ?>><?php _e( 'Opaque', 'youtube-embed' ); ?></option>
316
- <option value="transparent"<?php if ( $options[ 'wmode' ] == "transparent" ) { echo " selected='selected'"; } ?>><?php _e( 'Transparent', 'youtube-embed' ); ?></option>
317
- <option value="window"<?php if ( $options[ 'wmode' ] == "window" ) { echo " selected='selected'"; } ?>><?php _e( 'Window', 'youtube-embed' ); ?></option>
318
- </select><span class="description"><?php _e( 'Sets the Window Mode property of the Flash movie for transparency, layering, and positioning in the browser. <a href="http://www.communitymx.com/content/article.cfm?cid=e5141">Learn more</a>.', 'youtube-embed' ); ?></span></td>
319
  </tr>
320
 
321
  </table>
322
 
323
- <br/><span class="yt_heading"><?php _e( 'Options Only Supported By EmbedPlus', 'youtube-embed' ); ?></span>&nbsp;&nbsp;<span class="description"><?php echo '<a href="http://www.artiss.co.uk/youtube-embed/further-help#ye-embedplus">' . __( 'Learn more about EmbedPlus', 'youtube-embed' ) . '</a>'; ?></span>
324
 
325
  <table class="form-table">
326
  <tr valign="top">
327
- <th scope="row"><?php _e( 'Fallback Embed Type', 'youtube-embed' ); ?></th>
328
- <td><span class="description"><?php _e( 'The type of player to use if Flash is not available and EmbedPlus cannot be used.', 'youtube-embed' ); ?></span><br/>
329
- <input type="radio" name="youtube_embed_fallback" value="v"<?php if ( $options[ 'fallback' ] == "v" ) { echo ' checked="checked"'; } ?>/>&nbsp;<?php _e( 'IFRAME', 'youtube-embed' ); ?><br/>
330
- <input type="radio" name="youtube_embed_fallback" value="p"<?php if ( $options[ 'fallback' ] == "p" ) { echo ' checked="checked"'; } ?>/>&nbsp;<?php _e( 'OBJECT', 'youtube-embed' ); ?></td>
331
  </tr>
332
 
333
  <tr>
334
- <th scope="row"><?php _e( 'Play HD', 'youtube-embed' ); ?></th>
335
- <td><input type="checkbox" name="youtube_embed_hd" value="1"<?php if ( $options[ 'hd' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Play the video in HD if possible', 'youtube-embed' ); ?></span></td>
336
  </tr>
337
 
338
  <tr>
339
- <th scope="row"><?php _e( 'Real-time Reactions', 'youtube-embed' ); ?></th>
340
- <td><input type="checkbox" name="youtube_embed_react" value="1"<?php if ( $options[ 'react' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Show the Real-time Reactions button', 'youtube-embed' ); ?></span></td>
341
  </tr>
342
 
343
  <tr>
344
- <th scope="row"><?php _e( 'Sweet Spots', 'youtube-embed' ); ?></th>
345
- <td><input type="checkbox" name="youtube_embed_sweetspot" value="1"<?php if ( $options[ 'sweetspot' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Find sweet spots for the next and previous buttons', 'youtube-embed' ); ?></span></td>
346
  </tr>
347
  </table>
348
 
349
  <?php wp_nonce_field( 'youtube-embed-profile', 'youtube_embed_profile_nonce', true, true ); ?>
350
 
351
- <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( 'Save Settings', 'youtube-embed' ); ?>"/></p>
352
 
353
  </form>
354
 
355
- <div class="updated fade"><p><strong><?php _e( 'Would you like the video below to be yours? <a href="http://www.artiss.co.uk/youtube-embed/further-help#ye-sponsorship">Click here</a> for sponsorship information.', 'youtube-embed' ); ?></strong></p></div>
356
-
357
- </div>
358
 
359
  <a href="#" name="video"></a>
360
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ).'/wp-admin/admin.php?page=aye-profile-options#video' ?>">
361
  <div class="ytbox_grey">
362
- <h3><?php _e( 'YouTube Video Sample', 'youtube-embed' ); ?></h3>
363
- <p><?php _e( 'The video below uses the above, saved profile settings. Use the drop-down below to change which parameters the video uses - press the Change Video button to update it.', 'youtube-embed' ); ?></p>
 
364
  <p><select name="youtube_embed_video_type">
365
- <option value="d"<?php if ( $video_type == "d" ) { echo " selected='selected'"; } ?>><?php _e( 'Standard', 'youtube-embed' ); ?></option>
366
- <option value="p"<?php if ( $video_type == "p" ) { echo " selected='selected'"; } ?>><?php _e( 'EmbedPlus', 'youtube-embed' ); ?></option>
367
- <option value="3"<?php if ( $video_type == "3" ) { echo " selected='selected'"; } ?>><?php _e( '3D', 'youtube-embed' ); ?></option>
368
- <option value="l"<?php if ( $video_type == "l" ) { echo " selected='selected'"; } ?>><?php _e( 'Playlist', 'youtube-embed' ); ?></option>
369
  </select>
370
  <?php wp_nonce_field( 'youtube-embed-profile', 'youtube_embed_profile_nonce', true, true ); ?>
371
- <input type="submit" name="Video" class="button-secondary" value="<?php _e( 'Change video', 'youtube-embed' ); ?>"/></p>
372
 
373
  <p><?php
374
- if ( $video_type == "d" ) { $id = 'dzn6xHxaCrw'; $type = ''; }
375
  if ( $video_type == "p" ) { $id = 'YVvn8dpSAt0'; $type = 'm'; }
376
  if ( $video_type == "3" ) { $id = 'NR5UoBY87GM'; $type = ''; ; }
377
  if ( $video_type == "l" ) { $id = '095393D5B42B2266'; $type = ''; }
8
  * @since 2.0
9
  */
10
  ?>
11
+ <div class="wrap" style="width: 1010px;">
 
 
12
 
13
  <div class="icon32"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/screen_icon.png" alt="" title="" height="32px" width="32px"/><br /></div>
14
 
15
+ <h2><?php _e( 'Artiss YouTube Embed Profiles' ); ?></h2><br/>
16
+
17
+ <div style="width: 990px; height: 220px; border: 1px solid #ddd; padding: 10px;">
18
+ <a href="http://themefuse.com/wp-themes-shop/?plugin=youtube-embed" target="_blank"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/themefuse_banner.jpg" alt="ThemeFuse.com - Premium WordPress Themes" title="ThemeFuse.com - Premium WordPress Themes" style="float: left; padding-right: 10px;"></a>
19
+ <h3>Donate</h3>
20
+ <p>If you like this plugin and appreciate the effort being put into it, <a href="http://www.artiss.co.uk/donate">please consider donating</a>. You can donate via PayPal or purchase something from my Amazon Wish List.</p>
21
+ <h3>Follow Me</h3>
22
+ <p>Please stay in touch with the latest news via one of the following social streams...</p>
23
+ <p align="center">
24
+ <a href="http://www.twitter.com/artiss_tech"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/Twitter.png" alt="Follow Artiss.co.uk on Twitter" title="Follow Artiss.co.uk on Twitter" style="margin-right: 20px;"></a>
25
+ <a href="http://www.facebook.com/artiss.co.uk"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/Facebook.png" alt="Follow Artiss.co.uk on Facebook" title="Follow Artiss.co.uk on Facebook" style="margin-right: 20px;"></a>
26
+ <a href="https://plus.google.com/108446415028687420620?rel=author"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/Google+.png" alt="Follow Artiss.co.uk on Google+" title="Follow Artiss.co.uk on Google+" style="margin-right: 20px;"></a>
27
+ <a href="http://www.artiss.co.uk/feed"><img src="<?php echo plugins_url(); ?>/youtube-embed/images/RSS.png" alt="Follow Artiss.co.uk on RSS feed" title="Follow Artiss.co.uk on RSS feed"></a>
28
+ </p>
29
+ </div><br/>
30
 
31
  <?php
 
32
  // Set current profile number
 
33
  if ( isset( $_POST[ 'youtube_embed_profile_no' ] ) ) { $profile_no = $_POST[ 'youtube_embed_profile_no' ]; } else { $profile_no = 0; }
34
  if ( $profile_no == '' ) { $profile_no = 0; }
35
 
36
  // If options have been updated on screen, update the database
 
37
  if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-profile' , 'youtube_embed_profile_nonce' ) ) ) {
38
 
39
+ if ( !empty( $_POST[ 'youtube_embed_name' ] ) ) { $options[ 'name' ] = $_POST[ 'youtube_embed_name' ]; }
40
+ if ( !empty( $_POST[ 'youtube_embed_type' ] ) ) { $options[ 'type' ] = $_POST[ 'youtube_embed_type' ]; }
41
+ if ( !empty( $_POST[ 'youtube_embed_playlist' ] ) ) { $options[ 'playlist' ] = $_POST[ 'youtube_embed_playlist' ]; }
42
  $options[ 'width' ] = $_POST[ 'youtube_embed_width' ];
43
+ $options[ 'height' ] = $_POST[ 'youtube_embed_height' ];
44
 
45
+ $options[ 'template' ] = htmlspecialchars_decode( $_POST[ 'youtube_embed_template' ] );
46
  if ( strpos( $options[ 'template' ], '%video%' ) === false ) { $options[ 'template' ] = '%video%'; }
47
 
48
+ $options[ 'style' ] = $_POST[ 'youtube_embed_style' ];
49
+ $options[ 'fullscreen' ] = $_POST[ 'youtube_embed_fullscreen' ];
50
+ $options[ 'autoplay'] = $_POST[ 'youtube_embed_autoplay' ];
51
+ $options[ 'loop'] = $_POST[ 'youtube_embed_loop' ];
52
+ $options[ 'cc'] = $_POST[ 'youtube_embed_cc' ];
53
+ $options[ 'annotation'] = $_POST[ 'youtube_embed_annotation' ];
54
+ $options[ 'related'] = $_POST[ 'youtube_embed_related' ];
55
+ $options[ 'info'] = $_POST[ 'youtube_embed_info' ];
56
+ $options[ 'link'] = $_POST[ 'youtube_embed_link' ];
57
+ $options[ 'react'] = $_POST[ 'youtube_embed_react' ];
58
+ $options[ 'sweetspot'] = $_POST[ 'youtube_embed_sweetspot' ];
59
+ $options[ 'disablekb'] = $_POST[ 'youtube_embed_disablekb' ];
60
+ if ( !empty( $_POST[ 'youtube_embed_autohide' ] ) ) { $options[ 'autohide'] = $_POST[ 'youtube_embed_autohide' ]; }
61
+ $options[ 'controls'] = $_POST[ 'youtube_embed_controls' ];
62
+ if ( !empty( $_POST[ 'youtube_embed_fallback' ] ) ) { $options[ 'fallback'] = $_POST[ 'youtube_embed_fallback' ]; }
63
+ if ( !empty( $_POST[ 'youtube_embed_wmode' ] ) ) { $options[ 'wmode'] = $_POST[ 'youtube_embed_wmode' ]; }
64
+ $options[ 'audio'] = $_POST[ 'youtube_embed_audio' ];
65
+ $options[ 'hd'] = $_POST[ 'youtube_embed_hd' ];
66
+ if ( !empty( $_POST[ 'youtube_embed_color' ] ) ) { $options[ 'color' ] = $_POST[ 'youtube_embed_color' ]; }
67
+ if ( !empty( $_POST[ 'youtube_embed_theme' ] ) ) { $options[ 'theme' ] = $_POST[ 'youtube_embed_theme' ]; }
68
+ $options[ 'https' ] = $_POST[ 'youtube_embed_https' ];
69
+ $options[ 'modest' ] = $_POST[ 'youtube_embed_modest' ];
70
+ $options[ 'dynamic' ] = $_POST[ 'youtube_embed_dynamic' ];
71
+ $options[ 'fixed' ] = $_POST[ 'youtube_embed_fixed' ];
72
+
73
+ if ( !empty( $_POST[ 'youtube_embed_size' ] ) ) { $default_size = $_POST[ 'youtube_embed_size' ]; }
 
74
 
75
  if ( $default_size !== '' ) {
76
  $options[ 'width' ] = ltrim( substr( $default_size, 0, 4 ), '0' );
77
  $options[ 'height'] = ltrim( substr( $default_size, -4, 4 ), '0' );
78
  }
79
 
80
+ // Set width or height, if missing
81
+
82
+ if ( ( $options[ 'width' ] == '' ) && ( $options[ 'height' ] == '' ) ) {
83
+ if ( isset( $GLOBALS[ 'content_width' ] ) ) {
84
+ $options[ 'width' ] = $GLOBALS[ 'content_width' ];
85
+ } else {
86
+ $options[ 'width' ] = 560;
87
+ }
88
+ $options[ 'height' ] = 27 + round( ( $options[ 'width' ] / 16 ) * 9, 0 );
89
+ }
90
+ if ( ( $options[ 'width' ] == '' ) && ( $options[ 'height' ] != '' ) ) {
91
+ $options[ 'width' ] = round( ( $options[ 'height' ] / 9 ) * 16, 0 );
92
+ }
93
+ if ( ( $options[ 'width' ] != '' ) && ( $options[ 'height' ] == '' ) ) {
94
+ $options[ 'height' ] = 27 + round( ( $options[ 'width' ] / 16 ) * 9, 0 );
95
+ }
96
 
97
  update_option( 'youtube_embed_profile' . $profile_no, $options );
98
  echo '<div class="updated fade"><p><strong>' . __( $options[ 'name' ].' Profile Saved.' ) . "</strong></p></div>\n";
101
  }
102
 
103
  // Video option button has been pressed
 
104
  if ( !empty( $_POST[ 'Video' ] ) ) { $video_type = $_POST[ 'youtube_embed_video_type' ]; } else { $video_type = 'd'; }
105
 
106
  // Fetch options into an array
 
107
  $options = aye_set_profile_defaults( $profile_no );
108
  $general = aye_set_general_defaults();
 
 
 
 
109
  ?>
110
 
 
 
111
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=aye-profile-options' ?>">
112
 
113
  <span class="alignright">
114
  <select name="youtube_embed_profile_no">
115
  <?php aye_generate_profile_list( $profile_no, $general[ 'profile_no' ] ) ?>
116
  </select>
117
+ <input type="submit" name="Profile" class="button-secondary" value="<?php _e('Change profile'); ?>"/>
118
  </span><br/>
119
 
120
  <?php
121
  if ( $profile_no == '0' ) {
122
+ _e( 'These are the options for the default profile.' );
123
  } else {
124
+ sprintf( _e( 'These are the options for profile %s.' ), $profile_no );
125
  }
126
+ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profiles.' );
127
  ?>
128
 
129
  <table class="form-table">
130
 
131
  <tr>
132
+ <th scope="row"><?php _e( 'Profile name' ); ?></th><td>
133
  <input type="text" size="20" name="youtube_embed_name" value="<?php echo $options[ 'name' ]; ?>"<?php if ( $profile_no == 0 ) { echo ' readonly="readonly"'; } ?>/>
134
+ <?php if ( $profile_no != 0 ) { echo '&nbsp;<span class="description">' . __( 'The name you wish to give this profile' ) . '</span>'; } ?>
135
  </td></tr>
136
 
137
  <tr valign="top">
138
+ <th scope="row"><?php _e( 'Video Embed Type' ); ?></th>
139
+ <td><span class="description"><?php _e( 'The type of player to use for videos.' ); ?></span><br/>
140
+ <input type="radio" name="youtube_embed_type" value="v"<?php if ( $options[ 'type' ] == "v" ) { echo ' checked="checked"'; } ?>/><?php echo '&nbsp;' . __( 'IFRAME' ); ?><span class="description"><?php echo '&nbsp;' . __( 'Uses HTML5, if available. Alternatively, uses AS3 Flash player. This is the current YouTube default..' ); ?></span><br/>
141
+ <input type="radio" name="youtube_embed_type" value="p"<?php if ( $options[ 'type' ] == "p" ) { echo ' checked="checked"'; } ?>/><?php echo '&nbsp;' . __( 'OBJECT' ); ?><span class="description"><?php echo '&nbsp;' . __( 'Use the AS3 Flash player.' ); ?></span><br/>
142
+ <input type="radio" name="youtube_embed_type" value="c"<?php if ( $options[ 'type' ] == "c" ) { echo ' checked="checked"'; } ?>/><?php echo '&nbsp;' . __( 'Chromeless' ); ?><span class="description"><?php echo '&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/>
143
+ <input type="radio" name="youtube_embed_type" value="m"<?php if ( $options[ 'type' ] == "m" ) { echo ' checked="checked"'; } ?>/><?php echo '&nbsp;' . __( 'EmbedPlus' ); ?><span class="description"><?php echo '&nbsp;' . __( 'Use <a href="http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-embedplus">EmbedPlus</a>, if Flash is available.' ); ?></span>
144
  </td>
145
  </tr>
146
 
147
  <tr valign="top">
148
+ <th scope="row"><?php _e( 'Playlist Embed Type' ); ?></th>
149
+ <td><span class="description"><?php _e( 'The type of player to use when showing playlists.' ); ?></span><br/>
150
+ <input type="radio" name="youtube_embed_playlist" value="v"<?php if ( $options[ 'playlist' ] == "v" ) { echo ' checked="checked"'; } ?>/><?php echo '&nbsp;' . __( 'IFRAME' ); ?><br/>
151
+ <input type="radio" name="youtube_embed_playlist" value="o"<?php if ( $options[ 'playlist' ] == "o" ) { echo ' checked="checked"'; } ?>/><?php echo '&nbsp;' . __( 'OBJECT' ); ?><br/>
152
  </td>
153
  </tr>
154
  </table>
155
 
156
+ <br/><span class="yt_heading"><?php _e( 'Options For All Player Types' ); ?></span>
157
 
158
  <table class="form-table">
159
  <tr>
160
+ <th scope="row"><?php _e( 'Template' ); ?></th>
161
+ <td><input type="text" size="40" name="youtube_embed_template" value="<?php echo htmlspecialchars( $options[ 'template' ] ); ?>"/>&nbsp;<span class="description">Wrapper for video output. Must include <code>%video%</code> tag to show video position</span></td>
162
  </tr>
163
 
164
  <tr>
165
+ <th scope="row"><?php _e( 'Style' ); ?></th>
166
+ <td><input type="text" size="40" name="youtube_embed_style" value="<?php echo htmlspecialchars( $options[ 'style' ] ); ?>"/>&nbsp;<span class="description">CSS elements to apply to video</span></td>
167
  </tr>
168
  </table>
169
 
170
  <table class="form-table ytbox_grey">
171
  <tr>
172
+ <th scope="row"><?php _e( 'Video size' ); ?></th>
173
+ <td><input type="text" size="3" maxlength="3" name="youtube_embed_width" value="<?php echo $options[ 'width' ]; ?>"/>&nbsp;x&nbsp;<input type="text" size="3" maxlength="3" name="youtube_embed_height" value="<?php echo $options[ 'height' ]; ?>"/>&nbsp;<span class="description"><?php _e( 'The width x height of the video, in pixels' ); ?></span></td>
174
  </tr>
175
 
176
  <tr valign="top">
177
+ <th scope="row"><?php _e( 'Default Sizes' ); ?></th>
178
  <td><select name="youtube_embed_size">
179
+ <option value=""<?php if ( $default_size == '' ) { echo " selected='selected'"; } ?>><?php _e( 'Use above sizes' ); ?></option>
180
  <option value="04800385"<?php if ( $default_size == "04800385" ) { echo " selected='selected'"; } ?>><?php echo '480x385 4:3'; ?></option>
181
  <option value="05600340"<?php if ( $default_size == "05600340" ) { echo " selected='selected'"; } ?>><?php echo '560x340 16:9'; ?></option>
182
  <option value="06400385"<?php if ( $default_size == "06400385" ) { echo " selected='selected'"; } ?>><?php echo '640x385 16:9'; ?></option>
183
  <option value="08530505"<?php if ( $default_size == "08530505" ) { echo " selected='selected'"; } ?>><?php echo '853x505 16:9'; ?></option>
184
  <option value="12800745"<?php if ( $default_size == "12800745" ) { echo " selected='selected'"; } ?>><?php echo '1280x745 16:9'; ?></option>
185
+ </select>&nbsp;<span class="description"><?php _e( 'Select one of these default sizes to override the above video sizes' ); ?></span></td>
186
  </tr>
187
 
188
  <tr>
189
+ <th scope="row"><?php _e( 'Dynamically Resize' ); ?></th>
190
+ <td><input type="checkbox" name="youtube_embed_dynamic" value="1"<?php if ( $options[ 'dynamic' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Show full width and resize with the browser' ); ?></span></td>
191
  </tr>
192
 
193
  <tr>
194
+ <th scope="row">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Set Maximum Size' ); ?></th>
195
+ <td><input type="checkbox" name="youtube_embed_fixed" value="1"<?php if ( $options[ 'fixed' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Use above width to define maximum size' ); ?></span></td>
196
  </tr>
197
  </table>
198
 
199
  <table class="form-table">
200
 
201
  <tr>
202
+ <th scope="row"><?php _e( 'Audio Only' ); ?></th>
203
+ <td><input type="checkbox" name="youtube_embed_audio" value="1"<?php if ( $options[ 'audio' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Only show the toolbar for audio only playback' ); ?></span></td>
204
  </tr>
205
 
206
  <tr>
207
+ <th scope="row"><?php _e( 'Autoplay' ); ?></th>
208
+ <td><input type="checkbox" name="youtube_embed_autoplay" value="1"<?php if ( $options[ 'autoplay' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'The video will start playing when the player loads' ); ?></span></td>
209
  </tr>
210
 
211
  </table>
212
 
213
+ <br/><span class="yt_heading"><?php _e( 'Options Not Supported by EmbedPlus' ); ?></span>
214
 
215
  <table class="form-table">
216
 
217
  <tr>
218
+ <th scope="row"><?php _e( 'Auto hide' ); ?></th>
219
  <td><select name="youtube_embed_autohide">
220
+ <option value="0"<?php if ( $options[ 'autohide' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls &amp; progress bar remain visible' ); ?></option>
221
+ <option value="1"<?php if ( $options[ 'autohide' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls &amp; progress bar fade out' ); ?></option>
222
+ <option value="2"<?php if ( $options[ 'autohide' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e( 'Progress bar fades' ); ?></option>
223
+ </select>&nbsp;<span class="description"><?php _e( 'Video controls will automatically hide after a video begins playing' ); ?></span></td>
224
  </tr>
225
 
226
  <tr>
227
+ <th scope="row"><?php _e( 'Controls' ); ?></th>
228
+ <td><input type="checkbox" name="youtube_embed_controls" value="1"<?php if ( $options[ 'controls' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Video player controls will display' ); ?></span></td>
 
 
 
 
229
  </tr>
230
 
231
  <tr>
232
+ <th scope="row"><?php _e( 'SSL' ); ?></th>
233
+ <td><input type="checkbox" name="youtube_embed_https" value="1"<?php if ( $options[ 'https' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Use SSL? <a href="http://www.google.com/support/youtube/bin/answer.py?answer=171780&expand=UseHTTPS#HTTPS">Read more</a>' ); ?></span></td>
234
  </tr>
235
 
236
  <tr>
237
+ <th scope="row"><?php _e( 'Loop Video' ); ?></th>
238
+ <td><input type="checkbox" name="youtube_embed_loop" value="1"<?php if ( $options[ 'loop' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Play the initial video again and again. In the case of a playlist, this will play the entire playlist and then start again at the first video' ); ?></span></td>
239
  </tr>
240
 
241
  <tr>
242
+ <th scope="row"><?php _e( 'Information' ); ?></th>
243
+ <td><input type="checkbox" name="youtube_embed_info" value="1"<?php if ( $options[ 'info' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Display the video title and uploader before the video starts' ); ?></span></td>
244
  </tr>
245
 
246
  <tr>
247
+ <th scope="row"><?php _e( 'Theme' ); ?></th>
248
+ <td><select name="youtube_embed_theme">
249
+ <option value="dark"<?php if ( $options[ 'theme' ] == "dark" ) { echo " selected='selected'"; } ?>><?php _e( 'Dark' ); ?></option>
250
+ <option value="light"<?php if ( $options[ 'theme' ] == "light" ) { echo " selected='selected'"; } ?>><?php _e( 'Light' ); ?></option>
251
+ </select>&nbsp;<span class="description"><?php _e( 'Display player controls within a dark or light control bar' ); ?></span></td>
252
  </tr>
253
+ </table>
254
+
255
+ <br/><span class="yt_heading"><?php _e( 'Options for AS3 Player' ); ?></span>
256
+ <br/><br/>The following options are not supported if using EmbedPlus or if the IFRAME player uses HTML5.
257
 
258
+ <table class="form-table">
259
  <tr>
260
+ <th scope="row"><?php _e( 'Annotations' ); ?></th>
261
+ <td><input type="checkbox" name="youtube_embed_annotation" value="1"<?php if ( $options[ 'annotation' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Video annotations are shown by default' ); ?></span></td>
 
 
 
262
  </tr>
263
 
264
  <tr>
265
+ <th scope="row"><?php _e( 'Closed Captions' ); ?></th>
266
+ <td><input type="checkbox" name="youtube_embed_cc" value="1"<?php if ( $options[ 'cc' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Show closed captions (subtitles) by default, even if the user has turned captions off' ); ?></span></td>
 
 
 
267
  </tr>
268
 
269
  <tr>
270
+ <th scope="row"><?php _e( 'Disable Keyboard' ); ?></th>
271
+ <td><input type="checkbox" name="youtube_embed_disablekb" value="1"<?php if ( $options[ 'disablekb' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Disable the player keyboard controls' ); ?></span></td>
272
  </tr>
273
 
 
 
 
 
 
 
274
  <tr>
275
+ <th scope="row"><?php _e( 'Fullscreen' ); ?></th>
276
+ <td><input type="checkbox" name="youtube_embed_fullscreen" value="1"<?php if ( $options[ 'fullscreen' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'A button will allow the viewer to watch the video fullscreen' ); ?></span></td>
277
  </tr>
278
 
279
  <tr>
280
+ <th scope="row"><?php _e( 'Link to YouTube' ); ?></th>
281
+ <td><input type="checkbox" name="youtube_embed_link" value="1"<?php if ( $options[ 'link' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Video links back to YouTube when clicked' ); ?></span></td>
282
  </tr>
283
 
284
  <tr>
285
+ <th scope="row"><?php _e( 'Modest Branding' ); ?></th>
286
+ <td><input type="checkbox" name="youtube_embed_modest" value="1"<?php if ( $options[ 'modest' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Reduce branding on video.' ); ?></span></td>
287
  </tr>
288
 
289
  <tr>
290
+ <th scope="row"><?php _e( 'Progress Bar Colour' ); ?></th>
291
+ <td><select name="youtube_embed_color">
292
+ <option value="red"<?php if ( $options[ 'color' ] == "red" ) { echo " selected='selected'"; } ?>><?php _e( 'Red' ); ?></option>
293
+ <option value="white"<?php if ( $options[ 'color' ] == "white" ) { echo " selected='selected'"; } ?>><?php _e( 'White (desaturated)' ); ?></option>
294
+ </select>&nbsp;<span class="description"><?php _e( 'The colour that will be used in the player\'s video progress bar to highlight the amount of the video that\'s already been seen' ); ?></span></td>
295
  </tr>
296
 
297
  <tr>
298
+ <th scope="row"><?php _e( 'Related Videos' ); ?></th>
299
+ <td><input type="checkbox" name="youtube_embed_related" value="1"<?php if ( $options[ 'related' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Load related videos once playback starts. Also toggles the search option.' ); ?></span></td>
300
  </tr>
 
301
  </table>
302
 
303
+ <br/><span class="yt_heading"><?php _e( 'Options Not Supported by HTML5 Player' ); ?></span>
304
 
305
  <table class="form-table">
306
  <tr valign="top">
307
+ <th scope="row"><?php _e( 'Window Mode' ); ?></th>
308
  <td><select name="youtube_embed_wmode">
309
+ <option value="opaque"<?php if ( $options[ 'wmode' ] == "opaque" ) { echo " selected='selected'"; } ?>><?php _e( 'Opaque' ); ?></option>
310
+ <option value="transparent"<?php if ( $options[ 'wmode' ] == "transparent" ) { echo " selected='selected'"; } ?>><?php _e( 'Transparent' ); ?></option>
311
+ <option value="window"<?php if ( $options[ 'wmode' ] == "window" ) { echo " selected='selected'"; } ?>><?php _e( 'Window' ); ?></option>
312
+ </select><span class="description"><?php _e( 'Sets the Window Mode property of the Flash movie for transparency, layering, and positioning in the browser. <a href="http://www.communitymx.com/content/article.cfm?cid=e5141">Learn more</a>.' ); ?></span></td>
313
  </tr>
314
 
315
  </table>
316
 
317
+ <br/><span class="yt_heading"><?php _e( 'Options Only Supported By EmbedPlus' ); ?></span>&nbsp;&nbsp;<span class="description"><?php echo '<a href="http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-embedplus">' . __( 'Learn more about EmbedPlus' ) . '</a>'; ?></span>
318
 
319
  <table class="form-table">
320
  <tr valign="top">
321
+ <th scope="row"><?php _e( 'Fallback Embed Type' ); ?></th>
322
+ <td><span class="description"><?php _e( 'The type of player to use if Flash is not available and EmbedPlus cannot be used.' ); ?></span><br/>
323
+ <input type="radio" name="youtube_embed_fallback" value="v"<?php if ( $options[ 'fallback' ] == "v" ) { echo ' checked="checked"'; } ?>/>&nbsp;<?php _e( 'IFRAME' ); ?><br/>
324
+ <input type="radio" name="youtube_embed_fallback" value="p"<?php if ( $options[ 'fallback' ] == "p" ) { echo ' checked="checked"'; } ?>/>&nbsp;<?php _e( 'OBJECT' ); ?></td>
325
  </tr>
326
 
327
  <tr>
328
+ <th scope="row"><?php _e( 'Play HD' ); ?></th>
329
+ <td><input type="checkbox" name="youtube_embed_hd" value="1"<?php if ( $options[ 'hd' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Play the video in HD if possible' ); ?></span></td>
330
  </tr>
331
 
332
  <tr>
333
+ <th scope="row"><?php _e( 'Real-time Reactions' ); ?></th>
334
+ <td><input type="checkbox" name="youtube_embed_react" value="1"<?php if ( $options[ 'react' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Show the Real-time Reactions button' ); ?></span></td>
335
  </tr>
336
 
337
  <tr>
338
+ <th scope="row"><?php _e( 'Sweet Spots' ); ?></th>
339
+ <td><input type="checkbox" name="youtube_embed_sweetspot" value="1"<?php if ( $options[ 'sweetspot' ] == "1" ) { echo ' checked="checked"'; } ?>/>&nbsp;<span class="description"><?php _e( 'Find sweet spots for the next and previous buttons' ); ?></span></td>
340
  </tr>
341
  </table>
342
 
343
  <?php wp_nonce_field( 'youtube-embed-profile', 'youtube_embed_profile_nonce', true, true ); ?>
344
 
345
+ <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( 'Save Settings' ); ?>"/></p>
346
 
347
  </form>
348
 
349
+ <div class="updated fade"><p><strong><?php _e( 'Would you like the video below to be yours? <a href="http://www.artiss.co.uk/contact">Contact me</a> for sponsorship information.' ); ?></strong></p></div>
 
 
350
 
351
  <a href="#" name="video"></a>
352
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ).'/wp-admin/admin.php?page=aye-profile-options#video' ?>">
353
  <div class="ytbox_grey">
354
+ <h3><?php _e( 'YouTube Video Sample' ); ?></h3>
355
+ <p><?php _e( 'This uses the above settings, once they have been saved. <b>Would you like this to be your video? If so, <a href="http://www.artiss.co.uk/contact">contact me</a>!</b>' ); ?></p>
356
+ <p><?php _e( 'Use the drop-down below to change which parameters the video uses - press the Change Video button to update it.' ); ?></p>
357
  <p><select name="youtube_embed_video_type">
358
+ <option value="d"<?php if ( $video_type == "d" ) { echo " selected='selected'"; } ?>><?php _e( 'Standard' ); ?></option>
359
+ <option value="p"<?php if ( $video_type == "p" ) { echo " selected='selected'"; } ?>><?php _e( 'EmbedPlus' ); ?></option>
360
+ <option value="3"<?php if ( $video_type == "3" ) { echo " selected='selected'"; } ?>><?php _e( '3D' ); ?></option>
361
+ <option value="l"<?php if ( $video_type == "l" ) { echo " selected='selected'"; } ?>><?php _e( 'Playlist' ); ?></option>
362
  </select>
363
  <?php wp_nonce_field( 'youtube-embed-profile', 'youtube_embed_profile_nonce', true, true ); ?>
364
+ <input type="submit" name="Video" class="button-secondary" value="<?php _e( 'Change video' ); ?>"/></p>
365
 
366
  <p><?php
367
+ if ( $video_type == "d" ) { $id = '-0Xa4bHcJu8'; $type = ''; }
368
  if ( $video_type == "p" ) { $id = 'YVvn8dpSAt0'; $type = 'm'; }
369
  if ( $video_type == "3" ) { $id = 'NR5UoBY87GM'; $type = ''; ; }
370
  if ( $video_type == "l" ) { $id = '095393D5B42B2266'; $type = ''; }
includes/aye-options-widgets.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // Set default options
4
 
5
- $default = array( 'titles' => 'YouTube', 'id' => '', 'profile' => '', 'type' => '', 'template' => '', 'style' => '', 'start' => '', 'autoplay' => '', 'width' => '', 'height' => '', 'dynamic' => '', 'list' => '', 'loop' => '', 'stop' => '', 'id_type' => 'v' );
6
  $instance = wp_parse_args( ( array ) $instance, $default );
7
  $general = aye_set_general_defaults();
8
 
@@ -10,13 +10,19 @@ $general = aye_set_general_defaults();
10
 
11
  $field_id = $this -> get_field_id( 'titles' );
12
  $field_name = $this -> get_field_name( 'titles' );
13
- echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Widget Title', 'youtube-embed' ) . ': </label><input type="text" class="widefat" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'titles' ] ).'" /></p>';
 
 
 
 
 
 
14
 
15
  // Video ID field
16
 
17
  $field_id = $this -> get_field_id( 'id' );
18
  $field_name = $this -> get_field_name( 'id' );
19
- echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Video ID', 'youtube-embed' ) . ': </label><input type="text" class="widefat" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'id' ] ) . '" /></p>';
20
 
21
  echo "<table>\n";
22
 
@@ -24,13 +30,13 @@ echo "<table>\n";
24
 
25
  $field_id = $this -> get_field_id( 'id_type' );
26
  $field_name = $this -> get_field_name( 'id_type' );
27
- echo "\r\n" . '<tr><td width="100%">' . __( 'ID Type', 'youtube-embed' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value="v"';
28
  if ( attribute_escape( $instance[ 'id_type' ] ) == 'v' ) { echo " selected='selected'"; }
29
- echo '>' . __( 'Video or Playlist', 'youtube-embed' ) . '</option><option value="s"';
30
  if ( attribute_escape( $instance[ 'id_type' ] ) == 's' ) { echo " selected='selected'"; }
31
- echo '>' . __( 'Search', 'youtube-embed' ) . '</option><option value="u"';
32
  if ( attribute_escape( $instance[ 'id_type' ] ) == 'u' ) { echo " selected='selected'"; }
33
- echo '>' . __( 'User', 'youtube-embed' ) . '</option></select></td></tr>';
34
 
35
  echo "</table>\n";
36
 
@@ -38,7 +44,7 @@ echo "</table>\n";
38
 
39
  $field_id = $this -> get_field_id( 'profile' );
40
  $field_name = $this -> get_field_name( 'profile' );
41
- echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Profile', 'youtube-embed' ) . ': </label><select name="' . $field_name . '" class="widefat" id="' . $field_id . '">';
42
  aye_generate_profile_list( attribute_escape( $instance[ 'profile' ] ), $general[ 'profile_no' ] );
43
  echo '</select></p>';
44
 
@@ -46,19 +52,19 @@ echo '</select></p>';
46
 
47
  $field_id = $this -> get_field_id( 'template' );
48
  $field_name = $this -> get_field_name( 'template' );
49
- echo "\r\n" . '<p><label for="' . $field_id . '">'.__( 'Template', 'youtube-embed' ).': </label><input type="text" class="widefat" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'template' ] ) . '" /></p>';
50
 
51
  // Style
52
 
53
  $field_id = $this -> get_field_id( 'style' );
54
  $field_name = $this -> get_field_name( 'style' );
55
- echo "\r\n" . '<p><label for="' . $field_id . '">'.__( 'Style', 'youtube-embed' ).': </label><input type="text" class="widefat" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'style' ] ) . '" /></p>';
56
 
57
  // Size fields
58
 
59
  $field_id = $this -> get_field_id( 'width' );
60
  $field_name = $this -> get_field_name( 'width' );
61
- echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Size', 'youtube-embed' ) . ': </label><input type="text" size="3" maxlength="3" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'width' ] ) . '" />&nbsp;x&nbsp;';
62
 
63
  $field_id = $this -> get_field_id( 'height' );
64
  $field_name = $this -> get_field_name( 'height' );
@@ -70,58 +76,58 @@ echo "<table>\n";
70
 
71
  $field_id = $this -> get_field_id( 'dynamic' );
72
  $field_name = $this -> get_field_name( 'dynamic' );
73
- echo "\r\n" . '<tr><td width="100%">' . __( 'Dynamically Resize', 'youtube-embed' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value=""';
74
  if ( attribute_escape( $instance[ 'dynamic' ] ) == '' ) { echo " selected='selected'"; }
75
- echo '>' . __( 'Profile default', 'youtube-embed' ) . '</option><option value="0"';
76
  if ( attribute_escape( $instance[ 'dynamic' ] ) == '0' ) { echo " selected='selected'"; }
77
- echo '>' . __( 'No', 'youtube-embed' ) . '</option><option value="1"';
78
  if ( attribute_escape( $instance[ 'dynamic' ] ) == '1' ) { echo " selected='selected'"; }
79
- echo '>' . __( 'Yes', 'youtube-embed' ) . '</option></select></td></tr>';
80
 
81
  // Embed type field
82
 
83
  $field_id = $this -> get_field_id( 'type' );
84
  $field_name = $this -> get_field_name( 'type' );
85
- echo "\r\n" . '<tr><td width="100%">' . __( 'Embed Type', 'youtube-embed' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value=""';
86
  if ( attribute_escape( $instance[ 'type' ] ) == '' ) { echo " selected='selected'"; }
87
- echo '>' . __( 'Profile default', 'youtube-embed' ) . '</option><option value="v"';
88
  if ( attribute_escape( $instance[ 'type' ] ) == 'v' ) { echo " selected='selected'"; }
89
- echo '>' . __( 'IFRAME', 'youtube-embed' ) . '</option><option value="p"';
90
  if ( attribute_escape( $instance[ 'type' ] ) == 'p' ) { echo " selected='selected'"; }
91
- echo '>' . __( 'OBJECT', 'youtube-embed' ) . '</option><option value="m"';
92
  if ( attribute_escape( $instance[ 'type' ] ) == 'c' ) { echo " selected='selected'"; }
93
- echo '>' . __( 'Chromeless', 'youtube-embed' ) . '</option><option value="c"';
94
  if ( attribute_escape( $instance[ 'type' ] ) == 'm' ) { echo " selected='selected'"; }
95
- echo '>' . __( 'EmbedPlus', 'youtube-embed' ) . '</option></select></td></tr>';
96
 
97
  // Autoplay field
98
 
99
  $field_id = $this -> get_field_id( 'autoplay' );
100
  $field_name = $this -> get_field_name( 'autoplay' );
101
- echo "\r\n" . '<tr><td width="100%">' . __( 'Autoplay', 'youtube-embed' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value=""';
102
  if ( attribute_escape( $instance[ 'autoplay' ] ) == '' ) { echo " selected='selected'"; }
103
- echo '>' . __( 'Profile default', 'youtube-embed' ) . '</option><option value="0"';
104
  if ( attribute_escape( $instance[ 'autoplay' ] ) == '0' ) { echo " selected='selected'"; }
105
- echo '>' . __( 'No', 'youtube-embed' ) . '</option><option value="1"';
106
  if ( attribute_escape( $instance[ 'autoplay' ] ) == '1' ) { echo " selected='selected'"; }
107
- echo '>' . __( 'Yes', 'youtube-embed' ) . '</option></select></td></tr>';
108
 
109
  // Start field
110
 
111
  $field_id = $this -> get_field_id( 'start' );
112
  $field_name = $this -> get_field_name( 'start' );
113
- echo "\r\n" . '<tr><td width="100%">' . __( 'Start (seconds)', 'youtube-embed' ) . '</td><td><input type="text" size="3" maxlength="3" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'start' ] ) . '" /></td></tr>';
114
 
115
  // Stop field
116
 
117
  $field_id = $this -> get_field_id( 'stop' );
118
  $field_name = $this -> get_field_name( 'stop' );
119
- echo "\r\n" . '<tr><td width="100%">' . __( 'Stop (seconds)', 'youtube-embed' ) . '</td><td><input type="text" size="3" maxlength="3" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'stop' ] ) . '" /></td></tr>';
120
 
121
  echo "</table>\n";
122
 
123
  ?>
124
- <h4><?php _e( 'Non-EmbedPlus Options', 'youtube-embed' ); ?></h4>
125
  <?php
126
 
127
  echo "<table>\n";
@@ -130,27 +136,27 @@ echo "<table>\n";
130
 
131
  $field_id = $this -> get_field_id( 'list' );
132
  $field_name = $this -> get_field_name( 'list' );
133
- echo "\r\n" . '<tr><td width="100%">' . __( 'List Playback', 'youtube-embed' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value=""';
134
  if ( attribute_escape( $instance[ 'list' ] ) == '' ) { echo " selected='selected'"; }
135
- echo '>' . __( 'Profile default', 'youtube-embed' ) . '</option><option value="order"';
136
  if ( attribute_escape( $instance[ 'list' ] ) == 'order' ) { echo " selected='selected'"; }
137
- echo '>' . __( 'Play each video in order', 'youtube-embed' ) . '</option><option value="random"';
138
  if ( attribute_escape( $instance[ 'list' ] ) == 'random' ) { echo " selected='selected'"; }
139
- echo '>' . __( 'Play videos randomly', 'youtube-embed' ) . '</option><option value="single"';
140
  if ( attribute_escape( $instance[ 'list' ] ) == 'single' ) { echo " selected='selected'"; }
141
- echo '>' . __( 'Play one random video', 'youtube-embed' ) . '</option></select></td></tr>';
142
 
143
  // Loop video field
144
 
145
  $field_id = $this -> get_field_id( 'loop' );
146
  $field_name = $this -> get_field_name( 'loop' );
147
- echo "\r\n" . '<tr><td width="100%">' . __( 'Loop Video', 'youtube-embed' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value=""';
148
  if ( attribute_escape( $instance[ 'loop' ] ) == '' ) { echo " selected='selected'"; }
149
- echo '>' . __( 'Profile default', 'youtube-embed' ) . '</option><option value="0"';
150
  if ( attribute_escape( $instance[ 'loop' ] ) == '0' ) { echo " selected='selected'"; }
151
- echo '>' . __( 'No', 'youtube-embed' ) . '</option><option value="1"';
152
  if ( attribute_escape( $instance[ 'loop' ] ) == '1' ) { echo " selected='selected'"; }
153
- echo '>' . __( 'Yes', 'youtube-embed' ) . '</option></select></td></tr>';
154
 
155
  echo "</table>\n";
156
  ?>
2
 
3
  // Set default options
4
 
5
+ $default = array( 'titles' => 'YouTube', 'video_title' => '', 'id' => '', 'profile' => '', 'type' => '', 'template' => '', 'style' => '', 'start' => '', 'autoplay' => '', 'width' => '', 'height' => '', 'dynamic' => '', 'list' => '', 'loop' => '', 'stop' => '', 'id_type' => '' );
6
  $instance = wp_parse_args( ( array ) $instance, $default );
7
  $general = aye_set_general_defaults();
8
 
10
 
11
  $field_id = $this -> get_field_id( 'titles' );
12
  $field_name = $this -> get_field_name( 'titles' );
13
+ echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Widget Title' ) . ': </label><input type="text" class="widefat" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'titles' ] ).'" /></p>';
14
+
15
+ // Video Title field
16
+
17
+ $field_id = $this -> get_field_id( 'video_title' );
18
+ $field_name = $this -> get_field_name( 'video_title' );
19
+ echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Video Title' ) . ': </label><input type="text" class="widefat" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'video_title' ] ).'" /></p>';
20
 
21
  // Video ID field
22
 
23
  $field_id = $this -> get_field_id( 'id' );
24
  $field_name = $this -> get_field_name( 'id' );
25
+ echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Video ID' ) . ': </label><input type="text" class="widefat" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'id' ] ) . '" /></p>';
26
 
27
  echo "<table>\n";
28
 
30
 
31
  $field_id = $this -> get_field_id( 'id_type' );
32
  $field_name = $this -> get_field_name( 'id_type' );
33
+ echo "\r\n" . '<tr><td width="100%">' . __( 'ID Type' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value="v"';
34
  if ( attribute_escape( $instance[ 'id_type' ] ) == 'v' ) { echo " selected='selected'"; }
35
+ echo '>' . __( 'Video or Playlist' ) . '</option><option value="s"';
36
  if ( attribute_escape( $instance[ 'id_type' ] ) == 's' ) { echo " selected='selected'"; }
37
+ echo '>' . __( 'Search' ) . '</option><option value="u"';
38
  if ( attribute_escape( $instance[ 'id_type' ] ) == 'u' ) { echo " selected='selected'"; }
39
+ echo '>' . __( 'User' ) . '</option></select></td></tr>';
40
 
41
  echo "</table>\n";
42
 
44
 
45
  $field_id = $this -> get_field_id( 'profile' );
46
  $field_name = $this -> get_field_name( 'profile' );
47
+ echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Profile' ) . ': </label><select name="' . $field_name . '" class="widefat" id="' . $field_id . '">';
48
  aye_generate_profile_list( attribute_escape( $instance[ 'profile' ] ), $general[ 'profile_no' ] );
49
  echo '</select></p>';
50
 
52
 
53
  $field_id = $this -> get_field_id( 'template' );
54
  $field_name = $this -> get_field_name( 'template' );
55
+ echo "\r\n" . '<p><label for="' . $field_id . '">'.__( 'Template' ).': </label><input type="text" class="widefat" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'template' ] ) . '" /></p>';
56
 
57
  // Style
58
 
59
  $field_id = $this -> get_field_id( 'style' );
60
  $field_name = $this -> get_field_name( 'style' );
61
+ echo "\r\n" . '<p><label for="' . $field_id . '">'.__( 'Style' ).': </label><input type="text" class="widefat" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'style' ] ) . '" /></p>';
62
 
63
  // Size fields
64
 
65
  $field_id = $this -> get_field_id( 'width' );
66
  $field_name = $this -> get_field_name( 'width' );
67
+ echo "\r\n" . '<p><label for="' . $field_id . '">' . __( 'Size' ) . ': </label><input type="text" size="3" maxlength="3" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'width' ] ) . '" />&nbsp;x&nbsp;';
68
 
69
  $field_id = $this -> get_field_id( 'height' );
70
  $field_name = $this -> get_field_name( 'height' );
76
 
77
  $field_id = $this -> get_field_id( 'dynamic' );
78
  $field_name = $this -> get_field_name( 'dynamic' );
79
+ echo "\r\n" . '<tr><td width="100%">' . __( 'Dynamically Resize' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value=""';
80
  if ( attribute_escape( $instance[ 'dynamic' ] ) == '' ) { echo " selected='selected'"; }
81
+ echo '>' . __( 'Profile default' ) . '</option><option value="0"';
82
  if ( attribute_escape( $instance[ 'dynamic' ] ) == '0' ) { echo " selected='selected'"; }
83
+ echo '>' . __( 'No' ) . '</option><option value="1"';
84
  if ( attribute_escape( $instance[ 'dynamic' ] ) == '1' ) { echo " selected='selected'"; }
85
+ echo '>' . __( 'Yes' ) . '</option></select></td></tr>';
86
 
87
  // Embed type field
88
 
89
  $field_id = $this -> get_field_id( 'type' );
90
  $field_name = $this -> get_field_name( 'type' );
91
+ echo "\r\n" . '<tr><td width="100%">' . __( 'Embed Type' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value=""';
92
  if ( attribute_escape( $instance[ 'type' ] ) == '' ) { echo " selected='selected'"; }
93
+ echo '>' . __( 'Profile default' ) . '</option><option value="v"';
94
  if ( attribute_escape( $instance[ 'type' ] ) == 'v' ) { echo " selected='selected'"; }
95
+ echo '>' . __( 'IFRAME' ) . '</option><option value="p"';
96
  if ( attribute_escape( $instance[ 'type' ] ) == 'p' ) { echo " selected='selected'"; }
97
+ echo '>' . __( 'OBJECT' ) . '</option><option value="m"';
98
  if ( attribute_escape( $instance[ 'type' ] ) == 'c' ) { echo " selected='selected'"; }
99
+ echo '>' . __( 'Chromeless' ) . '</option><option value="c"';
100
  if ( attribute_escape( $instance[ 'type' ] ) == 'm' ) { echo " selected='selected'"; }
101
+ echo '>' . __( 'EmbedPlus' ) . '</option></select></td></tr>';
102
 
103
  // Autoplay field
104
 
105
  $field_id = $this -> get_field_id( 'autoplay' );
106
  $field_name = $this -> get_field_name( 'autoplay' );
107
+ echo "\r\n" . '<tr><td width="100%">' . __( 'Autoplay' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value=""';
108
  if ( attribute_escape( $instance[ 'autoplay' ] ) == '' ) { echo " selected='selected'"; }
109
+ echo '>' . __( 'Profile default' ) . '</option><option value="0"';
110
  if ( attribute_escape( $instance[ 'autoplay' ] ) == '0' ) { echo " selected='selected'"; }
111
+ echo '>' . __( 'No' ) . '</option><option value="1"';
112
  if ( attribute_escape( $instance[ 'autoplay' ] ) == '1' ) { echo " selected='selected'"; }
113
+ echo '>' . __( 'Yes' ) . '</option></select></td></tr>';
114
 
115
  // Start field
116
 
117
  $field_id = $this -> get_field_id( 'start' );
118
  $field_name = $this -> get_field_name( 'start' );
119
+ echo "\r\n" . '<tr><td width="100%">' . __( 'Start (seconds)' ) . '</td><td><input type="text" size="3" maxlength="3" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'start' ] ) . '" /></td></tr>';
120
 
121
  // Stop field
122
 
123
  $field_id = $this -> get_field_id( 'stop' );
124
  $field_name = $this -> get_field_name( 'stop' );
125
+ echo "\r\n" . '<tr><td width="100%">' . __( 'Stop (seconds)' ) . '</td><td><input type="text" size="3" maxlength="3" id="' . $field_id . '" name="' . $field_name . '" value="' . attribute_escape( $instance[ 'stop' ] ) . '" /></td></tr>';
126
 
127
  echo "</table>\n";
128
 
129
  ?>
130
+ <h4><?php _e( 'Non-EmbedPlus Options' ); ?></h4>
131
  <?php
132
 
133
  echo "<table>\n";
136
 
137
  $field_id = $this -> get_field_id( 'list' );
138
  $field_name = $this -> get_field_name( 'list' );
139
+ echo "\r\n" . '<tr><td width="100%">' . __( 'List Playback' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value=""';
140
  if ( attribute_escape( $instance[ 'list' ] ) == '' ) { echo " selected='selected'"; }
141
+ echo '>' . __( 'Profile default' ) . '</option><option value="order"';
142
  if ( attribute_escape( $instance[ 'list' ] ) == 'order' ) { echo " selected='selected'"; }
143
+ echo '>' . __( 'Play each video in order' ) . '</option><option value="random"';
144
  if ( attribute_escape( $instance[ 'list' ] ) == 'random' ) { echo " selected='selected'"; }
145
+ echo '>' . __( 'Play videos randomly' ) . '</option><option value="single"';
146
  if ( attribute_escape( $instance[ 'list' ] ) == 'single' ) { echo " selected='selected'"; }
147
+ echo '>' . __( 'Play one random video' ) . '</option></select></td></tr>';
148
 
149
  // Loop video field
150
 
151
  $field_id = $this -> get_field_id( 'loop' );
152
  $field_name = $this -> get_field_name( 'loop' );
153
+ echo "\r\n" . '<tr><td width="100%">' . __( 'Loop Video' ) . '</td><td><select name="' . $field_name . '" id="' . $field_id . '"><option value=""';
154
  if ( attribute_escape( $instance[ 'loop' ] ) == '' ) { echo " selected='selected'"; }
155
+ echo '>' . __( 'Profile default' ) . '</option><option value="0"';
156
  if ( attribute_escape( $instance[ 'loop' ] ) == '0' ) { echo " selected='selected'"; }
157
+ echo '>' . __( 'No' ) . '</option><option value="1"';
158
  if ( attribute_escape( $instance[ 'loop' ] ) == '1' ) { echo " selected='selected'"; }
159
+ echo '>' . __( 'Yes' ) . '</option></select></td></tr>';
160
 
161
  echo "</table>\n";
162
  ?>
includes/aye-set-defaults.php CHANGED
@@ -7,14 +7,6 @@
7
  * @package Artiss-YouTube-Embed
8
  */
9
 
10
- /**
11
- * Set Default Options
12
- *
13
- * Set up default values for the various options
14
- *
15
- * @package Artiss-YouTube-Embed
16
- */
17
-
18
  /**
19
  * Function to set Shortcode option
20
  *
@@ -61,31 +53,6 @@ function aye_set_url_option() {
61
  return $url;
62
  }
63
 
64
- /**
65
- * Function to set editor button shortcode
66
- *
67
- * Looks up editor button shortcode - sets it if not set-up
68
- * Ensures matching cookie is in place
69
- *
70
- * @since 2.6
71
- *
72
- * @return string Editor shortcode
73
- */
74
-
75
- function aye_set_editor_sc() {
76
-
77
- $editor_sc = get_option( 'youtube_embed_editor_sc' );
78
-
79
- // If setting doesn't exist, set defaults
80
-
81
- if ( $editor_sc == '' ) { update_option( 'youtube_embed_editor_sc', 'youtube' ); }
82
-
83
- // Return the shortcode
84
-
85
- return $editor_sc;
86
- }
87
-
88
-
89
  /**
90
  * Function to set general YouTube options
91
  *
@@ -97,34 +64,32 @@ function aye_set_editor_sc() {
97
  */
98
 
99
  function aye_set_general_defaults() {
100
-
101
  $options = get_option( 'youtube_embed_general' );
102
  $changed = false;
103
- $default_error = '<p>' . __( 'The video cannot be shown at the moment. Please try again later.', 'youtube-embed' ) . '</p>';
104
-
105
- // If the old options exist, import them and then delete them
106
 
107
  if ( !is_array( $options ) ) {
108
  if ( get_option( 'youtube_embed_editor' ) ) {
 
109
  $old_opts = get_option( 'youtube_embed_editor' );
110
  $options[ 'editor_button' ] = $old_opts[ 'youtube' ];
111
  delete_option( 'youtube_embed_editor' );
112
  $changed = true;
113
  } else {
114
- $options = array();
 
 
115
  }
116
  }
117
 
118
- // Set current version level. Because this can be used to detect version changes (and to what extent), this information may be useful in future upgrades
119
-
120
  if ( $options[ 'current_version' ] != youtube_embed_version ) {
121
  $options[ 'current_version' ] = youtube_embed_version;
122
  $changed = true;
123
  }
124
 
125
  // Because of upgrading, check each option - if not set, apply default
126
-
127
- if ( !array_key_exists( 'donated', $options ) ) { $options[ 'donated' ] = ''; $changed = true; }
128
  if ( !array_key_exists( 'editor_button', $options ) ) { $options[ 'editor_button' ] = 1; $changed = true; }
129
  if ( !array_key_exists( 'admin_bar', $options ) ) { $options[ 'admin_bar' ] = 1; $changed = true; }
130
  if ( !array_key_exists( 'profile_no', $options ) ) { $options[ 'profile_no' ] = 5; $changed = true; }
@@ -134,24 +99,16 @@ function aye_set_general_defaults() {
134
  if ( !array_key_exists( 'transcript_cache', $options ) ) { $options[ 'transcript_cache' ] = 24; $changed = true; }
135
  if ( !array_key_exists( 'alt_profile', $options ) ) { $options[ 'alt_profile' ] = 0; $changed = true; }
136
  if ( !array_key_exists( 'alt_profile2', $options ) ) { $options[ 'alt_profile2' ] = 0; $changed = true; }
137
- if ( !array_key_exists( 'bracket', $options ) ) { $options[ 'bracket' ] = ''; $changed = true; }
138
- if ( !array_key_exists( 'alt', $options ) ) { $options[ 'alt' ] = 0; $changed = true; }
139
  if ( !array_key_exists( 'other_profile', $options ) ) { $options[ 'other_profile' ] = 0; $changed = true; }
140
- if ( !array_key_exists( 'comments', $options ) ) { $options[ 'comments' ] = ''; $changed = true; }
141
  if ( !array_key_exists( 'comments_profile', $options ) ) { $options[ 'comments_profile' ] = 0; $changed = true; }
142
  if ( !array_key_exists( 'metadata', $options ) ) { $options[ 'metadata' ] = 1; $changed = true; }
143
  if ( !array_key_exists( 'feed', $options ) ) { $options[ 'feed' ] = 'b'; $changed = true; }
144
  if ( !array_key_exists( 'api', $options ) ) { $options[ 'api' ] = 1; $changed = true; }
145
  if ( !array_key_exists( 'error_message', $options ) ) { $options[ 'error_message' ] = $default_error; $changed = true; }
146
  if ( !array_key_exists( 'thumbnail', $options ) ) { $options[ 'thumbnail' ] = 2; $changed = true; }
147
- if ( !array_key_exists( 'privacy', $options ) ) { $options[ 'privacy' ] = 0; $changed = true; }
148
  if ( !array_key_exists( 'frameborder', $options ) ) { $options[ 'frameborder' ] = 1; $changed = true; }
149
- if ( !array_key_exists( 'widgets', $options ) ) { $options[ 'widgets' ] = 0; $changed = true; }
150
- if ( !array_key_exists( 'profile_access', $options ) ) { $options[ 'profile_access' ] = 'delete_plugins'; $changed = true; }
151
- if ( !array_key_exists( 'list_access', $options ) ) { $options[ 'list_access' ] = 'delete_plugins'; $changed = true; }
152
 
153
  // Update the options, if changed, and return the result
154
-
155
  if ( $changed ) { update_option( 'youtube_embed_general', $options ); }
156
  return $options;
157
  }
@@ -169,83 +126,69 @@ function aye_set_general_defaults() {
169
  */
170
 
171
  function aye_set_profile_defaults( $profile ) {
172
-
173
  if ( $profile == 0 ) {
174
  $profname = 'Default';
175
  } else {
176
  $profname = 'Profile ' . $profile;
177
  }
178
  $options = get_option( 'youtube_embed_profile' . $profile );
179
-
180
  $changed = false;
181
  $new_user = false;
182
 
183
  // Work out default dimensions
184
-
185
- $width = 0;
186
- if ( isset( $content_width ) ) { $width = $content_width; }
187
- if ( ( $width == 0 ) or ( $width == '' ) ) { $width = 560; }
188
- $height = 25 + round( ( $width / 16 ) * 9, 0 );
189
-
190
- // If the old options exist, import them and then delete them
191
 
192
  if ( !is_array( $options ) ) {
193
  if ( ( $profile == 0 ) && ( get_option( 'youtube_embed' ) ) ) {
 
194
  $old_opts = get_option( 'youtube_embed' );
195
  $options = $old_opts;
196
  delete_option( 'youtube_embed' );
197
  $changed = true;
198
  } else {
199
- $options = array();
 
 
200
  }
201
  }
202
 
203
  // Because of upgrading, check each option - if not set, apply default
204
-
205
  if ( !array_key_exists( 'name', $options ) ) { $options[ 'name' ] = $profname; $changed = true; }
206
-
207
  if ( !array_key_exists( 'width', $options ) ) {
208
- $options[ 'width' ] = $width;
209
  $options[ 'height' ] = $height;
210
  $changed = true;
211
  }
212
- if ( !array_key_exists( 'height', $options ) ) { $options[ 'height' ] = 340; $changed = true; }
213
- if ( !array_key_exists( 'fullscreen', $options ) ) { $options[ 'fullscreen' ] = ''; $changed = true; }
214
- if ( !array_key_exists( 'template', $options ) ) { $options[ 'template' ] = '%video%'; $changed = true; }
215
- if ( !array_key_exists( 'autoplay', $options ) ) { $options[ 'autoplay' ] = ''; $changed = true; }
216
- if ( !array_key_exists( 'start', $options ) ) { $options[ 'start' ] = 0; $changed = true; }
217
- if ( !array_key_exists( 'loop', $options ) ) { $options[ 'loop' ] = ''; $changed = true; }
218
- if ( !array_key_exists( 'cc', $options ) ) { $options[ 'cc' ] = ''; $changed = true; }
219
- if ( !array_key_exists( 'annotation', $options ) ) { $options[ 'annotation' ] = 1; $changed = true; }
220
- if ( !array_key_exists( 'related', $options ) ) { $options[ 'related' ] = ''; $changed = true; }
221
- if ( !array_key_exists( 'info', $options ) ) { $options[ 'info' ] = 1; $changed = true; }
222
- if ( !array_key_exists( 'link', $options ) ) { $options[ 'link' ] = 1; $changed = true; }
223
- if ( !array_key_exists( 'react', $options ) ) { $options[ 'react' ] = 1; $changed = true; }
224
- if ( !array_key_exists( 'stop', $options ) ) { $options[ 'stop' ] = 0; $changed = true; }
225
- if ( !array_key_exists( 'sweetspot', $options ) ) { $options[ 'sweetspot' ] = 1; $changed = true; }
226
  if ( !array_key_exists( 'type', $options ) ) { $options[ 'type' ] = 'v'; $changed = true; }
227
- if ( !array_key_exists( 'disablekb', $options ) ) { $options[ 'disablekb' ] = ''; $changed = true; }
228
- if ( !array_key_exists( 'autohide', $options ) ) { $options[ 'autohide' ] = 2; $changed = true; }
229
- if ( !array_key_exists( 'controls', $options ) ) { $options[ 'controls' ] = 1; $changed = true; }
 
 
230
  if ( !array_key_exists( 'playlist', $options ) ) { $options[ 'playlist' ] = 'v'; $changed = true; }
231
  if ( !array_key_exists( 'fallback', $options ) ) { $options[ 'fallback' ] = 'v'; $changed = true; }
232
  if ( !array_key_exists( 'wmode', $options ) ) { $options[ 'wmode' ] = 'window'; $changed = true; }
233
- if ( !array_key_exists( 'audio', $options ) ) { $options[ 'audio' ] = ''; $changed = true; }
234
- if ( !array_key_exists( 'hd', $options ) ) { $options[ 'hd' ] = 1; $changed = true; }
235
- if ( !array_key_exists( 'style', $options ) ) { $options[ 'style' ] = ''; $changed = true; }
236
  if ( !array_key_exists( 'color', $options ) ) { $options[ 'color' ] = 'red'; $changed = true; }
237
  if ( !array_key_exists( 'theme', $options ) ) { $options[ 'theme' ] = 'dark'; $changed = true; }
238
- if ( !array_key_exists( 'https', $options ) ) { $options[ 'https' ] = 0; $changed = true; }
239
  if ( !array_key_exists( 'modest', $options ) ) { $options[ 'modest' ] = 1; $changed = true; }
240
- if ( !array_key_exists( 'dynamic', $options ) ) { $options[ 'dynamic' ] = ''; $changed = true; }
241
- if ( !array_key_exists( 'fixed', $options ) ) { $options[ 'fixed' ] = ''; $changed = true; }
242
 
243
  // Update the options, if changed, and return the result
244
-
245
  if ( $changed ) { update_option( 'youtube_embed_profile' . $profile, $options ); }
246
 
247
  // Remove added slashes from template XHTML
248
-
249
  $options[ 'template' ] = stripslashes( $options[ 'template' ] );
250
 
251
  return $options;
@@ -267,17 +210,17 @@ function aye_set_list_defaults( $list ) {
267
  $options = get_option( 'youtube_embed_list' . $list );
268
  $changed = false;
269
 
270
- // If array doesn't exist create an empty one
271
-
272
- if ( !is_array( $options ) ) { $options = array(); }
 
 
273
 
274
  // Because of upgrading, check each option - if not set, apply default
275
-
276
  if ( !array_key_exists( 'name',$options ) ) { $options[ 'name' ] = 'List ' . $list; $changed = true; }
277
  if ( !array_key_exists( 'list',$options ) ) { $options[ 'list' ] = ''; $changed = true; }
278
 
279
  // Update the options, if changed, and return the result
280
-
281
  if ( $changed ) { update_option( 'youtube_embed_list' . $list, $options ); }
282
  return $options;
283
  }
7
  * @package Artiss-YouTube-Embed
8
  */
9
 
 
 
 
 
 
 
 
 
10
  /**
11
  * Function to set Shortcode option
12
  *
53
  return $url;
54
  }
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  /**
57
  * Function to set general YouTube options
58
  *
64
  */
65
 
66
  function aye_set_general_defaults() {
 
67
  $options = get_option( 'youtube_embed_general' );
68
  $changed = false;
69
+ $default_error = htmlspecialchars( '<p>The video cannot be shown at the moment. Please try again later.</p>' );
 
 
70
 
71
  if ( !is_array( $options ) ) {
72
  if ( get_option( 'youtube_embed_editor' ) ) {
73
+ // If the old options exist, import them and then delete them
74
  $old_opts = get_option( 'youtube_embed_editor' );
75
  $options[ 'editor_button' ] = $old_opts[ 'youtube' ];
76
  delete_option( 'youtube_embed_editor' );
77
  $changed = true;
78
  } else {
79
+ // If array doesn't exist, set defaults
80
+ $options = array( 'editor_button' => 1, 'admin_bar' => 1, 'profile_no' => 5, 'list_no' => 5, 'info_cache' => 1, 'embed_cache' => 24, 'transcript_cache' => 24, 'alt_profile' => 0, 'alt_profile2' => 0, 'bracket' => '', 'alt' => 0, 'other_profile' => 0, 'comments' => '', 'comments_profile' => 0, 'metadata' => 1, 'feed' => 'b', 'api' => 1, 'error_message' => $default_error, 'thumbnail' => 2, 'privacy' => 0, 'frameborder' => 1 );
81
+ $changed = true;
82
  }
83
  }
84
 
85
+ // Set current version level. Because this can be used to detect version changes (and to what extent), this
86
+ // information may be useful in future upgrades
87
  if ( $options[ 'current_version' ] != youtube_embed_version ) {
88
  $options[ 'current_version' ] = youtube_embed_version;
89
  $changed = true;
90
  }
91
 
92
  // Because of upgrading, check each option - if not set, apply default
 
 
93
  if ( !array_key_exists( 'editor_button', $options ) ) { $options[ 'editor_button' ] = 1; $changed = true; }
94
  if ( !array_key_exists( 'admin_bar', $options ) ) { $options[ 'admin_bar' ] = 1; $changed = true; }
95
  if ( !array_key_exists( 'profile_no', $options ) ) { $options[ 'profile_no' ] = 5; $changed = true; }
99
  if ( !array_key_exists( 'transcript_cache', $options ) ) { $options[ 'transcript_cache' ] = 24; $changed = true; }
100
  if ( !array_key_exists( 'alt_profile', $options ) ) { $options[ 'alt_profile' ] = 0; $changed = true; }
101
  if ( !array_key_exists( 'alt_profile2', $options ) ) { $options[ 'alt_profile2' ] = 0; $changed = true; }
 
 
102
  if ( !array_key_exists( 'other_profile', $options ) ) { $options[ 'other_profile' ] = 0; $changed = true; }
 
103
  if ( !array_key_exists( 'comments_profile', $options ) ) { $options[ 'comments_profile' ] = 0; $changed = true; }
104
  if ( !array_key_exists( 'metadata', $options ) ) { $options[ 'metadata' ] = 1; $changed = true; }
105
  if ( !array_key_exists( 'feed', $options ) ) { $options[ 'feed' ] = 'b'; $changed = true; }
106
  if ( !array_key_exists( 'api', $options ) ) { $options[ 'api' ] = 1; $changed = true; }
107
  if ( !array_key_exists( 'error_message', $options ) ) { $options[ 'error_message' ] = $default_error; $changed = true; }
108
  if ( !array_key_exists( 'thumbnail', $options ) ) { $options[ 'thumbnail' ] = 2; $changed = true; }
 
109
  if ( !array_key_exists( 'frameborder', $options ) ) { $options[ 'frameborder' ] = 1; $changed = true; }
 
 
 
110
 
111
  // Update the options, if changed, and return the result
 
112
  if ( $changed ) { update_option( 'youtube_embed_general', $options ); }
113
  return $options;
114
  }
126
  */
127
 
128
  function aye_set_profile_defaults( $profile ) {
 
129
  if ( $profile == 0 ) {
130
  $profname = 'Default';
131
  } else {
132
  $profname = 'Profile ' . $profile;
133
  }
134
  $options = get_option( 'youtube_embed_profile' . $profile );
 
135
  $changed = false;
136
  $new_user = false;
137
 
138
  // Work out default dimensions
139
+ if ( isset( $GLOBALS[ 'content_width' ] ) ) {
140
+ $width = $GLOBALS[ 'content_width' ];
141
+ } else {
142
+ $width = 560;
143
+ }
144
+ $height = 27 + round( ( $width / 16 ) * 9, 0 );
 
145
 
146
  if ( !is_array( $options ) ) {
147
  if ( ( $profile == 0 ) && ( get_option( 'youtube_embed' ) ) ) {
148
+ // If the old options exist, import them and then delete them
149
  $old_opts = get_option( 'youtube_embed' );
150
  $options = $old_opts;
151
  delete_option( 'youtube_embed' );
152
  $changed = true;
153
  } else {
154
+ // If array doesn't exist, set defaults
155
+ $options = array( 'width' => $width, 'height' => $height, 'fullscreen' => '', 'template' => '%video%', 'autoplay' => '', 'start' => '0', 'loop' => '', 'cc' => '', 'annotation' => '1', 'related' => '', 'info' => '1', 'link' => '1', 'react' => '1', 'stop' => '0', 'sweetspot' => '1', 'type' => 'v', 'disablekb' => '', 'autohide' => '2', 'controls' => '1', 'playlist' => 'v', 'fallback' => 'v', 'wmode' => 'window', 'audio' => '', 'hd' => '1', 'style' => '', 'color' => 'red', 'theme' => 'dark', 'https' => '0', 'modest' => '1', 'dynamic' => '', 'fixed' => '' );
156
+ $changed = true;
157
  }
158
  }
159
 
160
  // Because of upgrading, check each option - if not set, apply default
 
161
  if ( !array_key_exists( 'name', $options ) ) { $options[ 'name' ] = $profname; $changed = true; }
 
162
  if ( !array_key_exists( 'width', $options ) ) {
163
+ $option[ 'width' ] = $width;
164
  $options[ 'height' ] = $height;
165
  $changed = true;
166
  }
167
+ if ( !array_key_exists( 'height', $options ) ) { $options[ 'height' ] = '340'; $changed = true; }
168
+ if ( !array_key_exists( 'annotation', $options ) ) { $options[ 'annotation' ] = '1'; $changed = true; }
169
+ if ( !array_key_exists( 'info', $options ) ) { $options[ 'info' ] = '1'; $changed = true; }
170
+ if ( !array_key_exists( 'link', $options ) ) { $options[ 'link' ] = '1'; $changed = true; }
171
+ if ( !array_key_exists( 'react', $options ) ) { $options[ 'react' ] = '1'; $changed = true; }
172
+ if ( !array_key_exists( 'sweetspot', $options ) ) { $options[ 'sweetspot' ] = '1'; $changed = true; }
 
 
 
 
 
 
 
 
173
  if ( !array_key_exists( 'type', $options ) ) { $options[ 'type' ] = 'v'; $changed = true; }
174
+ if ( !array_key_exists( 'link', $options ) ) { $options[ 'link' ] = '1'; $changed = true; }
175
+ if ( !array_key_exists( 'react', $options ) ) { $options[ 'react' ] = '1'; $changed = true; }
176
+ if ( !array_key_exists( 'sweetspot', $options ) ) { $options[ 'sweetspot' ] = '1'; $changed = true; }
177
+ if ( !array_key_exists( 'autohide', $options ) ) { $options[ 'autohide' ] = '2'; $changed = true; }
178
+ if ( !array_key_exists( 'controls', $options ) ) { $options[ 'controls' ] = '1'; $changed = true; }
179
  if ( !array_key_exists( 'playlist', $options ) ) { $options[ 'playlist' ] = 'v'; $changed = true; }
180
  if ( !array_key_exists( 'fallback', $options ) ) { $options[ 'fallback' ] = 'v'; $changed = true; }
181
  if ( !array_key_exists( 'wmode', $options ) ) { $options[ 'wmode' ] = 'window'; $changed = true; }
182
+ if ( !array_key_exists( 'template', $options ) ) { $options[ 'template' ] = '%video%'; $changed = true; }
183
+ if ( !array_key_exists( 'hd', $options ) ) { $options[ 'hd' ] = '1'; $changed = true; }
 
184
  if ( !array_key_exists( 'color', $options ) ) { $options[ 'color' ] = 'red'; $changed = true; }
185
  if ( !array_key_exists( 'theme', $options ) ) { $options[ 'theme' ] = 'dark'; $changed = true; }
 
186
  if ( !array_key_exists( 'modest', $options ) ) { $options[ 'modest' ] = 1; $changed = true; }
 
 
187
 
188
  // Update the options, if changed, and return the result
 
189
  if ( $changed ) { update_option( 'youtube_embed_profile' . $profile, $options ); }
190
 
191
  // Remove added slashes from template XHTML
 
192
  $options[ 'template' ] = stripslashes( $options[ 'template' ] );
193
 
194
  return $options;
210
  $options = get_option( 'youtube_embed_list' . $list );
211
  $changed = false;
212
 
213
+ // If array doesn't exist, set defaults
214
+ if ( !is_array( $options ) ) {
215
+ $options = array( 'name' => 'List ' . $list, 'list' => '' );
216
+ $changed = true;
217
+ }
218
 
219
  // Because of upgrading, check each option - if not set, apply default
 
220
  if ( !array_key_exists( 'name',$options ) ) { $options[ 'name' ] = 'List ' . $list; $changed = true; }
221
  if ( !array_key_exists( 'list',$options ) ) { $options[ 'list' ] = ''; $changed = true; }
222
 
223
  // Update the options, if changed, and return the result
 
224
  if ( $changed ) { update_option( 'youtube_embed_list' . $list, $options ); }
225
  return $options;
226
  }
includes/aye-shared-functions.php CHANGED
@@ -7,58 +7,6 @@
7
  * @package Artiss-YouTube-Embed
8
  */
9
 
10
- /**
11
- * Is Do Not Track active?
12
- *
13
- * Function to return whether Do Not Track is active in the current
14
- * browser
15
- *
16
- * @since 2.6
17
- *
18
- * @return string True or false
19
- */
20
-
21
- function aye_do_not_track() { // 1.0
22
-
23
- if ( isset( $_SERVER[ 'HTTP_DNT' ] ) ) {
24
- if ( $_SERVER[ 'HTTP_DNT' ] == 1 ) { return true; }
25
- } else {
26
- if ( function_exists( 'getallheaders' ) ) {
27
- foreach ( getallheaders() as $key => $value ) {
28
- if ( ( strtolower( $key ) === 'dnt' ) && ( $value == 1 ) ) { return true; }
29
- }
30
- }
31
- }
32
- return false;
33
- }
34
-
35
- /**
36
- * Get the cookie path
37
- *
38
- * Work out the path for the current installation to add cookies for
39
- *
40
- * @since 2.6
41
- *
42
- * @return string Cookie path
43
- */
44
-
45
- function aye_get_cookie_path() {
46
-
47
- // Remove the http:// from the beginning of the site URL
48
-
49
- $path = str_replace( 'http://', '', site_url( '/', 'http' ) );
50
-
51
- // Find the first slash in the results
52
-
53
- $pos = strpos( $path, '/' );
54
-
55
- // Strip all before the first slash
56
-
57
- $path = substr( $path, $pos ) . 'wp-content/';
58
-
59
- return $path;
60
- }
61
-
62
  /**
63
  * Extract parameters (1.0)
64
  *
@@ -99,28 +47,19 @@ function aye_get_parameters( $input, $para ) {
99
 
100
  function aye_extract_id( $id ) {
101
 
102
- // Convert and trim video ID characters
103
-
104
- $id = trim( str_replace( '&#8211;', '--', str_replace( '&#215;', 'x', strip_tags( $id ) ) ) );
105
 
106
  // Check if it's the full URL, as found in address bar
107
 
108
  $video_pos = strpos( $id, 'youtube.com/watch?', 0 );
109
 
110
  if ( $video_pos !== false ) {
111
-
112
- $video_pos = strpos( $id, 'v=', $video_pos + 18 );
113
- if ( $video_pos === false ) { $video_pos = strpos( $id, 'p=', $video_pos + 18 ); }
114
-
115
- if ( $video_pos !== false ) {
116
-
117
- $video_pos = $video_pos + 2;
118
- $ampersand_pos = strpos( $id, '&', $video_pos );
119
- if ( !$ampersand_pos ) {
120
- $id = substr( $id, $video_pos );
121
- } else {
122
- $id = substr( $id, $video_pos, $ampersand_pos - $video_pos );
123
- }
124
  }
125
 
126
  } else {
@@ -158,6 +97,11 @@ function aye_extract_id( $id ) {
158
  }
159
  }
160
 
 
 
 
 
 
161
  return $id;
162
  }
163
 
@@ -214,7 +158,7 @@ function aye_validate_id( $id, $title_needed = false ) {
214
 
215
  // Check with YouTube API as to whether the ID is a playlist
216
 
217
- if ( strtolower( substr( $id, 0, 2 ) ) == 'pl' ) { $id = substr( $id, 2 ); }
218
  $id_check = aye_get_file( 'http' . $https . '://gdata.youtube.com/feeds/api/playlists/' . $id . '?v=2', false );
219
  if ( $id_check[ 'rc' ] == 0 ) {
220
  if ( $id_check[ 'response' ] != 200 ) {
@@ -237,7 +181,7 @@ function aye_validate_id( $id, $title_needed = false ) {
237
 
238
  // If reporting API errors, output it
239
 
240
- $type = sprintf( __('An error occurred accessing the YouTube API for video ID %s - %s', 'youtube-embed' ), $id, $id_check[ 'error' ] );
241
 
242
  } else {
243
 
@@ -486,7 +430,7 @@ function aye_generate_profile_list( $current, $total ) {
486
  $profname = $profiles[ 'name' ];
487
 
488
  if ( $profname == '' ) { $profname = __( 'Profile' ) . ' ' . $loop; }
489
- if ( strlen( $profname ) > 30 ) { $profname = substr( $profname, 0, 30 ) . '&#8230;'; }
490
  echo '<option value="' . $loop . '"';
491
 
492
  if ( $current == $loop ) { echo " selected='selected'"; }
7
  * @package Artiss-YouTube-Embed
8
  */
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  /**
11
  * Extract parameters (1.0)
12
  *
47
 
48
  function aye_extract_id( $id ) {
49
 
50
+ $id = trim( strip_tags( $id ) );
 
 
51
 
52
  // Check if it's the full URL, as found in address bar
53
 
54
  $video_pos = strpos( $id, 'youtube.com/watch?', 0 );
55
 
56
  if ( $video_pos !== false ) {
57
+ $video_pos = $video_pos + 20;
58
+ $ampersand_pos = strpos( $id, '&', $video_pos );
59
+ if ( !$ampersand_pos ) {
60
+ $id = substr( $id, $video_pos );
61
+ } else {
62
+ $id = substr( $id, $video_pos, $ampersand_pos - $video_pos );
 
 
 
 
 
 
 
63
  }
64
 
65
  } else {
97
  }
98
  }
99
 
100
+ // Convert video ID characters
101
+
102
+ $id = str_replace( '&#8211;', '--', $id );
103
+ $id = str_replace( '&#215;', 'x', $id );
104
+
105
  return $id;
106
  }
107
 
158
 
159
  // Check with YouTube API as to whether the ID is a playlist
160
 
161
+ if ( strtolower( substr( $id, 0, 2 ) ) == 'pl' ) { $id = substr( $id, 2 ); }
162
  $id_check = aye_get_file( 'http' . $https . '://gdata.youtube.com/feeds/api/playlists/' . $id . '?v=2', false );
163
  if ( $id_check[ 'rc' ] == 0 ) {
164
  if ( $id_check[ 'response' ] != 200 ) {
181
 
182
  // If reporting API errors, output it
183
 
184
+ $type = sprintf( __('An error occurred accessing the YouTube API for video ID %s - %s' ), $id, $id_check[ 'error' ] );
185
 
186
  } else {
187
 
430
  $profname = $profiles[ 'name' ];
431
 
432
  if ( $profname == '' ) { $profname = __( 'Profile' ) . ' ' . $loop; }
433
+ if ( strlen( $profname ) > 30 ) { $profname = substr( $profname, 0, 30 ) . '&#8230;'; }
434
  echo '<option value="' . $loop . '"';
435
 
436
  if ( $current == $loop ) { echo " selected='selected'"; }
includes/aye-shortcodes.php CHANGED
@@ -87,7 +87,7 @@ if ( $shortcode[ 2 ] != '' ) { add_shortcode( $shortcode[ 2 ], 'aye_video_shortc
87
 
88
  function aye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_shortcode = '' ) {
89
 
90
- extract( shortcode_atts( array( 'type' => '', 'width' => '', 'height' => '', 'fullscreen' => '', 'related' => '', 'autoplay' => '', 'loop' => '', 'start' => '', 'info' => '', 'annotation' => '', 'cc' => '', 'style' => '', 'link' => '', 'react' => '', 'stop' => '', 'sweetspot' => '', 'disablekb' => '', 'ratio' => '', 'autohide' => '', 'controls' => '', 'profile' => '', 'embedplus' => '', 'audio' => '', 'id' => '', 'url' => '', 'rel' => '', 'fs' => '', 'cc_load_policy' => '', 'iv_load_policy' => '', 'showinfo' => '', 'youtubeurl' => '', 'template' => '', 'list' => '', 'hd' => '', 'color' => '', 'theme' => '', 'ssl' => '', 'height' => '', 'width' => '', 'dynamic' => '', 'h' => '', 'w' => '', 'search' => '', 'user' => '' ), $paras ) );
91
 
92
  // If no profile specified and an alternative shortcode used, get that shortcodes default profile
93
 
@@ -109,8 +109,8 @@ function aye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_s
109
  if ( ( $url != '' ) && ( $content == '' ) ) { $content = $url; }
110
  if ( ( $youtubeurl != '' ) && ( $content == '' ) ) { $content = $youtubeurl; }
111
 
112
- if ( ( $h != '' ) && ( $height == '' ) ) { $height = $h; }
113
- if ( ( $w != '' ) && ( $width == '' ) ) { $width = $w; }
114
 
115
  if ( ( $rel != '' ) && ( $related == '' ) ) { $related = $rel;}
116
  if ( ( $fs != '' ) && ( $fullscreen == '' ) ) { $fullscreen = $fs;}
@@ -137,7 +137,7 @@ function aye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_s
137
 
138
  // Create YouTube code
139
 
140
- $youtube_code = aye_generate_youtube_code( $content, $type, $width, $height, aye_convert( $fullscreen ), aye_convert( $related ), aye_convert( $autoplay ), aye_convert( $loop ), $start, aye_convert( $info ), aye_convert_3( $annotation ), aye_convert( $cc ), $style, aye_convert( $link ), aye_convert( $react ), $stop, aye_convert( $sweetspot ), aye_convert( $disablekb ), $ratio, $autohide, $controls, $profile, $list, aye_convert( $audio ), $template, aye_convert( $hd ), $color, $theme, aye_convert( $ssl ), aye_convert( $dynamic ), aye_convert( $search ), aye_convert( $user ) );
141
 
142
  return do_shortcode( $youtube_code );
143
  }
@@ -157,8 +157,8 @@ function aye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_s
157
  */
158
 
159
  function aye_thumbnail_sc( $paras = '', $content = '' ) {
160
- extract( shortcode_atts( array( 'style' => '', 'class' => '', 'rel' => '', 'target' => '', 'width' => '', 'height' => '', 'alt' => '', 'version' => '', 'nolink' => '' ), $paras ) );
161
- return do_shortcode( aye_generate_thumbnail_code( $content, $style, $class, $rel, $target, $width, $height, $alt, $version, $nolink ) );
162
  }
163
 
164
  add_shortcode( 'youtube_thumb', 'aye_thumbnail_sc' );
@@ -265,7 +265,7 @@ function aye_video_name_shortcode( $paras = '', $content = '' ) {
265
  // Check what type of video it is and whether it's valid
266
 
267
  $return = aye_validate_id( $id, true );
268
- if ( !$return[ 'type' ] ) { return aye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) ); }
269
  if ( strlen( $return[ 'type' ] ) != 1 ) { return aye_error( $return[ 'type' ] ); }
270
 
271
  // Return the video title
87
 
88
  function aye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_shortcode = '' ) {
89
 
90
+ extract( shortcode_atts( array( 'type' => '', 'width' => '', 'height' => '', 'fullscreen' => '', 'related' => '', 'autoplay' => '', 'loop' => '', 'start' => '', 'info' => '', 'annotation' => '', 'cc' => '', 'style' => '', 'link' => '', 'react' => '', 'stop' => '', 'sweetspot' => '', 'disablekb' => '', 'ratio' => '', 'autohide' => '', 'controls' => '', 'profile' => '', 'embedplus' => '', 'audio' => '', 'id' => '', 'url' => '', 'rel' => '', 'fs' => '', 'cc_load_policy' => '', 'iv_load_policy' => '', 'showinfo' => '', 'youtubeurl' => '', 'template' => '', 'list' => '', 'hd' => '', 'color' => '', 'theme' => '', 'ssl' => '', 'height' => '', 'width' => '', 'title' => '', 'dynamic' => '', 'h' => '', 'w' => '', 'search' => '', 'user' => '' ), $paras ) );
91
 
92
  // If no profile specified and an alternative shortcode used, get that shortcodes default profile
93
 
109
  if ( ( $url != '' ) && ( $content == '' ) ) { $content = $url; }
110
  if ( ( $youtubeurl != '' ) && ( $content == '' ) ) { $content = $youtubeurl; }
111
 
112
+ if ( ( $h != '' ) && ( $height == '' ) ) { $height = $h; }
113
+ if ( ( $w != '' ) && ( $width == '' ) ) { $width = $w; }
114
 
115
  if ( ( $rel != '' ) && ( $related == '' ) ) { $related = $rel;}
116
  if ( ( $fs != '' ) && ( $fullscreen == '' ) ) { $fullscreen = $fs;}
137
 
138
  // Create YouTube code
139
 
140
+ $youtube_code = aye_generate_youtube_code( $content, $type, $width, $height, aye_convert( $fullscreen ), aye_convert( $related ), aye_convert( $autoplay ), aye_convert( $loop ), $start, aye_convert( $info ), aye_convert_3( $annotation ), aye_convert( $cc ), $style, aye_convert( $link ), aye_convert( $react ), $stop, aye_convert( $sweetspot ), aye_convert( $disablekb ), $ratio, $autohide, aye_convert( $controls ), $profile, $list, aye_convert( $audio ), $template, aye_convert( $hd ), $color, $theme, aye_convert( $ssl ), $title, aye_convert( $dynamic ), aye_convert( $search ), aye_convert( $user ) );
141
 
142
  return do_shortcode( $youtube_code );
143
  }
157
  */
158
 
159
  function aye_thumbnail_sc( $paras = '', $content = '' ) {
160
+ extract( shortcode_atts( array( 'style' => '', 'class' => '', 'rel' => '', 'target' => '', 'width' => '', 'height' => '', 'alt' => '', 'version' => '' ), $paras ) );
161
+ return do_shortcode( aye_generate_thumbnail_code( $content, $style, $class, $rel, $target, $width, $height, $alt, $version ) );
162
  }
163
 
164
  add_shortcode( 'youtube_thumb', 'aye_thumbnail_sc' );
265
  // Check what type of video it is and whether it's valid
266
 
267
  $return = aye_validate_id( $id, true );
268
+ if ( !$return[ 'type' ] ) { return aye_error( sprintf( __( 'The YouTube ID of %s is invalid.' ), $id ) ); }
269
  if ( strlen( $return[ 'type' ] ) != 1 ) { return aye_error( $return[ 'type' ] ); }
270
 
271
  // Return the video title
js/aye-ga-tracker UNCOMPRESSED.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ function recordOutboundLink(category, action, label) {
2
+ _gaq.push(['_trackEvent', category, action, label]);
3
+ }
js/aye-ga-tracker.js ADDED
@@ -0,0 +1 @@
 
1
+ function recordOutboundLink(category,action,label){_gaq.push(['_trackEvent',category,action,label])}
js/{aye-mce-button.php → aye-mce-button UNCOMPRESSED.js } RENAMED
@@ -1,14 +1,4 @@
1
- // Function to add MCE button. Includes build of output text
2
-
3
  (function() {
4
- <?php
5
-
6
- // Get cookie of default shortcode to use
7
-
8
- $cookie_name = 'aye_mce_shortcode';
9
- if ( isset( $_COOKIE[ $cookie_name ] ) ) { $shortcode = $_COOKIE[ $cookie_name ]; } else { $shortcode = 'youtube'; }
10
- ?>
11
- var shortcode = "<?php echo $shortcode; ?>";
12
  tinymce.create('tinymce.plugins.youtube', {
13
  init : function(ed, url) {
14
  ed.addButton('YouTube', {
@@ -19,7 +9,7 @@ if ( isset( $_COOKIE[ $cookie_name ] ) ) { $shortcode = $_COOKIE[ $cookie_name ]
19
  } else {
20
  var yeOut = ed.selection.getContent();
21
  }
22
- ed.selection.setContent('[' + shortcode + ']' + yeOut + '[/' + shortcode + ']');
23
  }
24
  });
25
  },
 
 
1
  (function() {
 
 
 
 
 
 
 
 
2
  tinymce.create('tinymce.plugins.youtube', {
3
  init : function(ed, url) {
4
  ed.addButton('YouTube', {
9
  } else {
10
  var yeOut = ed.selection.getContent();
11
  }
12
+ ed.selection.setContent('[youtube]' + yeOut + '[/youtube]');
13
  }
14
  });
15
  },
js/aye-mce-button.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(){tinymce.create('tinymce.plugins.youtube',{init:function(ed,url){ed.addButton('YouTube',{title:'YouTube Embed',onclick:function(){if(ed.selection.getContent()==''){var yeOut='Insert video URL or ID here'}else{var yeOut=ed.selection.getContent()}ed.selection.setContent('[youtube]'+yeOut+'[/youtube]')}})},createControl:function(n,cm){return null}});tinymce.PluginManager.add('YouTube',tinymce.plugins.youtube)})();
js/aye-mce-button.min.php DELETED
@@ -1,3 +0,0 @@
1
- (function(){
2
- <?php $cookie_name='aye_mce_shortcode'; if(isset($_COOKIE[$cookie_name])) {$shortcode=$_COOKIE[$cookie_name];} else {$shortcode='youtube';} ?>
3
- var shortcode="<?php echo $shortcode; ?>";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('['+shortcode+']'+yeOut+'[/'+shortcode+']')}})},createControl:function(n,cm){return null}});tinymce.PluginManager.add('YouTube',tinymce.plugins.youtube)})();
 
 
 
languages/youtube-embed.mo CHANGED
Binary file
languages/youtube-embed.po CHANGED
@@ -1,9 +1,9 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: Artiss YouTube Embed\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2012-10-12 15:39-0000\n"
6
- "PO-Revision-Date: 2012-10-12 15:39-0000\n"
7
  "Last-Translator: David Artiss <david.artiss@artiss.co.uk>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
@@ -13,181 +13,151 @@ msgstr ""
13
  "X-Poedit-Basepath: ../\n"
14
  "X-Poedit-SearchPath-0: .\n"
15
 
16
- #: includes/artiss-plugin-ads.php:46
17
- #: includes/aye-admin-config.php:65
18
- msgid "Donate"
19
- msgstr ""
20
-
21
- #: includes/artiss-plugin-ads.php:47
22
- msgid "If you like this plugin and appreciate the effort being put into it, <a href=\"http://www.artiss.co.uk/donate\">please consider donating</a>."
23
- msgstr ""
24
-
25
- #: includes/artiss-plugin-ads.php:48
26
- msgid "Follow Me"
27
- msgstr ""
28
-
29
- #: includes/artiss-plugin-ads.php:49
30
- msgid "Please stay in touch with the latest news via one of the following social streams..."
31
- msgstr ""
32
-
33
- #: includes/artiss-plugin-ads.php:51
34
- msgid "Follow Artiss.co.uk on Twitter"
35
- msgstr ""
36
-
37
- #: includes/artiss-plugin-ads.php:52
38
- msgid "Follow Artiss.co.uk on Facebook"
39
- msgstr ""
40
-
41
- #: includes/artiss-plugin-ads.php:53
42
- msgid "Follow Artiss.co.uk on Google+"
43
- msgstr ""
44
-
45
- #: includes/artiss-plugin-ads.php:54
46
- msgid "Follow Artiss.co.uk on RSS feed"
47
- msgstr ""
48
-
49
  #: includes/aye-add-to-admin-bar.php:36
50
- #: includes/aye-add-to-admin-bar.php:76
51
  msgid "YouTube Embed"
52
  msgstr ""
53
 
54
- #: includes/aye-add-to-admin-bar.php:82
55
- #: includes/aye-admin-config.php:112
56
- msgid "Instructions"
57
- msgstr ""
58
-
59
- #: includes/aye-add-to-admin-bar.php:91
60
- #: includes/aye-admin-config.php:119
61
  msgid "Options"
62
  msgstr ""
63
 
64
- #: includes/aye-add-to-admin-bar.php:100
65
- #: includes/aye-admin-config.php:129
66
  msgid "Profiles"
67
  msgstr ""
68
 
69
- #: includes/aye-add-to-admin-bar.php:109
70
- #: includes/aye-admin-config.php:139
71
  msgid "Lists"
72
  msgstr ""
73
 
74
- #: includes/aye-admin-config.php:38
 
 
 
 
 
75
  msgid "Settings"
76
  msgstr ""
77
 
78
- #: includes/aye-admin-config.php:63
79
  msgid "Support"
80
  msgstr ""
81
 
82
- #: includes/aye-admin-config.php:97
83
- msgid "About Artiss YouTube Embeds"
 
 
 
 
84
  msgstr ""
85
 
86
- #: includes/aye-admin-config.php:97
87
  msgid "YouTube"
88
  msgstr ""
89
 
90
- #: includes/aye-admin-config.php:103
91
- #: includes/aye-display-about.php:14
92
- msgid "About Artiss YouTube Embed"
93
  msgstr ""
94
 
95
- #: includes/aye-admin-config.php:103
96
- msgid "About"
97
  msgstr ""
98
 
99
- #: includes/aye-admin-config.php:112
100
- #: includes/aye-display-instructions.php:14
101
- msgid "Artiss YouTube Embed Instructions"
102
  msgstr ""
103
 
104
- #: includes/aye-admin-config.php:119
105
- msgid "Artiss YouTube Embed Options"
106
  msgstr ""
107
 
108
- #: includes/aye-admin-config.php:129
109
- msgid "Artiss YouTube Embed Profiles"
 
110
  msgstr ""
111
 
112
- #: includes/aye-admin-config.php:139
113
- msgid "Artiss YouTube Embed Lists"
114
  msgstr ""
115
 
116
- #: includes/aye-admin-config.php:261
117
- #: includes/aye-admin-config.php:303
118
- #: includes/aye-admin-config.php:346
119
- #: includes/aye-admin-config.php:388
120
  msgid "Help"
121
  msgstr ""
122
 
123
- #: includes/aye-admin-config.php:276
124
  msgid "This screen allows you to select non-specific options for the Artiss YouTube Embed plugin. For the default embedding settings, please select the <a href=\"admin.php?page=aye-profile-options\">Profiles</a> administration option."
125
  msgstr ""
126
 
127
- #: includes/aye-admin-config.php:277
128
- #: includes/aye-admin-config.php:319
129
- #: includes/aye-admin-config.php:362
130
  msgid "Remember to click the Save Settings button at the bottom of the screen for new settings to take effect."
131
  msgstr ""
132
 
133
- #: includes/aye-admin-config.php:278
134
- #: includes/aye-admin-config.php:320
135
- #: includes/aye-admin-config.php:363
136
- #: includes/aye-admin-config.php:404
137
  msgid "For more information:"
138
  msgstr ""
139
 
140
- #: includes/aye-admin-config.php:279
141
- #: includes/aye-admin-config.php:321
142
- #: includes/aye-admin-config.php:364
143
- #: includes/aye-admin-config.php:405
144
  msgid "Artiss YouTube Embed Plugin Documentation"
145
  msgstr ""
146
 
147
- #: includes/aye-admin-config.php:280
148
- #: includes/aye-admin-config.php:322
149
- #: includes/aye-admin-config.php:365
150
- #: includes/aye-admin-config.php:406
151
  msgid "YouTube Player Documentation"
152
  msgstr ""
153
 
154
- #: includes/aye-admin-config.php:281
155
- #: includes/aye-admin-config.php:324
156
- #: includes/aye-admin-config.php:366
157
- #: includes/aye-admin-config.php:407
158
- #: includes/aye-display-about.php:50
159
  msgid "This plugin, and all support, is supplied for free, but <a title=\"Donate\" href=\"http://artiss.co.uk/donate\" target=\"_blank\">donations</a> are always welcome."
160
  msgstr ""
161
 
162
- #: includes/aye-admin-config.php:318
163
  msgid "This screen allows you to set the options for the default and additional profiles. If you don't specify a specific parameter when displaying your YouTube video then the default profile option will be used instead. Additional profiles, which you may name, can be used as well and used as required."
164
  msgstr ""
165
 
166
- #: includes/aye-admin-config.php:323
167
  msgid "EmbedPlus website"
168
  msgstr ""
169
 
170
- #: includes/aye-admin-config.php:361
171
  msgid "This screen allows you to create lists of YouTube videos, which may be named. These lists can then be used in preference to a single video ID."
172
  msgstr ""
173
 
174
- #: includes/aye-admin-config.php:403
175
  msgid "This screen provides useful information about this plugin along with methods of support."
176
  msgstr ""
177
 
178
- #: includes/aye-admin-config.php:465
179
  msgid "Welcome to Artiss YouTube Embed"
180
  msgstr ""
181
 
182
- #: includes/aye-admin-config.php:466
183
  msgid "Thank you for installing this plugin."
184
  msgstr ""
185
 
186
- #: includes/aye-admin-config.php:467
187
  msgid "These new menu options will allow you to configure your videos to just how you want them and provide links for help and support."
188
  msgstr ""
189
 
190
- #: includes/aye-admin-config.php:468
191
  msgid "Even if you do nothing else, please visit the Profiles option to check your default video values."
192
  msgstr ""
193
 
@@ -195,73 +165,72 @@ msgstr ""
195
  msgid "This function does not support playlists"
196
  msgstr ""
197
 
198
- #: includes/aye-display-about.php:26
199
  #, php-format
200
  msgid "You are using Artiss YouTube Embed version %s. It was written by David Artiss."
201
  msgstr ""
202
 
203
- #: includes/aye-display-about.php:28
204
- msgid "Powered by YouTube"
205
- msgstr ""
206
-
207
- #: includes/aye-display-about.php:32
208
  msgid "Copyrights"
209
  msgstr ""
210
 
211
- #: includes/aye-display-about.php:34
212
  msgid "YouTube, and all associated logos, is the copyright of Google Inc."
213
  msgstr ""
214
 
215
- #: includes/aye-display-about.php:36
216
  msgid "EmbedPlus is copyright. Read the <a href=\"http://embedplus.com/terms.aspx\" target=\"_blank\">Terms &amp; Conditions of Use</a>."
217
  msgstr ""
218
 
219
- #: includes/aye-display-about.php:38
220
  msgid "Acknowledgements"
221
  msgstr ""
222
 
223
- #: includes/aye-display-about.php:40
224
  msgid "Images have been compressed with <a href=\"http://www.smushit.com/ysmush.it/\">Smush.it</a>."
225
  msgstr ""
226
 
227
- #: includes/aye-display-about.php:42
228
  msgid "JavaScript has been compressed with <a href=\"http://javascriptcompressor.com/\">JavaScript Compressor</a>."
229
  msgstr ""
230
 
231
- #: includes/aye-display-about.php:44
232
  msgid "YouTube icons are courtesy of <a href=\"http://www.youtube.com/t/creators_downloads\">YouTube</a>. Other icons are by <a href=\"http://p.yusukekamiyamane.com/\">Yusuke Kamiyamane</a>."
233
  msgstr ""
234
 
235
- #: includes/aye-display-about.php:46
236
  msgid "Support Information"
237
  msgstr ""
238
 
239
- #: includes/aye-display-about.php:48
240
  msgid "Useful support information and links can be found by clicking on the Help tab at the top of each of the Artiss YouTube Embed administration screens."
241
  msgstr ""
242
 
243
- #: includes/aye-display-about.php:52
244
  msgid "Stay in Touch"
245
  msgstr ""
246
 
247
- #: includes/aye-display-about.php:54
248
  msgid "<a href=\"http://www.artiss.co.uk/wp-plugins\">See the full list</a> of Artiss plugins, including beta releases."
249
  msgstr ""
250
 
251
- #: includes/aye-display-about.php:56
252
  msgid "<a href=\"http://www.twitter.com/artiss_tech\">Follow Artiss.co.uk</a> on Twitter."
253
  msgstr ""
254
 
255
- #: includes/aye-display-about.php:58
256
  msgid "<a href=\"http://www.artiss.co.uk/feed\">Subscribe</a> to the Artiss.co.uk news feed."
257
  msgstr ""
258
 
 
 
 
 
259
  #: includes/aye-function-calls.php:162
260
  #: includes/aye-function-calls.php:223
261
  #: includes/aye-generate-download-code.php:34
262
- #: includes/aye-generate-embed-code.php:114
263
  #: includes/aye-generate-shorturl-code.php:34
264
- #: includes/aye-generate-thumbnail-code.php:39
265
  #: includes/aye-generate-transcript-code.php:38
266
  #, php-format
267
  msgid "The YouTube ID of %s is invalid."
@@ -276,15 +245,15 @@ msgstr ""
276
  msgid "No YouTube ID was found."
277
  msgstr ""
278
 
279
- #: includes/aye-generate-embed-code.php:64
280
  msgid "No video/playlist ID has been supplied"
281
  msgstr ""
282
 
283
- #: includes/aye-generate-embed-code.php:181
284
  msgid "A video list cannot be viewed within this feed - please view the original content"
285
  msgstr ""
286
 
287
- #: includes/aye-generate-embed-code.php:185
288
  msgid "Click here to view the video on YouTube"
289
  msgstr ""
290
 
@@ -292,379 +261,287 @@ msgstr ""
292
  msgid "No video ID has been supplied"
293
  msgstr ""
294
 
295
- #: includes/aye-generate-thumbnail-code.php:51
296
- #, php-format
297
- msgid "YouTube Video %s"
298
- msgstr ""
299
-
300
  #: includes/aye-generate-widgets.php:25
301
  msgid "Embed YouTube Widget."
302
  msgstr ""
303
 
304
- #: includes/aye-options-general.php:62
305
  #: includes/aye-options-lists.php:26
306
  msgid "Settings Saved."
307
  msgstr ""
308
 
309
- #: includes/aye-options-general.php:86
310
  msgid "Cache cleared."
311
  msgstr ""
312
 
313
- #: includes/aye-options-general.php:106
314
  msgid "These are the general settings for Artiss YouTube Embed. Please select <a href=\"admin.php?page=aye-profile-options\">Profiles</a> for default embedding settings."
315
  msgstr ""
316
 
317
- #: includes/aye-options-general.php:113
318
- msgid "Remove Adverts"
319
- msgstr ""
320
-
321
- #: includes/aye-options-general.php:114
322
- msgid "If you've <a href=\"http://www.artiss.co.uk/donate\">donated</a>, tick here to remove the adverts from these administration screens"
323
- msgstr ""
324
-
325
- #: includes/aye-options-general.php:119
326
  msgid "Embedding"
327
  msgstr ""
328
 
329
- #: includes/aye-options-general.php:123
330
  msgid "Add Metadata"
331
  msgstr ""
332
 
333
- #: includes/aye-options-general.php:124
334
- msgid "Allow rich metadata to be added to code. <a href=\"http://www.artiss.co.uk/youtube-embed/further-help#ye-metadata\">Learn more</a>"
335
  msgstr ""
336
 
337
- #: includes/aye-options-general.php:128
338
  msgid "Comment Embedding"
339
  msgstr ""
340
 
341
- #: includes/aye-options-general.php:129
342
- msgid "Allow YouTube URLs in comments - will display as embedded videos. <a href=\"http://www.artiss.co.uk/youtube-embed/further-help#ye-comments\">Learn more</a>"
343
  msgstr ""
344
 
345
- #: includes/aye-options-general.php:133
 
 
346
  #: includes/aye-options-general.php:174
347
- #: includes/aye-options-general.php:186
348
- #: includes/aye-options-general.php:207
349
  msgid "Profile to use"
350
  msgstr ""
351
 
352
- #: includes/aye-options-general.php:140
353
  msgid "Feed"
354
  msgstr ""
355
 
356
- #: includes/aye-options-general.php:142
357
  msgid "Text link"
358
  msgstr ""
359
 
360
- #: includes/aye-options-general.php:143
361
  msgid "Thumbnail"
362
  msgstr ""
363
 
364
- #: includes/aye-options-general.php:144
365
  msgid "Thumbnail &amp; Text Link"
366
  msgstr ""
367
 
368
- #: includes/aye-options-general.php:145
369
  msgid "Videos cannot be embedded in feeds. Select how you wish them to be shown instead"
370
  msgstr ""
371
 
372
- #: includes/aye-options-general.php:149
373
  msgid "Thumbnail to use"
374
  msgstr ""
375
 
376
- #: includes/aye-options-general.php:151
377
- #: includes/aye-shared-functions.php:481
378
  msgid "Default"
379
  msgstr ""
380
 
381
- #: includes/aye-options-general.php:152
382
  msgid "Default (HQ)"
383
  msgstr ""
384
 
385
- #: includes/aye-options-general.php:153
386
  msgid "Start"
387
  msgstr ""
388
 
389
- #: includes/aye-options-general.php:154
390
  msgid "Middle"
391
  msgstr ""
392
 
393
- #: includes/aye-options-general.php:155
394
  msgid "End"
395
  msgstr ""
396
 
397
- #: includes/aye-options-general.php:156
398
  msgid "Which thumbnail to use"
399
  msgstr ""
400
 
401
- #: includes/aye-options-general.php:160
402
- msgid "Allow shortcodes in widgets"
403
- msgstr ""
404
-
405
- #: includes/aye-options-general.php:161
406
- msgid "Allow shortcodes to be used in widgets - this will apply to <strong>all</strong> widgets"
407
- msgstr ""
408
-
409
- #: includes/aye-options-general.php:165
410
  msgid "Alternative Shortcodes"
411
  msgstr ""
412
 
413
- #: includes/aye-options-general.php:165
414
- msgid "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>"
415
- msgstr ""
416
-
417
- #: includes/aye-options-general.php:169
418
  msgid "Alternative Shortcode 1"
419
  msgstr ""
420
 
421
- #: includes/aye-options-general.php:181
422
  msgid "Alternative Shortcode 2"
423
  msgstr ""
424
 
425
- #: includes/aye-options-general.php:193
426
  msgid "Migration"
427
  msgstr ""
428
 
429
- #: includes/aye-options-general.php:193
430
- msgid "Switch on compatibility with other embedding plugins. For more details on migrating from another plugin, please <a href=\"http://www.artiss.co.uk/youtube-embed/compatibility\">click here</a>."
431
- msgstr ""
432
-
433
- #: includes/aye-options-general.php:197
434
  msgid "Bracket Embedding"
435
  msgstr ""
436
 
437
- #: includes/aye-options-general.php:198
438
  msgid "Allow embedding using URLs within brackets. Activating impacts performance"
439
  msgstr ""
440
 
441
- #: includes/aye-options-general.php:202
442
  msgid "Alternative Embedding"
443
  msgstr ""
444
 
445
- #: includes/aye-options-general.php:203
446
  msgid "Allow all other types of embedding. Activating impacts performance"
447
  msgstr ""
448
 
449
- #: includes/aye-options-general.php:210
450
  msgid "For above 2 options"
451
  msgstr ""
452
 
453
- #: includes/aye-options-general.php:214
454
  msgid "Admin Options"
455
  msgstr ""
456
 
457
- #: includes/aye-options-general.php:218
458
- msgid "Show Editor Button"
459
  msgstr ""
460
 
461
- #: includes/aye-options-general.php:219
462
  msgid "Show the YouTube button on the post editor"
463
  msgstr ""
464
 
465
- #: includes/aye-options-general.php:223
466
- msgid "Editor Button Shortcode"
467
- msgstr ""
468
-
469
- #: includes/aye-options-general.php:224
470
- msgid "Shortcode for editor button to use."
471
- msgstr ""
472
-
473
- #: includes/aye-options-general.php:228
474
  msgid "Add to Admin Bar"
475
  msgstr ""
476
 
477
- #: includes/aye-options-general.php:229
478
  msgid "Add link to options screen to Admin Bar"
479
  msgstr ""
480
 
481
- #: includes/aye-options-general.php:233
482
- msgid "Profiles Screen Access"
483
- msgstr ""
484
-
485
- #: includes/aye-options-general.php:235
486
- #: includes/aye-options-general.php:245
487
- msgid "Administrator"
488
- msgstr ""
489
-
490
- #: includes/aye-options-general.php:236
491
- #: includes/aye-options-general.php:246
492
- msgid "Editor"
493
- msgstr ""
494
-
495
- #: includes/aye-options-general.php:237
496
- #: includes/aye-options-general.php:247
497
- msgid "Author"
498
- msgstr ""
499
-
500
- #: includes/aye-options-general.php:238
501
- #: includes/aye-options-general.php:248
502
- msgid "Contributor"
503
- msgstr ""
504
-
505
- #: includes/aye-options-general.php:239
506
- msgid "Specify the user access required for the profiles screen"
507
- msgstr ""
508
-
509
- #: includes/aye-options-general.php:243
510
- msgid "Lists Screen Access"
511
- msgstr ""
512
-
513
- #: includes/aye-options-general.php:249
514
- msgid "Specify the user access required for the lists screen"
515
- msgstr ""
516
-
517
- #: includes/aye-options-general.php:253
518
  msgid "Profile &amp; List Sizes"
519
  msgstr ""
520
 
521
- #: includes/aye-options-general.php:257
522
  msgid "Number of Profiles"
523
  msgstr ""
524
 
525
- #: includes/aye-options-general.php:258
526
  msgid "Maximum number of profiles"
527
  msgstr ""
528
 
529
- #: includes/aye-options-general.php:262
530
  msgid "Number of Lists"
531
  msgstr ""
532
 
533
- #: includes/aye-options-general.php:263
534
  msgid "Maximum number of lists"
535
  msgstr ""
536
 
537
- #: includes/aye-options-general.php:267
538
  msgid "Performance"
539
  msgstr ""
540
 
541
- #: includes/aye-options-general.php:271
542
  msgid "Embed Cache"
543
  msgstr ""
544
 
545
- #: includes/aye-options-general.php:272
546
  msgid "How many hours to retain embed output. 0 to switch off"
547
  msgstr ""
548
 
549
- #: includes/aye-options-general.php:276
550
  msgid "Video Information Cache"
551
  msgstr ""
552
 
553
- #: includes/aye-options-general.php:277
554
  msgid "How many hours to retain video information, including it's validity. 0 to switch off"
555
  msgstr ""
556
 
557
- #: includes/aye-options-general.php:281
558
  msgid "Transcript Cache"
559
  msgstr ""
560
 
561
- #: includes/aye-options-general.php:282
562
  msgid "How many hours to store transcripts for in cache. 0 to switch off"
563
  msgstr ""
564
 
565
- #: includes/aye-options-general.php:291
566
- msgid "You currently have cache for"
567
- msgstr ""
568
-
569
- #: includes/aye-options-general.php:291
570
- msgid "and"
571
- msgstr ""
572
-
573
- #: includes/aye-options-general.php:295
574
  msgid "Clear Cache"
575
  msgstr ""
576
 
577
- #: includes/aye-options-general.php:296
578
- msgid "Select this option to remove all YouTube Embed cache."
 
579
  msgstr ""
580
 
581
- #: includes/aye-options-general.php:299
582
  msgid "YouTube API"
583
  msgstr ""
584
 
585
- #: includes/aye-options-general.php:301
586
  msgid "The YouTube API is used to validate video IDs and to determine if it is a video or playlist."
587
  msgstr ""
588
 
589
- #: includes/aye-options-general.php:305
590
  msgid "API State"
591
  msgstr ""
592
 
593
- #: includes/aye-options-general.php:307
594
  msgid "API should not be used"
595
  msgstr ""
596
 
597
- #: includes/aye-options-general.php:308
598
  msgid "HTTP API used and errors are reported"
599
  msgstr ""
600
 
601
- #: includes/aye-options-general.php:309
602
  msgid "HTTPS API used and errors are reported"
603
  msgstr ""
604
 
605
- #: includes/aye-options-general.php:310
606
  msgid "HTTP API used and no errors are reported"
607
  msgstr ""
608
 
609
- #: includes/aye-options-general.php:311
610
  msgid "HTTPS API used and no errors are reported"
611
  msgstr ""
612
 
613
- #: includes/aye-options-general.php:316
614
  msgid "Error Reporting"
615
  msgstr ""
616
 
617
- #: includes/aye-options-general.php:318
618
  msgid "Playback errors are within the XHTML source code as comments - parameter errors and other types are displayed on the post output."
619
  msgstr ""
620
 
621
- #: includes/aye-options-general.php:321
622
  msgid "Video Playback Error Message"
623
  msgstr ""
624
 
625
- #: includes/aye-options-general.php:322
626
  msgid "This is the message that will be shown on the post"
627
  msgstr ""
628
 
629
- #: includes/aye-options-general.php:325
630
  msgid "Security"
631
  msgstr ""
632
 
633
- #: includes/aye-options-general.php:330
634
  msgid "Privacy-Enhanced Mode"
635
  msgstr ""
636
 
637
- #: includes/aye-options-general.php:332
638
- msgid "Cookies should always be stored"
639
- msgstr ""
640
-
641
- #: includes/aye-options-general.php:333
642
- msgid "Cookies should never be stored"
643
- msgstr ""
644
-
645
- #: includes/aye-options-general.php:334
646
- msgid "Cookies should be stored based on user's Do Not Track setting"
647
  msgstr ""
648
 
649
- #: includes/aye-options-general.php:335
650
- msgid "Read more about <a href=\"http://donottrack.us/\">Do Not Track</a>"
651
- msgstr ""
652
-
653
- #: includes/aye-options-general.php:338
654
- msgid "Compatibility"
655
  msgstr ""
656
 
657
- #: includes/aye-options-general.php:341
658
  msgid "Allow Frame Border on IFRAME"
659
  msgstr ""
660
 
661
- #: includes/aye-options-general.php:342
662
  msgid "FRAMEBORDER is not HTML5 compliant"
663
  msgstr ""
664
 
665
- #: includes/aye-options-general.php:347
666
- #: includes/aye-options-lists.php:125
667
- #: includes/aye-options-profiles.php:351
668
  msgid "Save Settings"
669
  msgstr ""
670
 
@@ -676,72 +553,73 @@ msgstr ""
676
  msgid "Errors were found with your video list. See the list below for details."
677
  msgstr ""
678
 
679
- #: includes/aye-options-lists.php:94
680
  msgid "List"
681
  msgstr ""
682
 
683
- #: includes/aye-options-lists.php:104
684
  msgid "Change list"
685
  msgstr ""
686
 
687
- #: includes/aye-options-lists.php:107
688
  msgid "These are the options for list "
689
  msgstr ""
690
 
691
- #: includes/aye-options-lists.php:107
692
  msgid "Update the name, if required, and specify a list of YouTube video IDs. Use the drop-down on the right hand side to swap between lists."
693
  msgstr ""
694
 
695
- #: includes/aye-options-lists.php:112
696
  msgid "List name"
697
  msgstr ""
698
 
699
- #: includes/aye-options-lists.php:114
700
  msgid "The name you wish to give this list"
701
  msgstr ""
702
 
703
- #: includes/aye-options-lists.php:118
704
  msgid "Video IDs (one per line)"
705
  msgstr ""
706
 
707
- #: includes/aye-options-lists.php:136
708
- #: includes/aye-options-widgets.php:19
709
  msgid "Video ID"
710
  msgstr ""
711
 
712
- #: includes/aye-options-lists.php:136
 
713
  msgid "Video Title"
714
  msgstr ""
715
 
716
- #: includes/aye-options-lists.php:136
717
  msgid "Status"
718
  msgstr ""
719
 
720
- #: includes/aye-options-lists.php:152
721
  msgid "This is a playlist"
722
  msgstr ""
723
 
724
- #: includes/aye-options-lists.php:156
725
  msgid "Invalid video ID"
726
  msgstr ""
727
 
728
- #: includes/aye-options-lists.php:160
729
  msgid "YouTube API error"
730
  msgstr ""
731
 
732
- #: includes/aye-options-lists.php:163
733
  msgid "Valid video"
734
  msgstr ""
735
 
736
- #: includes/aye-options-lists.php:181
737
  msgid "The video ID is valid"
738
  msgstr ""
739
 
740
- #: includes/aye-options-lists.php:184
741
  msgid "The video ID is invalid"
742
  msgstr ""
743
 
744
- #: includes/aye-options-profiles.php:90
745
  msgid " Profile Saved."
746
  msgstr ""
747
 
@@ -780,19 +658,19 @@ msgstr ""
780
 
781
  #: includes/aye-options-profiles.php:140
782
  #: includes/aye-options-profiles.php:150
783
- #: includes/aye-options-profiles.php:329
784
- #: includes/aye-options-widgets.php:89
785
  msgid "IFRAME"
786
  msgstr ""
787
 
788
  #: includes/aye-options-profiles.php:140
789
- msgid "Uses AS3 Flash player, if Flash is available. Alternatively, uses HTML5 player. This is the current YouTube default."
790
  msgstr ""
791
 
792
  #: includes/aye-options-profiles.php:141
793
  #: includes/aye-options-profiles.php:151
794
- #: includes/aye-options-profiles.php:330
795
- #: includes/aye-options-widgets.php:91
796
  msgid "OBJECT"
797
  msgstr ""
798
 
@@ -801,22 +679,22 @@ msgid "Use the AS3 Flash player."
801
  msgstr ""
802
 
803
  #: includes/aye-options-profiles.php:142
804
- #: includes/aye-options-widgets.php:93
805
  msgid "Chromeless"
806
  msgstr ""
807
 
808
  #: includes/aye-options-profiles.php:142
809
- msgid "Use the <a href=\"http://www.artiss.co.uk/youtube-embed/further-help#ye-chromeless\">Chromeless</a> version of the AS3 Flash Player."
810
  msgstr ""
811
 
812
  #: includes/aye-options-profiles.php:143
813
- #: includes/aye-options-profiles.php:366
814
- #: includes/aye-options-widgets.php:95
815
  msgid "EmbedPlus"
816
  msgstr ""
817
 
818
  #: includes/aye-options-profiles.php:143
819
- msgid "Use <a href=\"http://www.artiss.co.uk/youtube-embed/further-help#ye-embedplus\">EmbedPlus</a>, if Flash is available."
820
  msgstr ""
821
 
822
  #: includes/aye-options-profiles.php:148
@@ -832,23 +710,15 @@ msgid "Options For All Player Types"
832
  msgstr ""
833
 
834
  #: includes/aye-options-profiles.php:160
835
- #: includes/aye-options-widgets.php:49
836
  msgid "Template"
837
  msgstr ""
838
 
839
- #: includes/aye-options-profiles.php:161
840
- msgid "Wrapper for video output. Must include <code>%video%</code> tag to show video position"
841
- msgstr ""
842
-
843
  #: includes/aye-options-profiles.php:165
844
- #: includes/aye-options-widgets.php:55
845
  msgid "Style"
846
  msgstr ""
847
 
848
- #: includes/aye-options-profiles.php:166
849
- msgid "CSS elements to apply to video"
850
- msgstr ""
851
-
852
  #: includes/aye-options-profiles.php:172
853
  msgid "Video size"
854
  msgstr ""
@@ -870,7 +740,7 @@ msgid "Select one of these default sizes to override the above video sizes"
870
  msgstr ""
871
 
872
  #: includes/aye-options-profiles.php:189
873
- #: includes/aye-options-widgets.php:73
874
  msgid "Dynamically Resize"
875
  msgstr ""
876
 
@@ -895,7 +765,7 @@ msgid "Only show the toolbar for audio only playback"
895
  msgstr ""
896
 
897
  #: includes/aye-options-profiles.php:207
898
- #: includes/aye-options-widgets.php:101
899
  msgid "Autoplay"
900
  msgstr ""
901
 
@@ -931,228 +801,220 @@ msgstr ""
931
  msgid "Controls"
932
  msgstr ""
933
 
934
- #: includes/aye-options-profiles.php:229
935
- msgid "Controls do not display &amp; Flash player loads immediately"
936
- msgstr ""
937
-
938
- #: includes/aye-options-profiles.php:230
939
- msgid "Controls display &amp; Flash player loads immediately"
940
- msgstr ""
941
-
942
- #: includes/aye-options-profiles.php:231
943
- msgid "Controls display &amp; Flash player loads once video starts"
944
  msgstr ""
945
 
946
  #: includes/aye-options-profiles.php:232
947
- msgid "Whether the video player controls will display. For AS3 player it also defines when the Flash player will load"
948
  msgstr ""
949
 
950
- #: includes/aye-options-profiles.php:237
951
  msgid "Use SSL? <a href=\"http://www.google.com/support/youtube/bin/answer.py?answer=171780&expand=UseHTTPS#HTTPS\">Read more</a>"
952
  msgstr ""
953
 
954
- #: includes/aye-options-profiles.php:241
955
- #: includes/aye-options-widgets.php:147
956
  msgid "Loop Video"
957
  msgstr ""
958
 
959
- #: includes/aye-options-profiles.php:242
960
  msgid "Play the initial video again and again. In the case of a playlist, this will play the entire playlist and then start again at the first video"
961
  msgstr ""
962
 
963
- #: includes/aye-options-profiles.php:246
964
  msgid "Information"
965
  msgstr ""
966
 
967
- #: includes/aye-options-profiles.php:247
968
- msgid "Display the video title and uploader before the video starts. If displaying a playlist this will show video thumbnails"
969
  msgstr ""
970
 
971
- #: includes/aye-options-profiles.php:251
972
- msgid "Related Videos"
973
  msgstr ""
974
 
975
- #: includes/aye-options-profiles.php:252
976
- msgid "Load related videos once playback starts. Also toggles the search option."
977
  msgstr ""
978
 
979
- #: includes/aye-options-profiles.php:256
980
- msgid "Theme"
981
  msgstr ""
982
 
983
- #: includes/aye-options-profiles.php:258
984
- msgid "Dark"
985
  msgstr ""
986
 
987
- #: includes/aye-options-profiles.php:259
988
- msgid "Light"
989
  msgstr ""
990
 
991
  #: includes/aye-options-profiles.php:260
992
- msgid "Display player controls within a dark or light control bar"
993
  msgstr ""
994
 
995
- #: includes/aye-options-profiles.php:264
996
- msgid "Progress Bar Colour"
 
 
 
 
997
  msgstr ""
998
 
999
  #: includes/aye-options-profiles.php:266
1000
- msgid "Red"
1001
  msgstr ""
1002
 
1003
- #: includes/aye-options-profiles.php:267
1004
- msgid "White (desaturated)"
1005
  msgstr ""
1006
 
1007
- #: includes/aye-options-profiles.php:268
1008
- msgid "The colour that will be used in the player's video progress bar to highlight the amount of the video that's already been seen"
1009
  msgstr ""
1010
 
1011
- #: includes/aye-options-profiles.php:272
1012
- msgid "Modest Branding"
1013
  msgstr ""
1014
 
1015
- #: includes/aye-options-profiles.php:273
1016
- msgid "Reduce branding on video."
1017
  msgstr ""
1018
 
1019
- #: includes/aye-options-profiles.php:278
1020
- msgid "Options for AS3 Player"
1021
  msgstr ""
1022
 
1023
- #: includes/aye-options-profiles.php:279
1024
- msgid "The following options are not supported if using EmbedPlus or if the IFRAME player uses HTML5."
1025
  msgstr ""
1026
 
1027
- #: includes/aye-options-profiles.php:283
1028
- msgid "Annotations"
1029
  msgstr ""
1030
 
1031
- #: includes/aye-options-profiles.php:284
1032
- msgid "Video annotations are shown by default"
1033
  msgstr ""
1034
 
1035
- #: includes/aye-options-profiles.php:288
1036
- msgid "Closed Captions"
1037
  msgstr ""
1038
 
1039
- #: includes/aye-options-profiles.php:289
1040
- msgid "Show closed captions (subtitles) by default, even if the user has turned captions off"
1041
  msgstr ""
1042
 
1043
  #: includes/aye-options-profiles.php:293
1044
- msgid "Disable Keyboard"
1045
  msgstr ""
1046
 
1047
  #: includes/aye-options-profiles.php:294
1048
- msgid "Disable the player keyboard controls"
1049
  msgstr ""
1050
 
1051
  #: includes/aye-options-profiles.php:298
1052
- msgid "Fullscreen"
1053
  msgstr ""
1054
 
1055
  #: includes/aye-options-profiles.php:299
1056
- msgid "A button will allow the viewer to watch the video fullscreen"
1057
  msgstr ""
1058
 
1059
  #: includes/aye-options-profiles.php:303
1060
- msgid "Link to YouTube"
1061
- msgstr ""
1062
-
1063
- #: includes/aye-options-profiles.php:304
1064
- msgid "Video links back to YouTube when clicked"
1065
- msgstr ""
1066
-
1067
- #: includes/aye-options-profiles.php:309
1068
  msgid "Options Not Supported by HTML5 Player"
1069
  msgstr ""
1070
 
1071
- #: includes/aye-options-profiles.php:313
1072
  msgid "Window Mode"
1073
  msgstr ""
1074
 
1075
- #: includes/aye-options-profiles.php:315
1076
  msgid "Opaque"
1077
  msgstr ""
1078
 
1079
- #: includes/aye-options-profiles.php:316
1080
  msgid "Transparent"
1081
  msgstr ""
1082
 
1083
- #: includes/aye-options-profiles.php:317
1084
  msgid "Window"
1085
  msgstr ""
1086
 
1087
- #: includes/aye-options-profiles.php:318
1088
  msgid "Sets the Window Mode property of the Flash movie for transparency, layering, and positioning in the browser. <a href=\"http://www.communitymx.com/content/article.cfm?cid=e5141\">Learn more</a>."
1089
  msgstr ""
1090
 
1091
- #: includes/aye-options-profiles.php:323
1092
  msgid "Options Only Supported By EmbedPlus"
1093
  msgstr ""
1094
 
1095
- #: includes/aye-options-profiles.php:323
1096
  msgid "Learn more about EmbedPlus"
1097
  msgstr ""
1098
 
1099
- #: includes/aye-options-profiles.php:327
1100
  msgid "Fallback Embed Type"
1101
  msgstr ""
1102
 
1103
- #: includes/aye-options-profiles.php:328
1104
  msgid "The type of player to use if Flash is not available and EmbedPlus cannot be used."
1105
  msgstr ""
1106
 
1107
- #: includes/aye-options-profiles.php:334
1108
  msgid "Play HD"
1109
  msgstr ""
1110
 
1111
- #: includes/aye-options-profiles.php:335
1112
  msgid "Play the video in HD if possible"
1113
  msgstr ""
1114
 
1115
- #: includes/aye-options-profiles.php:339
1116
  msgid "Real-time Reactions"
1117
  msgstr ""
1118
 
1119
- #: includes/aye-options-profiles.php:340
1120
  msgid "Show the Real-time Reactions button"
1121
  msgstr ""
1122
 
1123
- #: includes/aye-options-profiles.php:344
1124
  msgid "Sweet Spots"
1125
  msgstr ""
1126
 
1127
- #: includes/aye-options-profiles.php:345
1128
  msgid "Find sweet spots for the next and previous buttons"
1129
  msgstr ""
1130
 
1131
- #: includes/aye-options-profiles.php:355
1132
- msgid "Would you like the video below to be yours? <a href=\"http://www.artiss.co.uk/youtube-embed/further-help#ye-sponsorship\">Click here</a> for sponsorship information."
1133
  msgstr ""
1134
 
1135
- #: includes/aye-options-profiles.php:362
1136
  msgid "YouTube Video Sample"
1137
  msgstr ""
1138
 
1139
- #: includes/aye-options-profiles.php:363
1140
- msgid "The video below uses the above, saved profile settings. Use the drop-down below to change which parameters the video uses - press the Change Video button to update it."
1141
  msgstr ""
1142
 
1143
- #: includes/aye-options-profiles.php:365
 
 
 
 
1144
  msgid "Standard"
1145
  msgstr ""
1146
 
1147
- #: includes/aye-options-profiles.php:367
1148
  msgid "3D"
1149
  msgstr ""
1150
 
1151
- #: includes/aye-options-profiles.php:368
1152
  msgid "Playlist"
1153
  msgstr ""
1154
 
1155
- #: includes/aye-options-profiles.php:371
1156
  msgid "Change video"
1157
  msgstr ""
1158
 
@@ -1160,88 +1022,84 @@ msgstr ""
1160
  msgid "Widget Title"
1161
  msgstr ""
1162
 
1163
- #: includes/aye-options-widgets.php:27
1164
  msgid "ID Type"
1165
  msgstr ""
1166
 
1167
- #: includes/aye-options-widgets.php:29
1168
  msgid "Video or Playlist"
1169
  msgstr ""
1170
 
1171
- #: includes/aye-options-widgets.php:31
1172
  msgid "Search"
1173
  msgstr ""
1174
 
1175
- #: includes/aye-options-widgets.php:33
1176
  msgid "User"
1177
  msgstr ""
1178
 
1179
- #: includes/aye-options-widgets.php:41
1180
- #: includes/aye-shared-functions.php:488
1181
  msgid "Profile"
1182
  msgstr ""
1183
 
1184
- #: includes/aye-options-widgets.php:61
1185
  msgid "Size"
1186
  msgstr ""
1187
 
1188
- #: includes/aye-options-widgets.php:75
1189
- #: includes/aye-options-widgets.php:87
1190
- #: includes/aye-options-widgets.php:103
1191
- #: includes/aye-options-widgets.php:135
1192
- #: includes/aye-options-widgets.php:149
1193
  msgid "Profile default"
1194
  msgstr ""
1195
 
1196
- #: includes/aye-options-widgets.php:77
1197
- #: includes/aye-options-widgets.php:105
1198
- #: includes/aye-options-widgets.php:151
1199
  msgid "No"
1200
  msgstr ""
1201
 
1202
- #: includes/aye-options-widgets.php:79
1203
- #: includes/aye-options-widgets.php:107
1204
- #: includes/aye-options-widgets.php:153
1205
  msgid "Yes"
1206
  msgstr ""
1207
 
1208
- #: includes/aye-options-widgets.php:85
1209
  msgid "Embed Type"
1210
  msgstr ""
1211
 
1212
- #: includes/aye-options-widgets.php:113
1213
  msgid "Start (seconds)"
1214
  msgstr ""
1215
 
1216
- #: includes/aye-options-widgets.php:119
1217
  msgid "Stop (seconds)"
1218
  msgstr ""
1219
 
1220
- #: includes/aye-options-widgets.php:124
1221
  msgid "Non-EmbedPlus Options"
1222
  msgstr ""
1223
 
1224
- #: includes/aye-options-widgets.php:133
1225
  msgid "List Playback"
1226
  msgstr ""
1227
 
1228
- #: includes/aye-options-widgets.php:137
1229
  msgid "Play each video in order"
1230
  msgstr ""
1231
 
1232
- #: includes/aye-options-widgets.php:139
1233
  msgid "Play videos randomly"
1234
  msgstr ""
1235
 
1236
- #: includes/aye-options-widgets.php:141
1237
  msgid "Play one random video"
1238
  msgstr ""
1239
 
1240
- #: includes/aye-set-defaults.php:103
1241
- msgid "The video cannot be shown at the moment. Please try again later."
1242
- msgstr ""
1243
-
1244
- #: includes/aye-shared-functions.php:240
1245
  #, php-format
1246
  msgid "An error occurred accessing the YouTube API for video ID %s - %s"
1247
  msgstr ""
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: Artiss Currency Converter\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-05-18 16:19-0000\n"
6
+ "PO-Revision-Date: 2012-05-18 16:20-0000\n"
7
  "Last-Translator: David Artiss <david.artiss@artiss.co.uk>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
13
  "X-Poedit-Basepath: ../\n"
14
  "X-Poedit-SearchPath-0: .\n"
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  #: includes/aye-add-to-admin-bar.php:36
17
+ #: includes/aye-add-to-admin-bar.php:73
18
  msgid "YouTube Embed"
19
  msgstr ""
20
 
21
+ #: includes/aye-add-to-admin-bar.php:78
22
+ #: includes/aye-admin-config.php:88
 
 
 
 
 
23
  msgid "Options"
24
  msgstr ""
25
 
26
+ #: includes/aye-add-to-admin-bar.php:85
27
+ #: includes/aye-admin-config.php:98
28
  msgid "Profiles"
29
  msgstr ""
30
 
31
+ #: includes/aye-add-to-admin-bar.php:92
32
+ #: includes/aye-admin-config.php:108
33
  msgid "Lists"
34
  msgstr ""
35
 
36
+ #: includes/aye-add-to-admin-bar.php:99
37
+ #: includes/aye-admin-config.php:117
38
+ msgid "README"
39
+ msgstr ""
40
+
41
+ #: includes/aye-admin-config.php:29
42
  msgid "Settings"
43
  msgstr ""
44
 
45
+ #: includes/aye-admin-config.php:54
46
  msgid "Support"
47
  msgstr ""
48
 
49
+ #: includes/aye-admin-config.php:56
50
+ msgid "Donate"
51
+ msgstr ""
52
+
53
+ #: includes/aye-admin-config.php:82
54
+ msgid "Artiss YouTube Embed Settings"
55
  msgstr ""
56
 
57
+ #: includes/aye-admin-config.php:82
58
  msgid "YouTube"
59
  msgstr ""
60
 
61
+ #: includes/aye-admin-config.php:88
62
+ msgid "Artiss YouTube Embed Options"
 
63
  msgstr ""
64
 
65
+ #: includes/aye-admin-config.php:98
66
+ msgid "Artiss YouTube Embed Profiles"
67
  msgstr ""
68
 
69
+ #: includes/aye-admin-config.php:108
70
+ msgid "Artiss YouTube Embed Lists"
 
71
  msgstr ""
72
 
73
+ #: includes/aye-admin-config.php:117
74
+ msgid "Artiss YouTube Embed README"
75
  msgstr ""
76
 
77
+ #: includes/aye-admin-config.php:124
78
+ #: includes/aye-display-about.php:14
79
+ msgid "About Artiss YouTube Embed"
80
  msgstr ""
81
 
82
+ #: includes/aye-admin-config.php:124
83
+ msgid "About"
84
  msgstr ""
85
 
86
+ #: includes/aye-admin-config.php:246
87
+ #: includes/aye-admin-config.php:288
88
+ #: includes/aye-admin-config.php:331
89
+ #: includes/aye-admin-config.php:373
90
  msgid "Help"
91
  msgstr ""
92
 
93
+ #: includes/aye-admin-config.php:261
94
  msgid "This screen allows you to select non-specific options for the Artiss YouTube Embed plugin. For the default embedding settings, please select the <a href=\"admin.php?page=aye-profile-options\">Profiles</a> administration option."
95
  msgstr ""
96
 
97
+ #: includes/aye-admin-config.php:262
98
+ #: includes/aye-admin-config.php:304
99
+ #: includes/aye-admin-config.php:347
100
  msgid "Remember to click the Save Settings button at the bottom of the screen for new settings to take effect."
101
  msgstr ""
102
 
103
+ #: includes/aye-admin-config.php:263
104
+ #: includes/aye-admin-config.php:305
105
+ #: includes/aye-admin-config.php:348
106
+ #: includes/aye-admin-config.php:389
107
  msgid "For more information:"
108
  msgstr ""
109
 
110
+ #: includes/aye-admin-config.php:264
111
+ #: includes/aye-admin-config.php:306
112
+ #: includes/aye-admin-config.php:349
113
+ #: includes/aye-admin-config.php:390
114
  msgid "Artiss YouTube Embed Plugin Documentation"
115
  msgstr ""
116
 
117
+ #: includes/aye-admin-config.php:265
118
+ #: includes/aye-admin-config.php:307
119
+ #: includes/aye-admin-config.php:350
120
+ #: includes/aye-admin-config.php:391
121
  msgid "YouTube Player Documentation"
122
  msgstr ""
123
 
124
+ #: includes/aye-admin-config.php:266
125
+ #: includes/aye-admin-config.php:309
126
+ #: includes/aye-admin-config.php:351
127
+ #: includes/aye-admin-config.php:392
128
+ #: includes/aye-display-about.php:40
129
  msgid "This plugin, and all support, is supplied for free, but <a title=\"Donate\" href=\"http://artiss.co.uk/donate\" target=\"_blank\">donations</a> are always welcome."
130
  msgstr ""
131
 
132
+ #: includes/aye-admin-config.php:303
133
  msgid "This screen allows you to set the options for the default and additional profiles. If you don't specify a specific parameter when displaying your YouTube video then the default profile option will be used instead. Additional profiles, which you may name, can be used as well and used as required."
134
  msgstr ""
135
 
136
+ #: includes/aye-admin-config.php:308
137
  msgid "EmbedPlus website"
138
  msgstr ""
139
 
140
+ #: includes/aye-admin-config.php:346
141
  msgid "This screen allows you to create lists of YouTube videos, which may be named. These lists can then be used in preference to a single video ID."
142
  msgstr ""
143
 
144
+ #: includes/aye-admin-config.php:388
145
  msgid "This screen provides useful information about this plugin along with methods of support."
146
  msgstr ""
147
 
148
+ #: includes/aye-admin-config.php:450
149
  msgid "Welcome to Artiss YouTube Embed"
150
  msgstr ""
151
 
152
+ #: includes/aye-admin-config.php:451
153
  msgid "Thank you for installing this plugin."
154
  msgstr ""
155
 
156
+ #: includes/aye-admin-config.php:452
157
  msgid "These new menu options will allow you to configure your videos to just how you want them and provide links for help and support."
158
  msgstr ""
159
 
160
+ #: includes/aye-admin-config.php:453
161
  msgid "Even if you do nothing else, please visit the Profiles option to check your default video values."
162
  msgstr ""
163
 
165
  msgid "This function does not support playlists"
166
  msgstr ""
167
 
168
+ #: includes/aye-display-about.php:16
169
  #, php-format
170
  msgid "You are using Artiss YouTube Embed version %s. It was written by David Artiss."
171
  msgstr ""
172
 
173
+ #: includes/aye-display-about.php:22
 
 
 
 
174
  msgid "Copyrights"
175
  msgstr ""
176
 
177
+ #: includes/aye-display-about.php:24
178
  msgid "YouTube, and all associated logos, is the copyright of Google Inc."
179
  msgstr ""
180
 
181
+ #: includes/aye-display-about.php:26
182
  msgid "EmbedPlus is copyright. Read the <a href=\"http://embedplus.com/terms.aspx\" target=\"_blank\">Terms &amp; Conditions of Use</a>."
183
  msgstr ""
184
 
185
+ #: includes/aye-display-about.php:28
186
  msgid "Acknowledgements"
187
  msgstr ""
188
 
189
+ #: includes/aye-display-about.php:30
190
  msgid "Images have been compressed with <a href=\"http://www.smushit.com/ysmush.it/\">Smush.it</a>."
191
  msgstr ""
192
 
193
+ #: includes/aye-display-about.php:32
194
  msgid "JavaScript has been compressed with <a href=\"http://javascriptcompressor.com/\">JavaScript Compressor</a>."
195
  msgstr ""
196
 
197
+ #: includes/aye-display-about.php:34
198
  msgid "YouTube icons are courtesy of <a href=\"http://www.youtube.com/t/creators_downloads\">YouTube</a>. Other icons are by <a href=\"http://p.yusukekamiyamane.com/\">Yusuke Kamiyamane</a>."
199
  msgstr ""
200
 
201
+ #: includes/aye-display-about.php:36
202
  msgid "Support Information"
203
  msgstr ""
204
 
205
+ #: includes/aye-display-about.php:38
206
  msgid "Useful support information and links can be found by clicking on the Help tab at the top of each of the Artiss YouTube Embed administration screens."
207
  msgstr ""
208
 
209
+ #: includes/aye-display-about.php:42
210
  msgid "Stay in Touch"
211
  msgstr ""
212
 
213
+ #: includes/aye-display-about.php:44
214
  msgid "<a href=\"http://www.artiss.co.uk/wp-plugins\">See the full list</a> of Artiss plugins, including beta releases."
215
  msgstr ""
216
 
217
+ #: includes/aye-display-about.php:46
218
  msgid "<a href=\"http://www.twitter.com/artiss_tech\">Follow Artiss.co.uk</a> on Twitter."
219
  msgstr ""
220
 
221
+ #: includes/aye-display-about.php:48
222
  msgid "<a href=\"http://www.artiss.co.uk/feed\">Subscribe</a> to the Artiss.co.uk news feed."
223
  msgstr ""
224
 
225
+ #: includes/aye-display-readme.php:16
226
+ msgid " README"
227
+ msgstr ""
228
+
229
  #: includes/aye-function-calls.php:162
230
  #: includes/aye-function-calls.php:223
231
  #: includes/aye-generate-download-code.php:34
 
232
  #: includes/aye-generate-shorturl-code.php:34
233
+ #: includes/aye-generate-thumbnail-code.php:37
234
  #: includes/aye-generate-transcript-code.php:38
235
  #, php-format
236
  msgid "The YouTube ID of %s is invalid."
245
  msgid "No YouTube ID was found."
246
  msgstr ""
247
 
248
+ #: includes/aye-generate-embed-code.php:65
249
  msgid "No video/playlist ID has been supplied"
250
  msgstr ""
251
 
252
+ #: includes/aye-generate-embed-code.php:183
253
  msgid "A video list cannot be viewed within this feed - please view the original content"
254
  msgstr ""
255
 
256
+ #: includes/aye-generate-embed-code.php:187
257
  msgid "Click here to view the video on YouTube"
258
  msgstr ""
259
 
261
  msgid "No video ID has been supplied"
262
  msgstr ""
263
 
 
 
 
 
 
264
  #: includes/aye-generate-widgets.php:25
265
  msgid "Embed YouTube Widget."
266
  msgstr ""
267
 
268
+ #: includes/aye-options-general.php:57
269
  #: includes/aye-options-lists.php:26
270
  msgid "Settings Saved."
271
  msgstr ""
272
 
273
+ #: includes/aye-options-general.php:74
274
  msgid "Cache cleared."
275
  msgstr ""
276
 
277
+ #: includes/aye-options-general.php:87
278
  msgid "These are the general settings for Artiss YouTube Embed. Please select <a href=\"admin.php?page=aye-profile-options\">Profiles</a> for default embedding settings."
279
  msgstr ""
280
 
281
+ #: includes/aye-options-general.php:91
 
 
 
 
 
 
 
 
282
  msgid "Embedding"
283
  msgstr ""
284
 
285
+ #: includes/aye-options-general.php:95
286
  msgid "Add Metadata"
287
  msgstr ""
288
 
289
+ #: includes/aye-options-general.php:96
290
+ msgid "Allow rich metadata to be added to code. <a href=\"http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-metadata\">Learn more</a>"
291
  msgstr ""
292
 
293
+ #: includes/aye-options-general.php:100
294
  msgid "Comment Embedding"
295
  msgstr ""
296
 
297
+ #: includes/aye-options-general.php:101
298
+ msgid "Allow YouTube URLs in comments - will display as embedded videos. <a href=\"http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-comments\">Learn more</a>"
299
  msgstr ""
300
 
301
+ #: includes/aye-options-general.php:105
302
+ #: includes/aye-options-general.php:141
303
+ #: includes/aye-options-general.php:153
304
  #: includes/aye-options-general.php:174
 
 
305
  msgid "Profile to use"
306
  msgstr ""
307
 
308
+ #: includes/aye-options-general.php:112
309
  msgid "Feed"
310
  msgstr ""
311
 
312
+ #: includes/aye-options-general.php:114
313
  msgid "Text link"
314
  msgstr ""
315
 
316
+ #: includes/aye-options-general.php:115
317
  msgid "Thumbnail"
318
  msgstr ""
319
 
320
+ #: includes/aye-options-general.php:116
321
  msgid "Thumbnail &amp; Text Link"
322
  msgstr ""
323
 
324
+ #: includes/aye-options-general.php:117
325
  msgid "Videos cannot be embedded in feeds. Select how you wish them to be shown instead"
326
  msgstr ""
327
 
328
+ #: includes/aye-options-general.php:121
329
  msgid "Thumbnail to use"
330
  msgstr ""
331
 
332
+ #: includes/aye-options-general.php:123
333
+ #: includes/aye-shared-functions.php:425
334
  msgid "Default"
335
  msgstr ""
336
 
337
+ #: includes/aye-options-general.php:124
338
  msgid "Default (HQ)"
339
  msgstr ""
340
 
341
+ #: includes/aye-options-general.php:125
342
  msgid "Start"
343
  msgstr ""
344
 
345
+ #: includes/aye-options-general.php:126
346
  msgid "Middle"
347
  msgstr ""
348
 
349
+ #: includes/aye-options-general.php:127
350
  msgid "End"
351
  msgstr ""
352
 
353
+ #: includes/aye-options-general.php:128
354
  msgid "Which thumbnail to use"
355
  msgstr ""
356
 
357
+ #: includes/aye-options-general.php:132
 
 
 
 
 
 
 
 
358
  msgid "Alternative Shortcodes"
359
  msgstr ""
360
 
361
+ #: includes/aye-options-general.php:136
 
 
 
 
362
  msgid "Alternative Shortcode 1"
363
  msgstr ""
364
 
365
+ #: includes/aye-options-general.php:148
366
  msgid "Alternative Shortcode 2"
367
  msgstr ""
368
 
369
+ #: includes/aye-options-general.php:160
370
  msgid "Migration"
371
  msgstr ""
372
 
373
+ #: includes/aye-options-general.php:164
 
 
 
 
374
  msgid "Bracket Embedding"
375
  msgstr ""
376
 
377
+ #: includes/aye-options-general.php:165
378
  msgid "Allow embedding using URLs within brackets. Activating impacts performance"
379
  msgstr ""
380
 
381
+ #: includes/aye-options-general.php:169
382
  msgid "Alternative Embedding"
383
  msgstr ""
384
 
385
+ #: includes/aye-options-general.php:170
386
  msgid "Allow all other types of embedding. Activating impacts performance"
387
  msgstr ""
388
 
389
+ #: includes/aye-options-general.php:177
390
  msgid "For above 2 options"
391
  msgstr ""
392
 
393
+ #: includes/aye-options-general.php:181
394
  msgid "Admin Options"
395
  msgstr ""
396
 
397
+ #: includes/aye-options-general.php:185
398
+ msgid "Show YouTube Button"
399
  msgstr ""
400
 
401
+ #: includes/aye-options-general.php:186
402
  msgid "Show the YouTube button on the post editor"
403
  msgstr ""
404
 
405
+ #: includes/aye-options-general.php:190
 
 
 
 
 
 
 
 
406
  msgid "Add to Admin Bar"
407
  msgstr ""
408
 
409
+ #: includes/aye-options-general.php:191
410
  msgid "Add link to options screen to Admin Bar"
411
  msgstr ""
412
 
413
+ #: includes/aye-options-general.php:195
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
414
  msgid "Profile &amp; List Sizes"
415
  msgstr ""
416
 
417
+ #: includes/aye-options-general.php:199
418
  msgid "Number of Profiles"
419
  msgstr ""
420
 
421
+ #: includes/aye-options-general.php:200
422
  msgid "Maximum number of profiles"
423
  msgstr ""
424
 
425
+ #: includes/aye-options-general.php:204
426
  msgid "Number of Lists"
427
  msgstr ""
428
 
429
+ #: includes/aye-options-general.php:205
430
  msgid "Maximum number of lists"
431
  msgstr ""
432
 
433
+ #: includes/aye-options-general.php:209
434
  msgid "Performance"
435
  msgstr ""
436
 
437
+ #: includes/aye-options-general.php:213
438
  msgid "Embed Cache"
439
  msgstr ""
440
 
441
+ #: includes/aye-options-general.php:214
442
  msgid "How many hours to retain embed output. 0 to switch off"
443
  msgstr ""
444
 
445
+ #: includes/aye-options-general.php:218
446
  msgid "Video Information Cache"
447
  msgstr ""
448
 
449
+ #: includes/aye-options-general.php:219
450
  msgid "How many hours to retain video information, including it's validity. 0 to switch off"
451
  msgstr ""
452
 
453
+ #: includes/aye-options-general.php:223
454
  msgid "Transcript Cache"
455
  msgstr ""
456
 
457
+ #: includes/aye-options-general.php:224
458
  msgid "How many hours to store transcripts for in cache. 0 to switch off"
459
  msgstr ""
460
 
461
+ #: includes/aye-options-general.php:233
 
 
 
 
 
 
 
 
462
  msgid "Clear Cache"
463
  msgstr ""
464
 
465
+ #: includes/aye-options-general.php:234
466
+ #, php-format
467
+ msgid "Select this option to remove all YouTube Embed cache. You currently have %d cached video(s)"
468
  msgstr ""
469
 
470
+ #: includes/aye-options-general.php:238
471
  msgid "YouTube API"
472
  msgstr ""
473
 
474
+ #: includes/aye-options-general.php:240
475
  msgid "The YouTube API is used to validate video IDs and to determine if it is a video or playlist."
476
  msgstr ""
477
 
478
+ #: includes/aye-options-general.php:244
479
  msgid "API State"
480
  msgstr ""
481
 
482
+ #: includes/aye-options-general.php:246
483
  msgid "API should not be used"
484
  msgstr ""
485
 
486
+ #: includes/aye-options-general.php:247
487
  msgid "HTTP API used and errors are reported"
488
  msgstr ""
489
 
490
+ #: includes/aye-options-general.php:248
491
  msgid "HTTPS API used and errors are reported"
492
  msgstr ""
493
 
494
+ #: includes/aye-options-general.php:249
495
  msgid "HTTP API used and no errors are reported"
496
  msgstr ""
497
 
498
+ #: includes/aye-options-general.php:250
499
  msgid "HTTPS API used and no errors are reported"
500
  msgstr ""
501
 
502
+ #: includes/aye-options-general.php:255
503
  msgid "Error Reporting"
504
  msgstr ""
505
 
506
+ #: includes/aye-options-general.php:257
507
  msgid "Playback errors are within the XHTML source code as comments - parameter errors and other types are displayed on the post output."
508
  msgstr ""
509
 
510
+ #: includes/aye-options-general.php:260
511
  msgid "Video Playback Error Message"
512
  msgstr ""
513
 
514
+ #: includes/aye-options-general.php:261
515
  msgid "This is the message that will be shown on the post"
516
  msgstr ""
517
 
518
+ #: includes/aye-options-general.php:264
519
  msgid "Security"
520
  msgstr ""
521
 
522
+ #: includes/aye-options-general.php:267
523
  msgid "Privacy-Enhanced Mode"
524
  msgstr ""
525
 
526
+ #: includes/aye-options-general.php:268
527
+ msgid "When on, the player on this site will not store cookies"
 
 
 
 
 
 
 
 
528
  msgstr ""
529
 
530
+ #: includes/aye-options-general.php:271
531
+ msgid "Compatability"
 
 
 
 
532
  msgstr ""
533
 
534
+ #: includes/aye-options-general.php:274
535
  msgid "Allow Frame Border on IFRAME"
536
  msgstr ""
537
 
538
+ #: includes/aye-options-general.php:275
539
  msgid "FRAMEBORDER is not HTML5 compliant"
540
  msgstr ""
541
 
542
+ #: includes/aye-options-general.php:280
543
+ #: includes/aye-options-lists.php:119
544
+ #: includes/aye-options-profiles.php:345
545
  msgid "Save Settings"
546
  msgstr ""
547
 
553
  msgid "Errors were found with your video list. See the list below for details."
554
  msgstr ""
555
 
556
+ #: includes/aye-options-lists.php:88
557
  msgid "List"
558
  msgstr ""
559
 
560
+ #: includes/aye-options-lists.php:98
561
  msgid "Change list"
562
  msgstr ""
563
 
564
+ #: includes/aye-options-lists.php:101
565
  msgid "These are the options for list "
566
  msgstr ""
567
 
568
+ #: includes/aye-options-lists.php:101
569
  msgid "Update the name, if required, and specify a list of YouTube video IDs. Use the drop-down on the right hand side to swap between lists."
570
  msgstr ""
571
 
572
+ #: includes/aye-options-lists.php:106
573
  msgid "List name"
574
  msgstr ""
575
 
576
+ #: includes/aye-options-lists.php:108
577
  msgid "The name you wish to give this list"
578
  msgstr ""
579
 
580
+ #: includes/aye-options-lists.php:112
581
  msgid "Video IDs (one per line)"
582
  msgstr ""
583
 
584
+ #: includes/aye-options-lists.php:130
585
+ #: includes/aye-options-widgets.php:25
586
  msgid "Video ID"
587
  msgstr ""
588
 
589
+ #: includes/aye-options-lists.php:130
590
+ #: includes/aye-options-widgets.php:19
591
  msgid "Video Title"
592
  msgstr ""
593
 
594
+ #: includes/aye-options-lists.php:130
595
  msgid "Status"
596
  msgstr ""
597
 
598
+ #: includes/aye-options-lists.php:146
599
  msgid "This is a playlist"
600
  msgstr ""
601
 
602
+ #: includes/aye-options-lists.php:150
603
  msgid "Invalid video ID"
604
  msgstr ""
605
 
606
+ #: includes/aye-options-lists.php:154
607
  msgid "YouTube API error"
608
  msgstr ""
609
 
610
+ #: includes/aye-options-lists.php:157
611
  msgid "Valid video"
612
  msgstr ""
613
 
614
+ #: includes/aye-options-lists.php:175
615
  msgid "The video ID is valid"
616
  msgstr ""
617
 
618
+ #: includes/aye-options-lists.php:178
619
  msgid "The video ID is invalid"
620
  msgstr ""
621
 
622
+ #: includes/aye-options-profiles.php:98
623
  msgid " Profile Saved."
624
  msgstr ""
625
 
658
 
659
  #: includes/aye-options-profiles.php:140
660
  #: includes/aye-options-profiles.php:150
661
+ #: includes/aye-options-profiles.php:323
662
+ #: includes/aye-options-widgets.php:95
663
  msgid "IFRAME"
664
  msgstr ""
665
 
666
  #: includes/aye-options-profiles.php:140
667
+ msgid "Uses HTML5, if available. Alternatively, uses AS3 Flash player. This is the current YouTube default.."
668
  msgstr ""
669
 
670
  #: includes/aye-options-profiles.php:141
671
  #: includes/aye-options-profiles.php:151
672
+ #: includes/aye-options-profiles.php:324
673
+ #: includes/aye-options-widgets.php:97
674
  msgid "OBJECT"
675
  msgstr ""
676
 
679
  msgstr ""
680
 
681
  #: includes/aye-options-profiles.php:142
682
+ #: includes/aye-options-widgets.php:99
683
  msgid "Chromeless"
684
  msgstr ""
685
 
686
  #: includes/aye-options-profiles.php:142
687
+ msgid "Use the <a href=\"http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-chromeless\">Chromeless</a> version of the AS3 Flash Player."
688
  msgstr ""
689
 
690
  #: includes/aye-options-profiles.php:143
691
+ #: includes/aye-options-profiles.php:359
692
+ #: includes/aye-options-widgets.php:101
693
  msgid "EmbedPlus"
694
  msgstr ""
695
 
696
  #: includes/aye-options-profiles.php:143
697
+ msgid "Use <a href=\"http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-embedplus\">EmbedPlus</a>, if Flash is available."
698
  msgstr ""
699
 
700
  #: includes/aye-options-profiles.php:148
710
  msgstr ""
711
 
712
  #: includes/aye-options-profiles.php:160
713
+ #: includes/aye-options-widgets.php:55
714
  msgid "Template"
715
  msgstr ""
716
 
 
 
 
 
717
  #: includes/aye-options-profiles.php:165
718
+ #: includes/aye-options-widgets.php:61
719
  msgid "Style"
720
  msgstr ""
721
 
 
 
 
 
722
  #: includes/aye-options-profiles.php:172
723
  msgid "Video size"
724
  msgstr ""
740
  msgstr ""
741
 
742
  #: includes/aye-options-profiles.php:189
743
+ #: includes/aye-options-widgets.php:79
744
  msgid "Dynamically Resize"
745
  msgstr ""
746
 
765
  msgstr ""
766
 
767
  #: includes/aye-options-profiles.php:207
768
+ #: includes/aye-options-widgets.php:107
769
  msgid "Autoplay"
770
  msgstr ""
771
 
801
  msgid "Controls"
802
  msgstr ""
803
 
804
+ #: includes/aye-options-profiles.php:228
805
+ msgid "Video player controls will display"
 
 
 
 
 
 
 
 
806
  msgstr ""
807
 
808
  #: includes/aye-options-profiles.php:232
809
+ msgid "SSL"
810
  msgstr ""
811
 
812
+ #: includes/aye-options-profiles.php:233
813
  msgid "Use SSL? <a href=\"http://www.google.com/support/youtube/bin/answer.py?answer=171780&expand=UseHTTPS#HTTPS\">Read more</a>"
814
  msgstr ""
815
 
816
+ #: includes/aye-options-profiles.php:237
817
+ #: includes/aye-options-widgets.php:153
818
  msgid "Loop Video"
819
  msgstr ""
820
 
821
+ #: includes/aye-options-profiles.php:238
822
  msgid "Play the initial video again and again. In the case of a playlist, this will play the entire playlist and then start again at the first video"
823
  msgstr ""
824
 
825
+ #: includes/aye-options-profiles.php:242
826
  msgid "Information"
827
  msgstr ""
828
 
829
+ #: includes/aye-options-profiles.php:243
830
+ msgid "Display the video title and uploader before the video starts"
831
  msgstr ""
832
 
833
+ #: includes/aye-options-profiles.php:247
834
+ msgid "Theme"
835
  msgstr ""
836
 
837
+ #: includes/aye-options-profiles.php:249
838
+ msgid "Dark"
839
  msgstr ""
840
 
841
+ #: includes/aye-options-profiles.php:250
842
+ msgid "Light"
843
  msgstr ""
844
 
845
+ #: includes/aye-options-profiles.php:251
846
+ msgid "Display player controls within a dark or light control bar"
847
  msgstr ""
848
 
849
+ #: includes/aye-options-profiles.php:255
850
+ msgid "Options for AS3 Player"
851
  msgstr ""
852
 
853
  #: includes/aye-options-profiles.php:260
854
+ msgid "Annotations"
855
  msgstr ""
856
 
857
+ #: includes/aye-options-profiles.php:261
858
+ msgid "Video annotations are shown by default"
859
+ msgstr ""
860
+
861
+ #: includes/aye-options-profiles.php:265
862
+ msgid "Closed Captions"
863
  msgstr ""
864
 
865
  #: includes/aye-options-profiles.php:266
866
+ msgid "Show closed captions (subtitles) by default, even if the user has turned captions off"
867
  msgstr ""
868
 
869
+ #: includes/aye-options-profiles.php:270
870
+ msgid "Disable Keyboard"
871
  msgstr ""
872
 
873
+ #: includes/aye-options-profiles.php:271
874
+ msgid "Disable the player keyboard controls"
875
  msgstr ""
876
 
877
+ #: includes/aye-options-profiles.php:275
878
+ msgid "Fullscreen"
879
  msgstr ""
880
 
881
+ #: includes/aye-options-profiles.php:276
882
+ msgid "A button will allow the viewer to watch the video fullscreen"
883
  msgstr ""
884
 
885
+ #: includes/aye-options-profiles.php:280
886
+ msgid "Link to YouTube"
887
  msgstr ""
888
 
889
+ #: includes/aye-options-profiles.php:281
890
+ msgid "Video links back to YouTube when clicked"
891
  msgstr ""
892
 
893
+ #: includes/aye-options-profiles.php:285
894
+ msgid "Modest Branding"
895
  msgstr ""
896
 
897
+ #: includes/aye-options-profiles.php:286
898
+ msgid "Reduce branding on video."
899
  msgstr ""
900
 
901
+ #: includes/aye-options-profiles.php:290
902
+ msgid "Progress Bar Colour"
903
  msgstr ""
904
 
905
+ #: includes/aye-options-profiles.php:292
906
+ msgid "Red"
907
  msgstr ""
908
 
909
  #: includes/aye-options-profiles.php:293
910
+ msgid "White (desaturated)"
911
  msgstr ""
912
 
913
  #: includes/aye-options-profiles.php:294
914
+ msgid "The colour that will be used in the player's video progress bar to highlight the amount of the video that's already been seen"
915
  msgstr ""
916
 
917
  #: includes/aye-options-profiles.php:298
918
+ msgid "Related Videos"
919
  msgstr ""
920
 
921
  #: includes/aye-options-profiles.php:299
922
+ msgid "Load related videos once playback starts. Also toggles the search option."
923
  msgstr ""
924
 
925
  #: includes/aye-options-profiles.php:303
 
 
 
 
 
 
 
 
926
  msgid "Options Not Supported by HTML5 Player"
927
  msgstr ""
928
 
929
+ #: includes/aye-options-profiles.php:307
930
  msgid "Window Mode"
931
  msgstr ""
932
 
933
+ #: includes/aye-options-profiles.php:309
934
  msgid "Opaque"
935
  msgstr ""
936
 
937
+ #: includes/aye-options-profiles.php:310
938
  msgid "Transparent"
939
  msgstr ""
940
 
941
+ #: includes/aye-options-profiles.php:311
942
  msgid "Window"
943
  msgstr ""
944
 
945
+ #: includes/aye-options-profiles.php:312
946
  msgid "Sets the Window Mode property of the Flash movie for transparency, layering, and positioning in the browser. <a href=\"http://www.communitymx.com/content/article.cfm?cid=e5141\">Learn more</a>."
947
  msgstr ""
948
 
949
+ #: includes/aye-options-profiles.php:317
950
  msgid "Options Only Supported By EmbedPlus"
951
  msgstr ""
952
 
953
+ #: includes/aye-options-profiles.php:317
954
  msgid "Learn more about EmbedPlus"
955
  msgstr ""
956
 
957
+ #: includes/aye-options-profiles.php:321
958
  msgid "Fallback Embed Type"
959
  msgstr ""
960
 
961
+ #: includes/aye-options-profiles.php:322
962
  msgid "The type of player to use if Flash is not available and EmbedPlus cannot be used."
963
  msgstr ""
964
 
965
+ #: includes/aye-options-profiles.php:328
966
  msgid "Play HD"
967
  msgstr ""
968
 
969
+ #: includes/aye-options-profiles.php:329
970
  msgid "Play the video in HD if possible"
971
  msgstr ""
972
 
973
+ #: includes/aye-options-profiles.php:333
974
  msgid "Real-time Reactions"
975
  msgstr ""
976
 
977
+ #: includes/aye-options-profiles.php:334
978
  msgid "Show the Real-time Reactions button"
979
  msgstr ""
980
 
981
+ #: includes/aye-options-profiles.php:338
982
  msgid "Sweet Spots"
983
  msgstr ""
984
 
985
+ #: includes/aye-options-profiles.php:339
986
  msgid "Find sweet spots for the next and previous buttons"
987
  msgstr ""
988
 
989
+ #: includes/aye-options-profiles.php:349
990
+ msgid "Would you like the video below to be yours? <a href=\"http://www.artiss.co.uk/contact\">Contact me</a> for sponsorship information."
991
  msgstr ""
992
 
993
+ #: includes/aye-options-profiles.php:354
994
  msgid "YouTube Video Sample"
995
  msgstr ""
996
 
997
+ #: includes/aye-options-profiles.php:355
998
+ msgid "This uses the above settings, once they have been saved. <b>Would you like this to be your video? If so, <a href=\"http://www.artiss.co.uk/contact\">contact me</a>!</b>"
999
  msgstr ""
1000
 
1001
+ #: includes/aye-options-profiles.php:356
1002
+ msgid "Use the drop-down below to change which parameters the video uses - press the Change Video button to update it."
1003
+ msgstr ""
1004
+
1005
+ #: includes/aye-options-profiles.php:358
1006
  msgid "Standard"
1007
  msgstr ""
1008
 
1009
+ #: includes/aye-options-profiles.php:360
1010
  msgid "3D"
1011
  msgstr ""
1012
 
1013
+ #: includes/aye-options-profiles.php:361
1014
  msgid "Playlist"
1015
  msgstr ""
1016
 
1017
+ #: includes/aye-options-profiles.php:364
1018
  msgid "Change video"
1019
  msgstr ""
1020
 
1022
  msgid "Widget Title"
1023
  msgstr ""
1024
 
1025
+ #: includes/aye-options-widgets.php:33
1026
  msgid "ID Type"
1027
  msgstr ""
1028
 
1029
+ #: includes/aye-options-widgets.php:35
1030
  msgid "Video or Playlist"
1031
  msgstr ""
1032
 
1033
+ #: includes/aye-options-widgets.php:37
1034
  msgid "Search"
1035
  msgstr ""
1036
 
1037
+ #: includes/aye-options-widgets.php:39
1038
  msgid "User"
1039
  msgstr ""
1040
 
1041
+ #: includes/aye-options-widgets.php:47
1042
+ #: includes/aye-shared-functions.php:432
1043
  msgid "Profile"
1044
  msgstr ""
1045
 
1046
+ #: includes/aye-options-widgets.php:67
1047
  msgid "Size"
1048
  msgstr ""
1049
 
1050
+ #: includes/aye-options-widgets.php:81
1051
+ #: includes/aye-options-widgets.php:93
1052
+ #: includes/aye-options-widgets.php:109
1053
+ #: includes/aye-options-widgets.php:141
1054
+ #: includes/aye-options-widgets.php:155
1055
  msgid "Profile default"
1056
  msgstr ""
1057
 
1058
+ #: includes/aye-options-widgets.php:83
1059
+ #: includes/aye-options-widgets.php:111
1060
+ #: includes/aye-options-widgets.php:157
1061
  msgid "No"
1062
  msgstr ""
1063
 
1064
+ #: includes/aye-options-widgets.php:85
1065
+ #: includes/aye-options-widgets.php:113
1066
+ #: includes/aye-options-widgets.php:159
1067
  msgid "Yes"
1068
  msgstr ""
1069
 
1070
+ #: includes/aye-options-widgets.php:91
1071
  msgid "Embed Type"
1072
  msgstr ""
1073
 
1074
+ #: includes/aye-options-widgets.php:119
1075
  msgid "Start (seconds)"
1076
  msgstr ""
1077
 
1078
+ #: includes/aye-options-widgets.php:125
1079
  msgid "Stop (seconds)"
1080
  msgstr ""
1081
 
1082
+ #: includes/aye-options-widgets.php:130
1083
  msgid "Non-EmbedPlus Options"
1084
  msgstr ""
1085
 
1086
+ #: includes/aye-options-widgets.php:139
1087
  msgid "List Playback"
1088
  msgstr ""
1089
 
1090
+ #: includes/aye-options-widgets.php:143
1091
  msgid "Play each video in order"
1092
  msgstr ""
1093
 
1094
+ #: includes/aye-options-widgets.php:145
1095
  msgid "Play videos randomly"
1096
  msgstr ""
1097
 
1098
+ #: includes/aye-options-widgets.php:147
1099
  msgid "Play one random video"
1100
  msgstr ""
1101
 
1102
+ #: includes/aye-shared-functions.php:184
 
 
 
 
1103
  #, php-format
1104
  msgid "An error occurred accessing the YouTube API for video ID %s - %s"
1105
  msgstr ""
readme.txt CHANGED
@@ -3,15 +3,13 @@ Contributors: dartiss
3
  Donate link: http://artiss.co.uk/donate
4
  Tags: admin, annotations, artiss, automatic, editor, embed, embedding, embedplus, flash, flv, google, hd, height, iframe, manage, media, plugin, page, play, playlist, post, profile, responsive, search, sidebar, simple, smart, url, user, valid, video, widget, width, xhtml, youtube, youtuber
5
  Requires at least: 2.9
6
- Tested up to: 3.4.2
7
- Stable tag: 2.6.2
8
 
9
  A simple to use method of embedding YouTube videos into your posts and pages but with powerful features for those that need them.
10
 
11
  == Description ==
12
 
13
- **I'm looking at potentially removing some of the existing features to keep the plugin streamlined - please [vote](http://www.artiss.co.uk/youtube-embed/youtube-embed-features-vote "YouTube Embed Features Vote") on what you'd like me to keep and what you'd be happy for me to jettison!**
14
-
15
  Artiss YouTube Embed (formally YouTube Embed) is an incredibly simple, yet powerful, method of embedding YouTube videos into your WordPress site. Options include:
16
 
17
  * XHTML and HTML5 compliant - works with all the latest browsers
@@ -25,7 +23,6 @@ Artiss YouTube Embed (formally YouTube Embed) is an incredibly simple, yet power
25
  * Code is cached for maximum performance
26
  * Using a different YouTube plugin? Documentation and tools are provided to help you migrate to Artiss YouTube Embed
27
  * Fully internationalized ready for translations. **If you would like to add a translation to his plugin then please [contact me](http://artiss.co.uk/contact "Contact")**
28
- * Support for Do Not Track
29
  * And much, much more!
30
 
31
  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!
@@ -63,27 +60,28 @@ The following parameters work with all embed types:
63
  * **start** - a number of seconds from where to start the video playing
64
  * **style** - apply CSS elements directly to the video output
65
  * **template** - specify a template (see section on Templates for further details)
 
66
  * **type** - which embedding type to use, this can be `embedplus`, `iframe`, `object` or `chromeless`
67
  * **width** - the video width, in pixels
68
 
69
  The following parameters will not work with EmbedPlus:
70
 
71
  * **autohide** - 0, 1 or 2, this parameter indicates whether the video controls will automatically hide after a video begins playing. The default behaviour, a value of 2, is for the video progress bar to fade out while the player controls (play button, volume control, etc.) remain visible. If this parameter is set to 0, the video progress bar and the video player controls will be visible throughout the video. If this parameter is set to 1, then the video progress bar and the player controls will slide out of view a couple of seconds after the video starts playing. They will only reappear if the user moves her mouse over the video player or presses a key on her keyboard.
72
- * **color** - white or red, the colour of the progress bar (see the FAQ about having a white progress bar with the light theme)
73
- * **controls** - 0, 1 or 2, this decides whether the controls should display and when the Flash will load. A value of 0 will not show the controls but 1 or 2 will. A value of 2 will load Flash once the user initiates playback - otherwise it's loaded straight away.
74
  * **https** - yes or no, whether to use HTTPS for the video
75
- * **info** - yes or no, show video information. If displaying a playlist this will show video thumbnails
76
  * **loop** - yes or no, whether to start the video again once it ends
77
- * **related** - yes or no, show related videos
78
  * **theme** - dark or light, display player controls (like a 'play' button or volume control) within a dark or light control bar
79
 
80
  The following parameters will not work with EmbedPlus or if IFRAME uses HTML5:
81
 
82
  * **annotation** - yes or no, this determines if annotations are shown
83
  * **cc** - yes or no, decided whether closed captions (subtitles) are displayed
 
84
  * **disablekb** - yes or no, disable keyboard controls
85
  * **fullscreen** - yes or no, this will add the fullscreen button to the toolbar. This also works with EmbedPlus.
86
  * **link** - yes or no, link video to YouTube
 
87
  * **search** - yes or no, create a playlist based on a search word. The search word should be specified instead of a video ID. See "Automatically Generate Playlists" option for more details
88
  * **user** - yes or no, create a playlist based on a user's uploads. The search word should be specified instead of a video ID. See "Automatically Generate Playlists" option for more details
89
 
@@ -142,7 +140,7 @@ The template consists simply of any HTML that you wish but with `%video%` where
142
 
143
  e.g. `<div align="center">%video%</div>`
144
 
145
- Be wary that when adding template via a parameter that any HTML included may cause your video to have `<pre>` tags wrapped around it. The easiest way to check and fix this is to view any post in the HTML editor and remove any PRE tags that have been added.
146
 
147
  == Profiles ==
148
 
@@ -202,7 +200,7 @@ The second option, `Alternative Embedding`, activates a short of other alternati
202
 
203
  In both cases, activating these will impact performance so should only be used if absolutely necessary.
204
 
205
- [Read more details](http://www.artiss.co.uk/youtube-embed/compatibility "Artiss YouTube Embed Compatibility") on which options to select for which plugin.
206
 
207
  == Further options ==
208
 
@@ -210,11 +208,9 @@ In both cases, activating these will impact performance so should only be used i
210
 
211
  Artiss YouTube embed also has the ability to return a thumbnail of a video (sorry, this doesn't work with playlists). There are two methods you can use for this - a shortcode or a function call.
212
 
213
- Use the function call `youtube_thumb_embed( 'id', 'paras', '', 'alt', 'nolink' )` to add a thumbnail to any part of your theme.
214
 
215
- Like the video embed equivalent, the `id` is the video ID and `alt` is the alternative text for the thumbnail image (optional). `nolink`, if set to `true`, will output the thumbnail without a link to the YouTube video, allowing you to add your own.
216
-
217
- The parameters are different, however, but, again, are separated by ampersand.
218
 
219
  The parameters are as follows...
220
 
@@ -236,8 +232,6 @@ e.g. `[youtube_thumb target="_blank" alt="Demo video"]id[/youtube_thumb]`
236
 
237
  This overrides the `TARGET` and `ALT` elements of the thumbnail.
238
 
239
- You can also use `nolink` as a parameter with the shortcode, which works in the same way as with the function call.
240
-
241
  **Video name**
242
 
243
  You can retrieve the name of a video via 1 of 2 methods.
@@ -314,8 +308,6 @@ For problems, suggestions or enhancements for this plugin, there is [a dedicated
314
 
315
  == Reviews & Mentions ==
316
 
317
- [Your YouTube Plugin is fantastic�it just saved my life on this site. Thank you!](https://twitter.com/AaronWatters/status/237957701605404672?uid=16257815&iid=am-130280753913455685118891763&nid=4+248 "Twitter - Aaron Watters") - Sonic Clamp.
318
-
319
  [New Technology Finds The Most Buzzed-About Parts Of Videos](http://www.socialtimes.com/2011/03/new-technology-finds-the-most-buzzed-about-parts-of-videos-interview/ "New Technology Finds The Most Buzzed-About Parts Of Videos") - SocialTimes.
320
 
321
  [Andesch tips on WordPress plugins!](http://andershagstrom.se/andesch-tipsar-om-wordpress-plugins/ "Andesch tipsar om WordPress-plugins!") - Anders.
@@ -345,7 +337,7 @@ Artiss YouTube Embed is now using the latest version of the YouTube Player, name
345
 
346
  Equally, some options are not supported depending on whether you use the IFRAME or OBJECT embedding method.
347
 
348
- [Read more about which options are supported](http://www.artiss.co.uk/youtube-embed/further-help#ye-api "API Support").
349
 
350
  = How do I add a border to the video =
351
 
@@ -385,7 +377,7 @@ If you don't include Metadata then it will also validate as HTML5 compliant.
385
 
386
  The [W3C Markup Validation Service](http://validator.w3.org/ "W3C Markup Validation Service") was used to test the above.
387
 
388
- You can [read more about this here](http://www.artiss.co.uk/youtube-embed/further-help#ye-standards "Standards Compliance").
389
 
390
  = Which browsers does the output work on? =
391
 
@@ -421,12 +413,6 @@ Next to the option it will display how many videos have cache in the database. I
421
 
422
  Please note - clearing the cache will not just remove any redundant cache as there is no way to identify what is required and what is not. It will therefore remove all cache related to YouTube Embed, therefore having a temporary performance impact on your site as displayed videos are generated and cached again.
423
 
424
- = Is this plugin compatible with Turn Off The Lights? =
425
-
426
- If you display the video responsively then it doesn't work with [Turn Off The Lights](http://www.stefanvd.net/project/turnoffthelights.htm "Turn Off The Lights"). Switch this option off and it will.
427
-
428
- I've raised this with the developer of Turn Off The Lights and he is going to implement a change in the future to improve compatibility with responsive video.
429
-
430
  = Which version of PHP does this plugin work with? =
431
 
432
  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.
@@ -439,75 +425,12 @@ Although I attempt to keep with PHP 4 compatibility there are no guarantees of t
439
  2. The main options screen
440
  3. The profiles screen
441
  4. The lists screen - videos have been added and validated. The drop-down help is also shown
442
- 5. The default widget options
443
- 6. The default visual editor options with the YouTube Embed button
 
444
 
445
  == Changelog ==
446
 
447
- = 2.6.2 =
448
- * Bug: Fixed bug in uninstall routine
449
- * Enhancement: Replaced user of print_r in cache key generator with serialize, as this can cause problems with some hosting configurations
450
-
451
- = 2.6.1 =
452
- * Bug: Fixed minimised script that adds editor button
453
- * Bug: Updated broken advert links
454
- * Bug: Fixed link in admin bar when using WP 3.1 - 3.3
455
- * Bug: Removed un-necessary cookie update that was causing errors in some situations
456
- * Maintenance: Updated WP 3.3+ admin bar options to correctly reflect permissions, naming and ordering of equivalent admin menu
457
-
458
- = 2.6 =
459
- * Bug: Fixed a bug that means videos have zero width on new installations until the default profile is updated (thanks to Aidan from [Noise Republic](http://www.noiserepublic.co.uk "Noise Republic") for reporting that)
460
- * Bug: Corrected URLs pointing to help screens at artiss.co.uk
461
- * Bug: Resolved issue where translated IDs were not corrected if included in a URL (thanks to kchayka for reporting that)
462
- * Bug: Fixed problem where video ID is not found in full URL if not specified first (thanks to christopherw for reporting that)
463
- * Bug: Modest branding profile switch wasn't doing anything - the option was hard-coded on. Now corrected
464
- * Bug: User defined error message now decodes correctly (thanks to kchayka for reporting that)
465
- * Bug: No longer caches the video output if a random playlist has been selected
466
- * Maintenance: Updated advertisement engine code
467
- * Maintenance: Renamed README menu to Instructions
468
- * Maintenance: Assorted on-screen wording improvements
469
- * Maintenance: Removed title option as it's un-supported
470
- * Maintenance: Updated the uninstall routine
471
- * Maintenance: Cleaned code and updated translation files
472
- * Enhancement: Added Do Not Track compatibility. Once active, if user has Do Not Track in use then cookies will not be stored
473
- * Enhancement: New option to specify the shortcode that the editor button uses. A cookie is used to store this
474
- * Enhancement: New option to switch on shortcodes in widgets. This will allow all shortcodes in widgets, though, not just those for this plugin
475
- * Enhancement: Reviewed and updated access right to admin screen. Added option to choose what level has access to profiles and/or lists screen
476
- * Enhancement: Many functions were only activated if user was not in Administration screens. However, using AJAX on your site triggers the administration flag and, hence, the functions would not work. Changed this
477
- * Enhancement: Added option to modify access to Profile and Lists screen
478
- * Enhancement: Improved the cache clearing option and statistics
479
- * Enhancement: Reflected on profile screen that modest branding now works with HTML5 player
480
- * Enhancement: Added option to thumbnail output to suppress the link, so that you can add your own
481
- * Enhancement: Updated "Controls" option to support new third parameter and update definitions. Ensured backwards compatibility with old parameter options
482
-
483
- = 2.5.6 =
484
- * Maintenance: Restricted access to Options and Profiles screen to administrators
485
- * Bug: Fixed bug which caused errors to be generated on new installations of plugin
486
- * Enhancement: Set a default width if the `content_width` global variable is set to zero
487
-
488
- = 2.5.5 =
489
- * Maintenance: Updated sponsorship - now includes option to switch off if user has donated
490
- * Maintenance: Updated options screen to reflect the fact that the `related` and `color` parameters are now supported by the HTML5 player
491
- * Maintenance: Updated options screen to show that the `info` parameter, if used alongside a playlist will show thumbnails of the videos
492
- * Maintenance: Removed redundant GA code, which was never used
493
- * Maintenance: Combined scripts
494
- * Bug: Fixed internationalisation
495
- * Bug: Fixed output of video information on the Lists option screen
496
- * Bug: Modified cache key so that length does not exceed MySQL field maximum
497
- * Bug: Added close anchor for media meta - causes unclosed anchor under IE9 (thanks to Marcel Bootsman for identifying this)
498
- * Bug: Responsive video was not working on a demonstration video in Profile screen
499
-
500
- = 2.5.4 =
501
- * Bug: Fixed bug that prevented some fields in options screens to not save
502
-
503
- = 2.5.3 =
504
- * Bug: Fixed further issues with the widget code (thanks to Rose-Anne Constantineau for reporting it and helping me test the result)
505
- * Maintenance: Improved some of the internationalisation texts
506
- * Maintenance: Neatened up some of the code output
507
-
508
- = 2.5.2 =
509
- * Bug: Fixed a bug where widgets weren't showing single videos (thanks to Josh Callaghan for reporting this)
510
-
511
  = 2.5.1 =
512
  * Bug: Fixed a bug with Admin Bar when using WP 3.1 - 3.3 (thanks to Carl D'Halluin for finding this)
513
 
@@ -675,30 +598,6 @@ Although I attempt to keep with PHP 4 compatibility there are no guarantees of t
675
 
676
  == Upgrade Notice ==
677
 
678
- = 2.6.2 =
679
- * Update to fix an uninstaller bug and a problem that may affect some hosts
680
-
681
- = 2.6.1 =
682
- * Update to fix some bugs introduced in 2.6
683
-
684
- = 2.6 =
685
- * Upgrade to implement numerous bug fixes and enhancements
686
-
687
- = 2.5.6 =
688
- * Upgrade to fix critical bug for new installations
689
-
690
- = 2.5.5 =
691
- * Upgrade for various bug fixes and maintenance updates
692
-
693
- = 2.5.4 =
694
- * Upgrade to fix an issue with options not updating
695
-
696
- = 2.5.3 =
697
- * Upgrade to fix issues with widgets
698
-
699
- = 2.5.2 =
700
- * Upgrade if you use widgets to display videos
701
-
702
  = 2.5.1 =
703
  * Upgrade if you are using a WordPress version before 3.3
704
 
3
  Donate link: http://artiss.co.uk/donate
4
  Tags: admin, annotations, artiss, automatic, editor, embed, embedding, embedplus, flash, flv, google, hd, height, iframe, manage, media, plugin, page, play, playlist, post, profile, responsive, search, sidebar, simple, smart, url, user, valid, video, widget, width, xhtml, youtube, youtuber
5
  Requires at least: 2.9
6
+ Tested up to: 3.3.1
7
+ Stable tag: 2.5.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
 
11
  == Description ==
12
 
 
 
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
23
  * Code is cached for maximum performance
24
  * Using a different YouTube plugin? Documentation and tools are provided to help you migrate to Artiss YouTube Embed
25
  * Fully internationalized ready for translations. **If you would like to add a translation to his plugin then please [contact me](http://artiss.co.uk/contact "Contact")**
 
26
  * And much, much more!
27
 
28
  It has all the features of other similar plugins - Smart YouTube, for instance. In fact if there's a feature in another YouTube embedding plugin that this doesn't have, let me know - I haven't come across it!
60
  * **start** - a number of seconds from where to start the video playing
61
  * **style** - apply CSS elements directly to the video output
62
  * **template** - specify a template (see section on Templates for further details)
63
+ * **title** - the title of the video
64
  * **type** - which embedding type to use, this can be `embedplus`, `iframe`, `object` or `chromeless`
65
  * **width** - the video width, in pixels
66
 
67
  The following parameters will not work with EmbedPlus:
68
 
69
  * **autohide** - 0, 1 or 2, this parameter indicates whether the video controls will automatically hide after a video begins playing. The default behaviour, a value of 2, is for the video progress bar to fade out while the player controls (play button, volume control, etc.) remain visible. If this parameter is set to 0, the video progress bar and the video player controls will be visible throughout the video. If this parameter is set to 1, then the video progress bar and the player controls will slide out of view a couple of seconds after the video starts playing. They will only reappear if the user moves her mouse over the video player or presses a key on her keyboard.
70
+ * **controls** - yes or no, should the controls be shown?
 
71
  * **https** - yes or no, whether to use HTTPS for the video
72
+ * **info** - yes or no, show video information
73
  * **loop** - yes or no, whether to start the video again once it ends
 
74
  * **theme** - dark or light, display player controls (like a 'play' button or volume control) within a dark or light control bar
75
 
76
  The following parameters will not work with EmbedPlus or if IFRAME uses HTML5:
77
 
78
  * **annotation** - yes or no, this determines if annotations are shown
79
  * **cc** - yes or no, decided whether closed captions (subtitles) are displayed
80
+ * **color** - white or red, the colour of the progress bar (see the FAQ about having a white progress bar with the light theme)
81
  * **disablekb** - yes or no, disable keyboard controls
82
  * **fullscreen** - yes or no, this will add the fullscreen button to the toolbar. This also works with EmbedPlus.
83
  * **link** - yes or no, link video to YouTube
84
+ * **related** - yes or no, show related videos
85
  * **search** - yes or no, create a playlist based on a search word. The search word should be specified instead of a video ID. See "Automatically Generate Playlists" option for more details
86
  * **user** - yes or no, create a playlist based on a user's uploads. The search word should be specified instead of a video ID. See "Automatically Generate Playlists" option for more details
87
 
140
 
141
  e.g. `<div align="center">%video%</div>`
142
 
143
+ Be wary that when adding template via a parameter that any HTML included may cause your video to have <pre> tags wrapped around it. The easiest way to check and fix this is to view any post in the HTML editor and remove any PRE tags that have been added.
144
 
145
  == Profiles ==
146
 
200
 
201
  In both cases, activating these will impact performance so should only be used if absolutely necessary.
202
 
203
+ [Read more details](http://www.artiss.co.uk/artiss-youtube-embed/compatibility "Artiss YouTube Embed Compatibility") on which options to select for which plugin.
204
 
205
  == Further options ==
206
 
208
 
209
  Artiss YouTube embed also has the ability to return a thumbnail of a video (sorry, this doesn't work with playlists). There are two methods you can use for this - a shortcode or a function call.
210
 
211
+ Use the function call `youtube_thumb_embed( 'id', 'paras', '', 'alt' )` to add a thumbnail to any part of your theme.
212
 
213
+ Like the video embed equivalent, the ID is the video ID and alt is the alternative text for the thumbnail image (optional). The parameters are different, however, but, again, are separated by ampersand.
 
 
214
 
215
  The parameters are as follows...
216
 
232
 
233
  This overrides the `TARGET` and `ALT` elements of the thumbnail.
234
 
 
 
235
  **Video name**
236
 
237
  You can retrieve the name of a video via 1 of 2 methods.
308
 
309
  == Reviews & Mentions ==
310
 
 
 
311
  [New Technology Finds The Most Buzzed-About Parts Of Videos](http://www.socialtimes.com/2011/03/new-technology-finds-the-most-buzzed-about-parts-of-videos-interview/ "New Technology Finds The Most Buzzed-About Parts Of Videos") - SocialTimes.
312
 
313
  [Andesch tips on WordPress plugins!](http://andershagstrom.se/andesch-tipsar-om-wordpress-plugins/ "Andesch tipsar om WordPress-plugins!") - Anders.
337
 
338
  Equally, some options are not supported depending on whether you use the IFRAME or OBJECT embedding method.
339
 
340
+ [Read more about which options are supported](http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-api "API Support").
341
 
342
  = How do I add a border to the video =
343
 
377
 
378
  The [W3C Markup Validation Service](http://validator.w3.org/ "W3C Markup Validation Service") was used to test the above.
379
 
380
+ You can [read more about this here](http://www.artiss.co.uk/artiss-youtube-embed/further-help#ye-standards "Standards Compliance").
381
 
382
  = Which browsers does the output work on? =
383
 
413
 
414
  Please note - clearing the cache will not just remove any redundant cache as there is no way to identify what is required and what is not. It will therefore remove all cache related to YouTube Embed, therefore having a temporary performance impact on your site as displayed videos are generated and cached again.
415
 
 
 
 
 
 
 
416
  = Which version of PHP does this plugin work with? =
417
 
418
  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.
425
  2. The main options screen
426
  3. The profiles screen
427
  4. The lists screen - videos have been added and validated. The drop-down help is also shown
428
+ 5. The About screen
429
+ 6. The default widget options
430
+ 7. The default visual editor options with the YouTube Embed button
431
 
432
  == Changelog ==
433
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
434
  = 2.5.1 =
435
  * Bug: Fixed a bug with Admin Bar when using WP 3.1 - 3.3 (thanks to Carl D'Halluin for finding this)
436
 
598
 
599
  == Upgrade Notice ==
600
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
601
  = 2.5.1 =
602
  * Upgrade if you are using a WordPress version before 3.3
603
 
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png CHANGED
Binary file
screenshot-4.png CHANGED
Binary file
screenshot-5.png CHANGED
Binary file
screenshot-6.png CHANGED
Binary file
screenshot-7.png ADDED
Binary file
uninstall.php CHANGED
@@ -9,20 +9,18 @@
9
  */
10
 
11
  // If the uninstall was not called by WordPress, exit
12
-
13
- if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) { exit(); }
 
14
 
15
  // Read the general options (will tell us how many profile and list options there should be
16
-
17
  $options = get_option( 'youtube_embed_general' );
18
 
19
  // If the general options existed, delete it!
20
-
21
  if ( is_array( $options ) ) {
22
  delete_option( 'youtube_embed_general' );
23
 
24
  // If the number of profiles field exists, delete each one in turn
25
-
26
  if ( array_key_exists( 'profile_no', $options ) ) {
27
  $loop = 0;
28
  while ( $loop <= $options[ 'profile_no' ] ) {
@@ -32,7 +30,6 @@ if ( is_array( $options ) ) {
32
  }
33
 
34
  // If the number of lists field exists, delete each one in turn
35
-
36
  if ( !array_key_exists( 'list_no', $options ) ) {
37
  $loop = 1;
38
  while ( $loop <= $options[ 'list_no' ] ) {
@@ -43,20 +40,8 @@ if ( is_array( $options ) ) {
43
  }
44
 
45
  // Delete all other options
46
-
47
  delete_option( 'widget_youtube_embed_widget' );
48
-
49
- delete_option( 'youtube_embed_general' );
50
  delete_option( 'youtube_embed_shortcode' );
51
  delete_option( 'youtube_embed_url' );
52
- delete_option( 'youtube_embed_editor_sc' );
53
  delete_option( 'youtube_embed_activated' );
54
-
55
- // Delete cookie
56
-
57
- $path = str_replace( 'http://', '', site_url( '/', 'http' ) );
58
- $pos = strpos( $path, '/' );
59
- $path = substr( $path, $pos ) . 'wp-content/';
60
-
61
- setcookie( 'aye_mce_shortcode', '', time() - 3600, $path );
62
  ?>
9
  */
10
 
11
  // If the uninstall was not called by WordPress, exit
12
+ if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
13
+ exit();
14
+ }
15
 
16
  // Read the general options (will tell us how many profile and list options there should be
 
17
  $options = get_option( 'youtube_embed_general' );
18
 
19
  // If the general options existed, delete it!
 
20
  if ( is_array( $options ) ) {
21
  delete_option( 'youtube_embed_general' );
22
 
23
  // If the number of profiles field exists, delete each one in turn
 
24
  if ( array_key_exists( 'profile_no', $options ) ) {
25
  $loop = 0;
26
  while ( $loop <= $options[ 'profile_no' ] ) {
30
  }
31
 
32
  // If the number of lists field exists, delete each one in turn
 
33
  if ( !array_key_exists( 'list_no', $options ) ) {
34
  $loop = 1;
35
  while ( $loop <= $options[ 'list_no' ] ) {
40
  }
41
 
42
  // Delete all other options
 
43
  delete_option( 'widget_youtube_embed_widget' );
 
 
44
  delete_option( 'youtube_embed_shortcode' );
45
  delete_option( 'youtube_embed_url' );
 
46
  delete_option( 'youtube_embed_activated' );
 
 
 
 
 
 
 
 
47
  ?>
youtube-embed.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
  Plugin Name: Artiss YouTube Embed
4
- Plugin URI: http://www.artiss.co.uk/youtube-embed
5
  Description: Embed YouTube Videos in WordPress
6
- Version: 2.6.2
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.6.2' );
21
 
22
  $functions_dir = WP_PLUGIN_DIR . '/youtube-embed/includes/';
23
 
@@ -31,26 +31,10 @@ include_once( $functions_dir . 'aye-set-defaults.php' ); // Set default opti
31
 
32
  include_once( $functions_dir . 'aye-add-to-admin-bar.php' ); // Add link to the admin bar
33
 
34
- include_once( $functions_dir . 'aye-function-calls.php' ); // Function calls
35
-
36
  include_once( $functions_dir . 'aye-generate-embed-code.php' ); // Generate YouTube embed code
37
 
38
- include_once( $functions_dir . 'aye-generate-download-code.php' ); // Generate download URLs
39
-
40
- include_once( $functions_dir . 'aye-generate-shorturl-code.php' ); // Generate short URLs
41
-
42
- include_once( $functions_dir . 'aye-generate-thumbnail-code.php' ); // Generate thumbnail code
43
-
44
- include_once( $functions_dir . 'aye-generate-transcript-code.php' ); // Generate transcripts
45
-
46
  if ( is_admin() ) {
47
 
48
- if ( !function_exists( 'artiss_plugin_ads' ) ) {
49
-
50
- include_once( $functions_dir . 'artiss-plugin-ads.php' ); // Option screen ads
51
-
52
- }
53
-
54
  include_once( $functions_dir . 'aye-admin-config.php' ); // Administration configuration
55
 
56
  include_once( $functions_dir . 'aye-add-mce-button.php' ); // Editor button
@@ -59,9 +43,20 @@ if ( is_admin() ) {
59
 
60
  include_once( $functions_dir . 'aye-update-post-content.php' ); // Process post content
61
 
 
 
 
 
 
 
 
 
 
 
62
  include_once( $functions_dir . 'aye-shortcodes.php' ); // Shortcodes
63
 
64
  include_once( $functions_dir . 'aye-deprecated.php' ); // Deprecated options
 
65
  }
66
 
67
  include_once($functions_dir . 'aye-generate-widgets.php'); // Generate widgets
1
  <?php
2
  /*
3
  Plugin Name: Artiss YouTube Embed
4
+ Plugin URI: http://www.artiss.co.uk/artiss-youtube-embed
5
  Description: Embed YouTube Videos in WordPress
6
+ Version: 2.5.1
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.5.1' );
21
 
22
  $functions_dir = WP_PLUGIN_DIR . '/youtube-embed/includes/';
23
 
31
 
32
  include_once( $functions_dir . 'aye-add-to-admin-bar.php' ); // Add link to the admin bar
33
 
 
 
34
  include_once( $functions_dir . 'aye-generate-embed-code.php' ); // Generate YouTube embed code
35
 
 
 
 
 
 
 
 
 
36
  if ( is_admin() ) {
37
 
 
 
 
 
 
 
38
  include_once( $functions_dir . 'aye-admin-config.php' ); // Administration configuration
39
 
40
  include_once( $functions_dir . 'aye-add-mce-button.php' ); // Editor button
43
 
44
  include_once( $functions_dir . 'aye-update-post-content.php' ); // Process post content
45
 
46
+ include_once( $functions_dir . 'aye-function-calls.php' ); // Function calls
47
+
48
+ include_once( $functions_dir . 'aye-generate-download-code.php' ); // Generate download URLs
49
+
50
+ include_once( $functions_dir . 'aye-generate-shorturl-code.php' ); // Generate short URLs
51
+
52
+ include_once( $functions_dir . 'aye-generate-thumbnail-code.php' ); // Generate thumbnail code
53
+
54
+ include_once( $functions_dir . 'aye-generate-transcript-code.php' ); // Generate transcripts
55
+
56
  include_once( $functions_dir . 'aye-shortcodes.php' ); // Shortcodes
57
 
58
  include_once( $functions_dir . 'aye-deprecated.php' ); // Deprecated options
59
+
60
  }
61
 
62
  include_once($functions_dir . 'aye-generate-widgets.php'); // Generate widgets