PowerPress Podcasting plugin by Blubrry - Version 5.0

Version Description

= * Released on 08/27/2013 * Advanced Mode added (Was an old feature in PowerPress 1.0 that was removed since 2.0, now it's back!) * Default Mode with 3 Simple Steps added! * Taxonomy Podcasting added (feature sponsored by AfterBuzzTV.com) * Post Type Podcasting added * MediaElement.js HTML5/CSS Audio and Video player added. You must have WordPress 3.6+ to use this player. * Embed player will now use the MediaElement.js player when selected * We now allow images that are 300x300 as the itunes image, but a warning is printed at the top of the page. * Fixed bug where settings saved message did not always appear at the top of the pages. * Added define POWERPRESS_NO_PODCAST_FEED, if set to true in wp-config, PowerPress will not add the default podcast feed with slug name 'podcast'. For users who exclusively want a page or category called 'podcast'. NOTE: There will be no podcast only feed provided by default when this define is set, use at your own risk. * iTunes and RSS image settings moved to "Artwork" tab. * New iTunes Episode image option added to both the Artwork tab as well as the Episode Entry Box (Thanks Robin Brinkler and Daniel Lewis for suggesting the features) * jQuery based watermark replaced with HTML5 placeholder values, the jquery.watermark.js is no longer packaged with PowerPress. * Fixed bug with Feed Episode Maximizer RSS having the invalid characters when used with WordPRess 3.6. * Feed Episode Maximizer is no longer experimental, we've successfully used the feature on a number of podcasts without issue for over a year now. * Player width for audio and video can now use a percentage, ideal for resposive sites. * player.js script is now always enqueued with other WordPress scripts. If you have player issues, please update your theme! * Added link to settings from the plugins management screen, should help folks who are new to PowerPress find settings quickly.

Download this release

Release Info

Developer amandato
Plugin Icon 128x128 PowerPress Podcasting plugin by Blubrry
Version 5.0
Comparing to
See all releases

Code changes from version 4.0.9 to 5.0

3rdparty/jquery.watermark.min.js DELETED
@@ -1,8 +0,0 @@
1
- /*
2
- Watermark v3.1.1 (January 10, 2011) plugin for jQuery
3
- http://jquery-watermark.googlecode.com/
4
- Copyright (c) 2009-2011 Todd Northrop
5
- http://www.speednet.biz/
6
- Dual licensed under the MIT or GPL Version 2 licenses.
7
- */
8
- (function(b,j,y){var p="function",k="password",d="maxLength",g="type",a="",c=true,o="placeholder",e=false,w="watermark",l=w,i="watermarkClass",t="watermarkFocus",n="watermarkSubmit",r="watermarkMaxLength",h="watermarkPassword",f="watermarkText",m=/\r/g,v=":data("+l+")",q=":text,:password,:search,textarea",s=["Page_ClientValidate"],u=e,x=o in document.createElement("input");b.watermark=b.watermark||{version:"3.1.1",runOnce:c,options:{className:w,useNative:c,hideBeforeUnload:c},hide:function(a){b(a).filter(v).each(function(){b.watermark._hide(b(this))})},_hide:function(b,q){var o=b[0],p=(o.value||a).replace(m,a),l=b.data(f)||a,n=b.data(r)||0,k=b.data(i);if(l.length&&p==l){o.value=a;if(b.data(h))if((b.attr(g)||a)==="text"){var e=b.data(h)||[],c=b.parent()||[];if(e.length&&c.length){c[0].removeChild(b[0]);c[0].appendChild(e[0]);b=e}}if(n){b.attr(d,n);b.removeData(r)}if(q){b.attr("autocomplete","off");j.setTimeout(function(){b.select()},1)}}k&&b.removeClass(k)},show:function(a){b(a).filter(v).each(function(){b.watermark._show(b(this))})},_show:function(e){var p=e[0],v=(p.value||a).replace(m,a),j=e.data(f)||a,q=e.attr(g)||a,s=e.data(i);if((v.length==0||v==j)&&!e.data(t)){u=c;if(e.data(h))if(q===k){var o=e.data(h)||[],n=e.parent()||[];if(o.length&&n.length){n[0].removeChild(e[0]);n[0].appendChild(o[0]);e=o;e.attr(d,j.length);p=e[0]}}if(q==="text"||q==="search"){var l=e.attr(d)||0;if(l>0&&j.length>l){e.data(r,l);e.attr(d,j.length)}}s&&e.addClass(s);p.value=j}else b.watermark._hide(e)},hideAll:function(){if(u){b.watermark.hide(q);u=e}},showAll:function(){b.watermark.show(q)}};b.fn.watermark=b.fn.watermark||function(s,r){var u="string";if(!this.length)return this;var w=e,v=typeof s===u;if(v)s=s.replace(m,a);if(typeof r==="object"){w=typeof r.className===u;r=b.extend({},b.watermark.options,r)}else if(typeof r===u){w=c;r=b.extend({},b.watermark.options,{className:r})}else r=b.watermark.options;if(typeof r.useNative!==p)r.useNative=r.useNative?function(){return c}:function(){return e};return this.each(function(){var z="dragleave",y="dragenter",B=this,e=b(B);if(!e.is(q))return;if(e.data(l)){if(v||w){b.watermark._hide(e);v&&e.data(f,s);w&&e.data(i,r.className)}}else{if(x&&r.useNative.call(B,e)&&(e.attr("tagName")||a)!=="TEXTAREA"){v&&e.attr(o,s);return}e.data(f,v?s:a);e.data(i,r.className);e.data(l,1);if((e.attr(g)||a)===k){var C=e.wrap("<span>").parent(),p=b(C.html().replace(/type=["']?password["']?/i,'type="text"'));p.data(f,e.data(f));p.data(i,e.data(i));p.data(l,1);p.attr(d,s.length);p.focus(function(){b.watermark._hide(p,c)}).bind(y,function(){b.watermark._hide(p)}).bind("dragend",function(){j.setTimeout(function(){p.blur()},1)});e.blur(function(){b.watermark._show(e)}).bind(z,function(){b.watermark._show(e)});p.data(h,e);e.data(h,p)}else e.focus(function(){e.data(t,1);b.watermark._hide(e,c)}).blur(function(){e.data(t,0);b.watermark._show(e)}).bind(y,function(){b.watermark._hide(e)}).bind(z,function(){b.watermark._show(e)}).bind("dragend",function(){j.setTimeout(function(){b.watermark._show(e)},1)}).bind("drop",function(d){var c=e[0],b=d.originalEvent.dataTransfer.getData("Text");if((c.value||a).replace(m,a).replace(b,a)===e.data(f))c.value=b;e.focus()});if(B.form){var u=B.form,A=b(u);if(!A.data(n)){A.submit(b.watermark.hideAll);if(u.submit){A.data(n,u.submit);u.submit=function(c,a){return function(){var d=a.data(n);b.watermark.hideAll();if(d.apply)d.apply(c,Array.prototype.slice.call(arguments));else d()}}(u,A)}else{A.data(n,1);u.submit=function(a){return function(){b.watermark.hideAll();delete a.submit;a.submit()}}(u)}}}}b.watermark._show(e)})};if(b.watermark.runOnce){b.watermark.runOnce=e;b.extend(b.expr[":"],{search:function(b){return"search"===(b.type||a)},data:function(c,d,a){return!!b.data(c,a[3])}});(function(c){b.fn.val=function(){var d=this;if(!d.length)return arguments.length?d:y;if(!arguments.length)if(d.data(l)){var e=(d[0].value||a).replace(m,a);return e===(d.data(f)||a)?a:e}else return c.apply(d,arguments);else{c.apply(d,arguments);b.watermark.show(d);return d}}})(b.fn.val);s.length&&b(function(){for(var a,c,d=s.length-1;d>=0;d--){a=s[d];c=j[a];if(typeof c===p)j[a]=function(a){return function(){b.watermark.hideAll();return a.apply(null,Array.prototype.slice.call(arguments))}}(c)}});b(j).bind("beforeunload",function(){b.watermark.options.hideBeforeUnload&&b.watermark.hideAll()})}})(jQuery,window);
 
 
 
 
 
 
 
 
css/admin.css CHANGED
@@ -1,7 +1,8 @@
1
  /* admin.css */
2
-
3
- .powerpress-notice {
4
- margin-top: 10px;
 
5
  margin-bottom: 10px;
6
  line-height: 29px;
7
  font-size: 12px;
@@ -9,7 +10,9 @@
9
  border-style: solid;
10
  font-weight: bold;
11
  }
12
- .powerpress-error {
 
 
13
  margin-top: 10px;
14
  margin-bottom: 10px;
15
  line-height: 29px;
@@ -17,9 +20,10 @@
17
  border-width: 1px;
18
  border-style: solid;
19
  font-weight: bold;
 
20
  }
21
  #powerpress_settings {
22
- background-image:url(http://images.blubrry.com/powerpress/blubrry_logo4.png);
23
  background-repeat: no-repeat;
24
  background-position: bottom right;
25
  }
@@ -185,3 +189,185 @@ padding-bottom: 15px;
185
  padding: 0;
186
  }
187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /* admin.css */
2
+ .powerpress-notice,
3
+ div.powerpress-notice,
4
+ .wrap div.powerpress-notice {
5
+ margin-top: 20px;
6
  margin-bottom: 10px;
7
  line-height: 29px;
8
  font-size: 12px;
10
  border-style: solid;
11
  font-weight: bold;
12
  }
13
+ .powerpress-error,
14
+ div.powerpress-error,
15
+ .wrap div.powerpress-error {
16
  margin-top: 10px;
17
  margin-bottom: 10px;
18
  line-height: 29px;
20
  border-width: 1px;
21
  border-style: solid;
22
  font-weight: bold;
23
+ margin-top: 20px;
24
  }
25
  #powerpress_settings {
26
+ background-image:url(http://images.blubrry.com/powerpress/blubrry_logo5.png);
27
  background-repeat: no-repeat;
28
  background-position: bottom right;
29
  }
189
  padding: 0;
190
  }
191
 
192
+ #powerpress_settings label.powerpress-normal-font {
193
+ font-size: 11px;
194
+ }
195
+ #powerpress_admin_header {
196
+ vertical-align: text-bottom;
197
+ }
198
+ #powerpress_admin_header h2 {
199
+ /* float: left; */
200
+ display: inline-block;
201
+ }
202
+ #powerpress_admin_header .powerpress-mode {
203
+ margin-left: 14px;
204
+ display: inline-block;
205
+ color: #FF6600;
206
+ font-size: 15px;
207
+ font-weight: bold;
208
+ }
209
+
210
+ #powerpress_steps {
211
+ margin: 60px 0 40px;
212
+ }
213
+ .powerpress-required {
214
+ font-size: 90%;
215
+ color: #CC0000;
216
+ margin-left: 12px;
217
+ }
218
+
219
+ .powerpress-step {
220
+ display: inline-block;
221
+ float: left;
222
+ width: 200px;
223
+ height: 170px;
224
+ border-right: 1px solid #ECECEC;
225
+ margin-left: 10px;
226
+ margin-right: 0;
227
+ text-align: top;
228
+ position: relative;
229
+ padding-top: 10px;
230
+ }
231
+ #powerpress_steps h3 {
232
+ color: #CCCCCC;
233
+ margin: 0;
234
+ font-size: 24px;
235
+ top: -16px;
236
+ left: 0;
237
+ position: absolute;
238
+ }
239
+ #powerpress_steps p {
240
+ font-size: 20px;
241
+ margin: 20px 4px;
242
+ color: #CCCCCC;
243
+ line-height:120%
244
+ }
245
+ #powerpress_steps a {
246
+ color: #CCCCCC;
247
+ }
248
+ #powerpreess_step_1 {
249
+ background-image: url('../images/DownArrow.png');
250
+ background-repeat:no-repeat;
251
+ background-position: 6px bottom;
252
+ }
253
+
254
+ #powerpress_steps .active-step h3 {
255
+ color: #337EC9;
256
+
257
+ }
258
+ #powerpress_steps .active-step p,
259
+ #powerpress_steps .active-step a {
260
+ color: #787878;
261
+
262
+ }
263
+
264
+ #powerpress_steps>:first-child {
265
+ margin-left: 0;
266
+ }
267
+ .powerpress-step-complete {
268
+ position: absolute;
269
+ bottom: 0;
270
+ right: 0;
271
+ height: 46px;
272
+ width: 150px;
273
+ }
274
+ .powerpress-step-complete-box {
275
+ border: 1px solid #CCCCCC;
276
+ width: 24px;
277
+ height: 24px;
278
+ display: inline-block;
279
+ position: absolute;
280
+ bottom: -2px;
281
+ right: 20px;
282
+ }
283
+ .powerpress-step-completed {
284
+ background-image: url('../images/Check.png');
285
+ background-repeat:no-repeat;
286
+ background-position: right 2px;
287
+ }
288
+
289
+ .blubrry-services {
290
+ color: #337EC9;
291
+ font-size: 18px;
292
+ line-height: 1.2;
293
+ }
294
+ .blubrry-services p {
295
+ margin: 0 70px 0 0;
296
+ padding: 0;
297
+ }
298
+ .blubrry-services strong {
299
+ color: #FF6600;
300
+ font-weight: normal;
301
+ }
302
+ .blubrry-services p.top-lines {
303
+ margin-right: 0;
304
+ }
305
+ .blubrry-services a {
306
+ color: #FF6600;
307
+ font-size: 20px;
308
+ line-height: 2;
309
+ }
310
+ .blubrry-services .blubrry-hosting,
311
+ .blubrry-services .blubrry-stats {
312
+ float: left;
313
+ width: 230px;
314
+ height: 140px;
315
+ background-color: #ECECEC;
316
+ padding: 10px;
317
+ margin-top: 10px;
318
+ }
319
+ .blubrry-services .blubrry-stats {
320
+ background-image: url('../images/StatsIcon.png');
321
+ background-repeat:no-repeat;
322
+ background-position: bottom right;
323
+ }
324
+
325
+ .blubrry-services .blubrry-hosting {
326
+ margin-right: 50px;
327
+ background-image: url('../images/BlubrryIcon.png');
328
+ background-repeat:no-repeat;
329
+ background-position: bottom right;
330
+ }
331
+
332
+
333
+ @media screen and (min-width: 1px) and (max-width: 819px) {
334
+ .powerpress-step {
335
+ width: 170px;
336
+ }
337
+ #powerpress_steps p {
338
+ font-size: 16px;
339
+ margin: 20px 4px;
340
+ }
341
+ .powerpress-step-complete {
342
+ width: 125px;
343
+ }
344
+ .powerpress-step-complete p {
345
+ padding-top: 5px;
346
+ }
347
+ .blubrry-services .blubrry-hosting {
348
+ margin-right: 20px;
349
+ }
350
+ }
351
+ @media screen and (min-width: 1px) and (max-width: 729px) {
352
+ .powerpress-step {
353
+ width: 130px;
354
+ }
355
+ #powerpreess_step_1 {
356
+ background-position: 1px bottom;
357
+ }
358
+ #powerpress_steps p {
359
+ margin: 10px 4px;
360
+ }
361
+ .powerpress-step-complete {
362
+ width: 110px;
363
+ }
364
+ #powerpress_steps .powerpress-step-complete p {
365
+ padding-top: 20px;
366
+ font-size: 12px;
367
+ }
368
+ .blubrry-services .blubrry-hosting {
369
+ margin-right: 10px;
370
+ }
371
+ }
372
+
373
+
feed-podcast.php CHANGED
@@ -123,7 +123,7 @@ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
123
  <link><?php the_permalink_rss() ?></link>
124
  <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
125
  <guid isPermaLink="false"><?php the_guid(); ?></guid>
126
- <description><?php echo esc_html( get_the_excerpt() ); ?></description>
127
  <?php rss_enclosure(); ?>
128
  <?php do_action('rss2_item'); ?>
129
  <?php
123
  <link><?php the_permalink_rss() ?></link>
124
  <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
125
  <guid isPermaLink="false"><?php the_guid(); ?></guid>
126
+ <description><?php echo powerpress_format_itunes_value( get_the_excerpt(), 'description' ); ?></description>
127
  <?php rss_enclosure(); ?>
128
  <?php do_action('rss2_item'); ?>
129
  <?php
images/Check.png ADDED
Binary file
images/DownArrow.png ADDED
Binary file
images/StatsIcon.png ADDED
Binary file
images/blubrryIcon.png ADDED
Binary file
powerpress-mejs.js ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+
3
+ jQuery(document).ready(function($) {
4
+
5
+ if( jQuery.fn.mediaelementplayer ) {
6
+ jQuery('.powerpress-mejs-audio, .powerpress-mejs-video').mediaelementplayer();
7
+
8
+ jQuery('.mejs-play button, .mejs-overlay-play').click( function(e) {
9
+
10
+ var container = jQuery(this).closest('.mejs-container');
11
+ var html5player = container.find('video,audio');
12
+ if( html5player.attr('src') )
13
+ {
14
+
15
+ //alert( html5player.attr('id') );
16
+ //var mejsplayer = window[ html5player.attr('id') ];
17
+ var srcTmp = html5player.attr('src');
18
+ if( srcTmp.indexOf('#') != -1 ) {
19
+
20
+ var tmp = srcTmp.replace(/^[^#]*#/, '');
21
+ if( tmp != srcTmp ) {
22
+ // Stop the play from happening in this event
23
+ e.preventDefault();
24
+ var mejsplayer = jQuery(html5player)[0];
25
+ if( mejsplayer ) {
26
+ alert( mejsplayer );
27
+ mejsplayer.setAttribute('src', tmp);
28
+ mejsplayer.load();
29
+ setTimeout( function(){ mejsplayer.play(); }, 900 );
30
+ return false;
31
+ }
32
+ }
33
+ }
34
+ }
35
+ });
36
+ }
37
+ });
38
+
39
+ }(jQuery));
powerpress-player.php CHANGED
@@ -38,6 +38,8 @@ function powerpressplayer_init($GeneralSettings)
38
  if( isset($_GET['powerpress_embed']) )
39
  {
40
  $player = ( !empty($_GET['powerpress_player']) ? $_GET['powerpress_player'] : 'default' );
 
 
41
  powerpress_do_embed($player, $_GET['powerpress_embed'], !empty($GeneralSettings['process_podpress']) );
42
  }
43
 
@@ -47,21 +49,33 @@ function powerpressplayer_init($GeneralSettings)
47
  add_shortcode('display_podcast', 'powerpress_shortcode_handler');
48
  }
49
 
50
- if( defined('POWERPRESS_ENQUEUE_SCRIPTS') )
 
 
 
 
 
 
 
 
 
 
 
51
  {
52
- // include what's needed for each plaer
53
- wp_enqueue_script( 'powerpress-player', powerpress_get_root_url() .'player.js');
 
 
 
54
  }
55
 
56
- /*
57
- if( !empty($GeneralSettings['display_player_disable_mobile']) && powerpress_is_mobile_client() )
58
  {
59
- // Remove all known filters for player embeds...
60
- remove_filter('powerpress_player', 'powerpressplayer_player_audio', 10, 3);
61
- remove_filter('powerpress_player', 'powerpressplayer_player_video', 10, 3);
62
- remove_filter('powerpress_player', 'powerpressplayer_player_other', 10, 3);
63
  }
64
- */
65
  }
66
 
67
 
@@ -189,182 +203,6 @@ if( !defined('PODCASTING_VERSION') )
189
  add_shortcode('podcast', 'powerpress_shortcode_handler');
190
  }
191
 
192
-
193
-
194
-
195
- function powerpress_player_filter($content, $media_url, $ExtraData = array() )
196
- {
197
- global $g_powerpress_player_id;
198
- if( !isset($g_powerpress_player_id) )
199
- $g_powerpress_player_id = rand(0, 10000);
200
- else
201
- $g_powerpress_player_id++;
202
-
203
- // Very important setting, we need to know if the media should auto play or not...
204
- $autoplay = false; // (default)
205
- if( isset($ExtraData['autoplay']) && $ExtraData['autoplay'] )
206
- $autoplay = true;
207
- $cover_image = '';
208
- if( $ExtraData['image'] )
209
- $cover_image = $ExtraData['image'];
210
-
211
- // Based on $ExtraData, we can determine which type of player to handle here...
212
- $Settings = get_option('powerpress_general');
213
- $player_width = 400;
214
- $player_height = 225;
215
- if( isset($Settings['player_width']) && $Settings['player_width'] )
216
- $player_width = $Settings['player_width'];
217
- if( isset($Settings['player_height']) && $Settings['player_height'] )
218
- $player_height = $Settings['player_height'];
219
-
220
- // Used with some types
221
- //$content_type = powerpress_get_contenttype($media_url);
222
-
223
- $parts = pathinfo($media_url);
224
- // Hack to use the audio/mp3 content type to set extension to mp3, some folks use tinyurl.com to mp3 files which remove the file extension...
225
- // This hack only covers mp3s.
226
- if( isset($EpisodeData['type']) && $EpisodeData['type'] == 'audio/mpeg' && $parts['extension'] != 'mp3' )
227
- $parts['extension'] = 'mp3';
228
-
229
- $ogg_video = false; // Extra securty make sure it is definitely set to video
230
- switch( strtolower($parts['extension']) )
231
- {
232
- // Quicktime old formats:
233
- case 'm4a':
234
- case 'avi':
235
- case 'mpg':
236
- case 'mpeg':
237
-
238
- case 'm4b':
239
- case 'm4r':
240
- case 'qt':
241
- case 'mov': {
242
-
243
- $GeneralSettings = get_option('powerpress_general');
244
- if( !isset($GeneralSettings['player_scale']) )
245
- $GeneralSettings['player_scale'] = 'tofit';
246
-
247
- // If there is no cover image specified, lets use the default...
248
- if( $cover_image == '' )
249
- $cover_image = powerpress_get_root_url() . 'play_video_default.jpg';
250
-
251
- if( $autoplay )
252
- {
253
- $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'"></div>'.PHP_EOL;
254
- $content .= '<script type="text/javascript"><!--'.PHP_EOL;
255
- $content .= "powerpress_embed_quicktime('powerpress_player_{$g_powerpress_player_id}', '{$media_url}', {$player_width}, {$player_height}, '{$GeneralSettings['player_scale']}');\n";
256
- $content .= "//-->\n";
257
- $content .= "</script>\n";
258
- }
259
- else
260
- {
261
- $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">'.PHP_EOL;
262
- $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" onclick="';
263
- $content .= "return powerpress_embed_quicktime('powerpress_player_{$g_powerpress_player_id}', '{$media_url}', {$player_width}, {$player_height}, '{$GeneralSettings['player_scale']}' );";
264
- $content .= '">';
265
- $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" />';
266
- $content .= '</a>';
267
- $content .= "</div>\n";
268
- }
269
-
270
- }; break;
271
-
272
- // Windows Media:
273
- case 'wma':
274
- case 'wmv':
275
- case 'asf': {
276
-
277
- $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">';
278
- $firefox = (stristr($_SERVER['HTTP_USER_AGENT'], 'firefox') !== false );
279
-
280
- if( (!$cover_image && !$firefox ) || $autoplay ) // if we don't have a cover image or we're supposed to auto play the media anyway...
281
- {
282
- $content .= '<object id="winplayer" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="'. $player_width .'" height="'. $player_height .'" standby="..." type="application/x-oleobject">';
283
- $content .= ' <param name="url" value="'. $media_url .'" />';
284
- $content .= ' <param name="AutoStart" value="'. ($autoplay?'true':'false') .'" />';
285
- $content .= ' <param name="AutoSize" value="true" />';
286
- $content .= ' <param name="AllowChangeDisplaySize" value="true" />';
287
- $content .= ' <param name="standby" value="Media is loading..." />';
288
- $content .= ' <param name="AnimationAtStart" value="true" />';
289
- $content .= ' <param name="scale" value="aspect" />';
290
- $content .= ' <param name="ShowControls" value="true" />';
291
- $content .= ' <param name="ShowCaptioning" value="false" />';
292
- $content .= ' <param name="ShowDisplay" value="false" />';
293
- $content .= ' <param name="ShowStatusBar" value="false" />';
294
- $content .= ' <embed type="application/x-mplayer2" src="'. $media_url .'" width="'. $player_width .'" height="'. $player_height .'" scale="ASPECT" autostart="'. ($autoplay?'1':'0') .'" ShowDisplay="0" ShowStatusBar="0" autosize="1" AnimationAtStart="1" AllowChangeDisplaySize="1" ShowControls="1"></embed>';
295
- $content .= '</object>';
296
- }
297
- else
298
- {
299
- if( $cover_image == '' )
300
- $cover_image = powerpress_get_root_url() . 'play_video_default.jpg';
301
-
302
- $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" onclick="';
303
- $content .= "return powerpress_embed_winplayer('powerpress_player_{$g_powerpress_player_id}', '{$media_url}', {$player_width}, {$player_height} );";
304
- $content .= '">';
305
- $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" />';
306
- $content .= '</a>';
307
- }
308
-
309
- if( $firefox )
310
- {
311
- $content .= '<p style="font-size: 85%;margin-top:0;">'. __('Best viewed with', 'powerpress');
312
- $content .= ' <a href="http://support.mozilla.com/en-US/kb/Using+the+Windows+Media+Player+plugin+with+Firefox#Installing_the_plugin" target="_blank">';
313
- $content .= __('Windows Media Player plugin for Firefox', 'powerpress') .'</a></p>';
314
- }
315
-
316
- $content .= "</div>\n";
317
-
318
- }; break;
319
-
320
- // Flash:
321
- case 'swf': {
322
-
323
- // If there is no cover image specified, lets use the default...
324
- if( $cover_image == '' )
325
- $cover_image = powerpress_get_root_url() . 'play_video_default.jpg';
326
-
327
- $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">';
328
- if( !$autoplay )
329
- {
330
- $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" onclick="';
331
- $content .= "return powerpress_embed_swf('powerpress_player_{$g_powerpress_player_id}', '{$media_url}', {$player_width}, {$player_height} );";
332
- $content .= '">';
333
- $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" />';
334
- $content .= '</a>';
335
- }
336
- $content .= "</div>\n";
337
- if( $autoplay )
338
- {
339
- $content .= '<script type="text/javascript"><!--'.PHP_EOL;
340
- $content .= "powerpress_embed_swf('powerpress_player_{$g_powerpress_player_id}', '{$media_url}', {$player_width}, {$player_height} );\n";
341
- $content .= "//-->\n";
342
- $content .= "</script>\n";
343
- }
344
-
345
- }; break;
346
-
347
- // Default, just display the play image. If it is set for auto play, then we don't wnat to open a new window, otherwise we want to open this in a new window..
348
- default: {
349
-
350
- if( $cover_image == '' )
351
- $cover_image = powerpress_get_root_url() . 'play_video_default.jpg';
352
-
353
- $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">';
354
- $content .= '<a href="'. $media_url .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'"'. ($autoplay?'':' target="_blank"') .'>';
355
- $content .= '<img src="'. $cover_image .'" title="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" alt="'. htmlspecialchars(POWERPRESS_PLAY_TEXT) .'" />';
356
- $content .= '</a>';
357
- $content .= "</div>\n";
358
-
359
- }; break;
360
- }
361
-
362
- return $content;
363
- }
364
-
365
- //add_filter('powerpress_player', 'powerpress_player_filter', 10, 3);
366
-
367
-
368
  /*
369
  // Everything in $ExtraData except post_id
370
  */
@@ -399,12 +237,25 @@ function powerpress_generate_embed($player, $EpisodeData) // $post_id, $feed_slu
399
  }
400
 
401
  $extension = powerpressplayer_get_extension($EpisodeData['url']);
402
- if( ($extension == 'mp3' || $extension == 'm4a') && empty($Settings['poster_image_audio']) )
403
  {
404
- $height = 24; // Hack for audio to only include the player without the poster art
405
- $width = 320;
406
- if( !empty($GeneralSettings['player_width_audio']) )
407
- $width = $GeneralSettings['player_width_audio'];
 
 
 
 
 
 
 
 
 
 
 
 
 
408
  }
409
  }
410
 
@@ -420,12 +271,15 @@ function powerpress_generate_embed($player, $EpisodeData) // $post_id, $feed_slu
420
  $embed .= ' height="'. $height .'"';
421
  $embed .= ' src="'. $url .'"';
422
  $embed .= ' frameborder="0" scrolling="no"';
 
 
423
  $embed .= '></iframe>';
424
  return $embed;
425
  }
426
 
427
  function powerpressplayer_build_embed($player, $media_url, $EpisodeData = array() )
428
  {
 
429
  if( !$player )
430
  return '';
431
 
@@ -476,6 +330,21 @@ function powerpressplayer_build_embed($player, $media_url, $EpisodeData = array(
476
  if( !empty($EpisodeData['height']) && is_numeric($EpisodeData['height']) )
477
  $height = $EpisodeData['height'];
478
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
479
  }; break;
480
  default: { // Other players are currently not supported
481
  return '';
@@ -489,6 +358,8 @@ function powerpressplayer_build_embed($player, $media_url, $EpisodeData = array(
489
 
490
  $url .= '&amp;powerpress_player='.$player;
491
  $embed .= '<iframe';
 
 
492
  $embed .= ' class="powerpress-player-embed"';
493
  $embed .= ' width="'. $width .'"';
494
  $embed .= ' height="'. $height .'"';
@@ -499,30 +370,72 @@ function powerpressplayer_build_embed($player, $media_url, $EpisodeData = array(
499
  }
500
 
501
 
502
- function powerpressplayer_in_embed($player, $media_url, $EpisodeData = array())
503
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504
  $content = '';
505
- $content .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'. PHP_EOL;
506
  $content .= '<html xmlns="http://www.w3.org/1999/xhtml">'. PHP_EOL;
507
  $content .= '<head>'. PHP_EOL;
508
  $content .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'. PHP_EOL;
509
  $content .= '<title>'. __('Blubrry PowerPress Player', 'powerpress') .'</title>'. PHP_EOL;
510
  $content .= '<meta name="robots" content="noindex" />'. PHP_EOL;
511
- $content .= '<script type="text/javascript" src="'. powerpress_get_root_url() .'player.js"></script>'. PHP_EOL;
 
512
  // Include jQuery for convenience
513
- $content .= '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>'. PHP_EOL;
 
 
 
 
 
 
514
  $content .= '<script language="javascript" type="text/javascript"><!--'. PHP_EOL;
515
  $content .= 'powerpress_url = \''. powerpress_get_root_url() .'\''. PHP_EOL;
516
  $content .= 'jQuery(document).ready(function($) {'. PHP_EOL;
517
- $content .= ' powerpress_resize_player();'. PHP_EOL;
518
  $content .= ' $(window).resize(function() {'. PHP_EOL;
519
  $content .= ' powerpress_resize_player();'. PHP_EOL;
520
  $content .= ' });'. PHP_EOL;
521
 
522
  $content .= '});'. PHP_EOL;
 
 
 
 
 
 
 
523
  $content .= 'function powerpress_resize_player() {'. PHP_EOL;
524
- $content .= ' jQuery(\'video\').css(\'width\', jQuery(window).width() );'. PHP_EOL;
525
- $content .= ' jQuery(\'video\').css(\'height\', jQuery(window).height() );'. PHP_EOL;
 
 
 
 
 
 
 
 
526
  $content .= ' jQuery(\'.powerpress_player .powerpress-player-poster\').css(\'width\', jQuery(window).width() );'. PHP_EOL;
527
  $content .= ' jQuery(\'.powerpress_player .powerpress-player-poster\').css(\'height\', jQuery(window).height() );'. PHP_EOL;
528
  $content .= ' jQuery(\'.powerpress_player .powerpress-player-play-image\').css(\'bottom\', Math.floor( (jQuery(window).height()/2)-30)+\'px\');'. PHP_EOL;
@@ -554,7 +467,7 @@ function powerpressplayer_in_embed($player, $media_url, $EpisodeData = array())
554
  }
555
 
556
  $content .= '<style type="text/css" media="screen">' . PHP_EOL;
557
- $content .= ' body { font-size: 13px; font-family: Arial, Helvetica, sans-serif; margin: 0; padding: 0; } img { border: 0; }' . PHP_EOL;
558
  $content .= '</style>' . PHP_EOL;
559
  $content .= '</head>'. PHP_EOL;
560
  $content .= '<body>'. PHP_EOL;
@@ -575,6 +488,14 @@ function powerpressplayer_in_embed($player, $media_url, $EpisodeData = array())
575
  case 'html5video': {
576
  $content .= powerpressplayer_build_html5video($media_url, $EpisodeData);
577
  }; break;
 
 
 
 
 
 
 
 
578
  default: {
579
  $content .= '<strong>'. __('Player Not Available', 'powerpress') .'</strong>';
580
  };
@@ -582,7 +503,7 @@ function powerpressplayer_in_embed($player, $media_url, $EpisodeData = array())
582
 
583
  $content .= '</body>'. PHP_EOL;
584
  $content .= '</html>'. PHP_EOL;
585
- return $content;
586
  }
587
 
588
 
@@ -608,9 +529,11 @@ function powerpressplayer_player_audio($content, $media_url, $EpisodeData = arra
608
  case 'mp3':
609
  {
610
  $Settings = get_option('powerpress_general');
611
- if( !isset($Settings['player']) )
 
 
612
  $Settings['player'] = 'default';
613
-
614
  switch( $Settings['player'] )
615
  {
616
  case 'default':
@@ -632,6 +555,9 @@ function powerpressplayer_player_audio($content, $media_url, $EpisodeData = arra
632
  case 'html5audio': {
633
  $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData);
634
  }; break;
 
 
 
635
  }
636
 
637
  }; break;
@@ -641,7 +567,9 @@ function powerpressplayer_player_audio($content, $media_url, $EpisodeData = arra
641
  if( empty($Settings['m4a']) || $Settings['m4a'] != 'use_players' )
642
  break;
643
 
644
- if( !isset($Settings['player']) )
 
 
645
  $Settings['player'] = 'default';
646
 
647
  switch( $Settings['player'] )
@@ -653,6 +581,9 @@ function powerpressplayer_player_audio($content, $media_url, $EpisodeData = arra
653
  case 'html5audio': {
654
  $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData);
655
  }; break;
 
 
 
656
  default: {
657
  $content .= powerpressplayer_build_playimageaudio($media_url, true);
658
  };
@@ -665,7 +596,19 @@ function powerpressplayer_player_audio($content, $media_url, $EpisodeData = arra
665
  return $content; // Ogg is handled as video
666
  }
667
  case 'oga': {
668
- $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData);
 
 
 
 
 
 
 
 
 
 
 
 
669
  }; break;
670
  }
671
 
@@ -693,7 +636,9 @@ function powerpressplayer_player_video($content, $media_url, $EpisodeData = arra
693
  case 'webm':
694
  case 'ogv': { // Use native player when possible
695
  $Settings = get_option('powerpress_general');
696
- if( !isset($Settings['video_player']) )
 
 
697
  $Settings['video_player'] = 'html5video';
698
 
699
  // HTML5 Video as an embed
@@ -702,6 +647,9 @@ function powerpressplayer_player_video($content, $media_url, $EpisodeData = arra
702
  case 'videojs-html5-video-player-for-wordpress': {
703
  $content .= powerpressplayer_build_videojs($media_url, $EpisodeData);
704
  }; break;
 
 
 
705
  default: {
706
  $content .= powerpressplayer_build_html5video($media_url, $EpisodeData);
707
  }; break;
@@ -712,10 +660,11 @@ function powerpressplayer_player_video($content, $media_url, $EpisodeData = arra
712
  case 'mp4':
713
  // Okay, lets see if we we have a player setup to handle this
714
  {
715
-
716
  $Settings = get_option('powerpress_general');
717
- if( !isset($Settings['video_player']) )
718
- $Settings['video_player'] = 'html5video';
 
 
719
 
720
  switch( $Settings['video_player'] )
721
  {
@@ -731,6 +680,9 @@ function powerpressplayer_player_video($content, $media_url, $EpisodeData = arra
731
  // HTML5 Video as an embed
732
  $content .= powerpressplayer_build_html5video($media_url, $EpisodeData);
733
  }; break;
 
 
 
734
  }
735
  }; break;
736
  }
@@ -1024,36 +976,36 @@ function powerpressplayer_embedable($media_url, $ExtraData = array())
1024
 
1025
  $extension = powerpressplayer_get_extension($media_url);
1026
  $player = false;
1027
- if( preg_match('/(mp3|m4a|mp4|m4v|webm|ogg|ogv)/i', $extension ) )
1028
  {
1029
  $GeneralSettings = get_option('powerpress_general');
1030
  if( empty($GeneralSettings['podcast_embed']) )
1031
  return false;
1032
- if( !isset($GeneralSettings['player']) )
 
 
1033
  $GeneralSettings['player'] = 'default';
1034
- if( !isset($GeneralSettings['video_player']) )
 
 
 
1035
  $GeneralSettings['video_player'] = 'flow-player-classic';
1036
 
1037
  switch( $extension )
1038
  {
1039
  case 'mp3':
 
1040
  case 'm4a': {
1041
- //if( $GeneralSettings['player'] == 'default' )
1042
- // $player = $GeneralSettings['player'];
1043
- $player = 'default';
1044
  }; break;
1045
  case 'mp4':
1046
- case 'm4v': {
1047
- //if( $GeneralSettings['video_player'] == 'flow-player-classic' || $GeneralSettings['video_player'] == 'html5video' )
1048
- // $player = $GeneralSettings['video_player'];
1049
- $player = 'html5video';
1050
- }; break;
1051
  case 'webm':
1052
  case 'ogg':
1053
  case 'ogv': {
1054
- //if( $GeneralSettings['video_player'] == 'html5video' )
1055
- // $player = $GeneralSettings['video_player'];
1056
- $player = 'html5video';
1057
  }; break;
1058
  }
1059
  }
@@ -1132,7 +1084,9 @@ function powerpress_do_pinw($pinw, $process_podpress)
1132
  $EpisodeData = powerpress_get_enclosure_data_podpress($post_id);
1133
  }
1134
 
1135
- echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
 
 
1136
  ?>
1137
  <html xmlns="http://www.w3.org/1999/xhtml">
1138
  <head>
@@ -1141,19 +1095,42 @@ function powerpress_do_pinw($pinw, $process_podpress)
1141
  <meta name="robots" content="noindex" />
1142
  <?php
1143
 
1144
- if( defined('POWERPRESS_ENQUEUE_SCRIPTS') )
1145
- wp_enqueue_script( 'powerpress-player', powerpress_get_root_url() .'player.js');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1146
 
1147
- wp_head();
1148
  ?>
1149
  <style type="text/css">
1150
- body { font-size: 13px; font-family: Arial, Helvetica, sans-serif; }
1151
  </style>
1152
  </head>
1153
  <body>
1154
  <div style="margin: 5px;">
1155
  <?php
1156
- $GeneralSettings = get_option('powerpress_general');
1157
  if( !$EpisodeData )
1158
  {
1159
  echo '<p>'. __('Unable to retrieve media information.', 'powerpress') .'</p>';
@@ -1193,7 +1170,7 @@ function powerpress_do_embed($player, $embed, $process_podpress)
1193
  }
1194
 
1195
  // Embeds are only available for the following players
1196
- echo powerpressplayer_in_embed($player, $EpisodeData['url'], $EpisodeData);
1197
  exit;
1198
  }
1199
 
@@ -1299,6 +1276,70 @@ function powerpressplayer_build_html5video($media_url, $EpisodeData=array(), $em
1299
  return $content;
1300
  }
1301
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1302
  /*
1303
  HTTML 5 Audio Player
1304
  */
@@ -1315,8 +1356,6 @@ function powerpressplayer_build_html5audio($media_url, $EpisodeData=array(), $em
1315
  $content .= '<div class="powerpress_player" id="powerpress_player_'. $player_id .'">'.PHP_EOL;
1316
  $content .= '<audio controls="controls"';
1317
  $content .=' src="'. $media_url .'"';
1318
- if( $cover_image )
1319
- $content .= ' poster="'. $cover_image .'"';
1320
  if( $autoplay )
1321
  $content .= ' autoplay="autoplay"';
1322
  else
@@ -1358,6 +1397,46 @@ function powerpressplayer_build_html5audio($media_url, $EpisodeData=array(), $em
1358
  return $content;
1359
  }
1360
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1361
  /*
1362
  HTTML 5 Mobile Player
1363
  */
@@ -1381,7 +1460,12 @@ function powerpressplayer_build_html5mobile($media_url, $EpisodeData)
1381
  case 'ogg':
1382
  case 'ogv': {
1383
  // Video
1384
- if( $html5 )
 
 
 
 
 
1385
  $content .= powerpressplayer_build_html5video($media_url, $EpisodeData);
1386
  else
1387
  $content .= powerpressplayer_build_playimage($media_url, $EpisodeData, true);
@@ -1390,7 +1474,12 @@ function powerpressplayer_build_html5mobile($media_url, $EpisodeData)
1390
  case 'm4a':
1391
  case 'oga': {
1392
  // Audio
1393
- if( $html5 )
 
 
 
 
 
1394
  $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData);
1395
  else
1396
  $content .= powerpressplayer_build_playimageaudio($media_url, true);
@@ -1969,6 +2058,4 @@ function powerpressplayer_build_videojs($media_url, $EpisodeData = array())
1969
  return $content;
1970
  }
1971
 
1972
-
1973
-
1974
  ?>
38
  if( isset($_GET['powerpress_embed']) )
39
  {
40
  $player = ( !empty($_GET['powerpress_player']) ? $_GET['powerpress_player'] : 'default' );
41
+ if( empty($_GET['powerpress_player']) && version_compare($GLOBALS['wp_version'], '3.6-alpha', '>') )
42
+ $player = 'mediaelement-audio';
43
  powerpress_do_embed($player, $_GET['powerpress_embed'], !empty($GeneralSettings['process_podpress']) );
44
  }
45
 
49
  add_shortcode('display_podcast', 'powerpress_shortcode_handler');
50
  }
51
 
52
+
53
+ // include what's needed for each plaer
54
+ wp_enqueue_script( 'powerpress-player', powerpress_get_root_url() .'player.js');
55
+
56
+
57
+ $enqueue_mejs = false;
58
+ if( !isset($GeneralSettings['player']) || !isset($GeneralSettings['video_player']) )
59
+ {
60
+ if( version_compare($GLOBALS['wp_version'], '3.6-alpha', '>') )
61
+ $enqueue_mejs = true;
62
+ }
63
+ else if( !empty($GeneralSettings['player']) && $GeneralSettings['player'] == 'mediaelement-audio' )
64
  {
65
+ $enqueue_mejs = true;
66
+ }
67
+ else if( !empty($GeneralSettings['video_player']) && $GeneralSettings['video_player'] == 'mediaelement-video' )
68
+ {
69
+ $enqueue_mejs = true;
70
  }
71
 
72
+ if( $enqueue_mejs )
 
73
  {
74
+ wp_enqueue_style('mediaelement');
75
+ wp_enqueue_style('wp-mediaelement');
76
+ wp_enqueue_script('mediaelement');
77
+ wp_enqueue_script( 'powerpress-mejs', powerpress_get_root_url() .'powerpress-mejs.js');
78
  }
 
79
  }
80
 
81
 
203
  add_shortcode('podcast', 'powerpress_shortcode_handler');
204
  }
205
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  /*
207
  // Everything in $ExtraData except post_id
208
  */
237
  }
238
 
239
  $extension = powerpressplayer_get_extension($EpisodeData['url']);
240
+ if( $player == 'mediaelement-audio' )
241
  {
242
+ if( $extension == 'mp3' || $extension == 'm4a' || $extension == 'oga')
243
+ {
244
+ $height = 30; // Hack for audio to only include the player without the poster art
245
+ $width = 320;
246
+ if( !empty($GeneralSettings['player_width_audio']) )
247
+ $width = $GeneralSettings['player_width_audio'];
248
+ }
249
+ }
250
+ else if ( $player == 'default' )
251
+ {
252
+ if( ($extension == 'mp3' || $extension == 'm4a' ) && empty($Settings['poster_image_audio']) )
253
+ {
254
+ $height = 24; // Hack for audio to only include the player without the poster art
255
+ $width = 320;
256
+ if( !empty($GeneralSettings['player_width_audio']) )
257
+ $width = $GeneralSettings['player_width_audio'];
258
+ }
259
  }
260
  }
261
 
271
  $embed .= ' height="'. $height .'"';
272
  $embed .= ' src="'. $url .'"';
273
  $embed .= ' frameborder="0" scrolling="no"';
274
+ if($extension != 'mp3' && $extension != 'm4a' && $extension != 'oga')
275
+ $embed .= ' webkitAllowFullScreen mozallowfullscreen allowFullScreen';
276
  $embed .= '></iframe>';
277
  return $embed;
278
  }
279
 
280
  function powerpressplayer_build_embed($player, $media_url, $EpisodeData = array() )
281
  {
282
+ return ''; // This function does not do anything at this time.
283
  if( !$player )
284
  return '';
285
 
330
  if( !empty($EpisodeData['height']) && is_numeric($EpisodeData['height']) )
331
  $height = $EpisodeData['height'];
332
 
333
+ }; break;
334
+ case 'mediaelement-audio': {
335
+
336
+ $PlayerSettings = get_option('powerpress_mediaelement');
337
+ $height = 20;
338
+ $width = 200;
339
+ if( !empty($PlayerSettings['width']) && is_numeric($PlayerSettings['width']) )
340
+ $width = $PlayerSettings['width'];
341
+ if( !empty($PlayerSettings['height']) && is_numeric($PlayerSettings['height']) )
342
+ $height = $PlayerSettings['height'];
343
+ if( !empty($EpisodeData['width']) && is_numeric($EpisodeData['width']) )
344
+ $width = $EpisodeData['width'];
345
+ if( !empty($EpisodeData['height']) && is_numeric($EpisodeData['height']) )
346
+ $height = $EpisodeData['height'];
347
+
348
  }; break;
349
  default: { // Other players are currently not supported
350
  return '';
358
 
359
  $url .= '&amp;powerpress_player='.$player;
360
  $embed .= '<iframe';
361
+ if( 1 )
362
+ $embed .= ' webkitAllowFullScreen mozallowfullscreen allowFullScreen';
363
  $embed .= ' class="powerpress-player-embed"';
364
  $embed .= ' width="'. $width .'"';
365
  $embed .= ' height="'. $height .'"';
370
  }
371
 
372
 
373
+ function do_powerpressplayer_embed($player, $media_url, $EpisodeData = array())
374
  {
375
+ // Includde the stuff we need...
376
+ switch( $player )
377
+ {
378
+ case 'mejs-a':
379
+ case 'mejs-v':
380
+ case 'mediaelement-audio':
381
+ case 'mediaelement-video': {
382
+ // Enqueue stuff for mediaelements
383
+
384
+ wp_enqueue_style('mediaelement');
385
+ wp_enqueue_style('wp-mediaelement');
386
+ wp_enqueue_script('mediaelement');
387
+ //wp_enqueue_script( 'powerpress-mejs', powerpress_get_root_url() .'powerpress-mejs.js');
388
+ }; break;
389
+ default: {
390
+ //wp_enqueue_script('jquery');
391
+ }; break;
392
+ }
393
+ wp_enqueue_script('jquery');
394
+
395
  $content = '';
396
+ $content .= '<!DOCTYPE html>'. PHP_EOL;
397
  $content .= '<html xmlns="http://www.w3.org/1999/xhtml">'. PHP_EOL;
398
  $content .= '<head>'. PHP_EOL;
399
  $content .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'. PHP_EOL;
400
  $content .= '<title>'. __('Blubrry PowerPress Player', 'powerpress') .'</title>'. PHP_EOL;
401
  $content .= '<meta name="robots" content="noindex" />'. PHP_EOL;
402
+ // $content .= '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>'. PHP_EOL;
403
+ echo $content;
404
  // Include jQuery for convenience
405
+
406
+ wp_print_styles();
407
+ wp_print_scripts();
408
+
409
+ $content = '';
410
+ $content .= '<script type="text/javascript" src="'. powerpress_get_root_url() .'player.js"></script>'. PHP_EOL;
411
+
412
  $content .= '<script language="javascript" type="text/javascript"><!--'. PHP_EOL;
413
  $content .= 'powerpress_url = \''. powerpress_get_root_url() .'\''. PHP_EOL;
414
  $content .= 'jQuery(document).ready(function($) {'. PHP_EOL;
415
+ $content .= ' powerpress_load_player();'. PHP_EOL;
416
  $content .= ' $(window).resize(function() {'. PHP_EOL;
417
  $content .= ' powerpress_resize_player();'. PHP_EOL;
418
  $content .= ' });'. PHP_EOL;
419
 
420
  $content .= '});'. PHP_EOL;
421
+
422
+ $content .= 'function powerpress_load_player() {'. PHP_EOL;
423
+ $content .= ' jQuery(\'.powerpress-mejs-audio, .powerpress-mejs-video\').css(\'width\', jQuery(window).width() );'. PHP_EOL;
424
+ $content .= ' jQuery(\'.powerpress-mejs-audio, .powerpress-mejs-video\').css(\'height\', jQuery(window).height() );'. PHP_EOL;
425
+ $content .= ' jQuery(\'.powerpress-mejs-audio, .powerpress-mejs-video\').mediaelementplayer();'.PHP_EOL;
426
+ $content .= '}'. PHP_EOL;
427
+
428
  $content .= 'function powerpress_resize_player() {'. PHP_EOL;
429
+ //$content .= ' var width = jQuery(window).width(); var height = jQuery(window).height();'.PHP_EOL;
430
+ //$content .= ' if( (height * 0.5625) > width ) { alert(\'need to adjust height!\'); }'.PHP_EOL;
431
+ //$content .= ' if( (height * 0.5625) < width ) { width = Math.floor((height * 16)/9); }'.PHP_EOL;
432
+ //$content .= ' $(\'player\')[0].player.media.setPlayerSize( width, height )'.PHP_EOL;
433
+ $content .= ' jQuery(\'.powerpress_player\').css(\'width\', jQuery(window).width() );'. PHP_EOL;
434
+ $content .= ' jQuery(\'.powerpress_player\').css(\'height\', jQuery(window).height() );'. PHP_EOL;
435
+ $content .= ' jQuery(\'.powerpress-mejs-video, .powerpress-mejs-audio\').css(\'width\', jQuery(window).width() );'. PHP_EOL;
436
+ $content .= ' jQuery(\'.powerpress-mejs-video, .powerpress-mejs-audio\').css(\'height\', jQuery(window).height() );'. PHP_EOL;
437
+ //$content .= ' alert(\'Height: \'+ jQuery(window).height() );'. PHP_EOL;
438
+
439
  $content .= ' jQuery(\'.powerpress_player .powerpress-player-poster\').css(\'width\', jQuery(window).width() );'. PHP_EOL;
440
  $content .= ' jQuery(\'.powerpress_player .powerpress-player-poster\').css(\'height\', jQuery(window).height() );'. PHP_EOL;
441
  $content .= ' jQuery(\'.powerpress_player .powerpress-player-play-image\').css(\'bottom\', Math.floor( (jQuery(window).height()/2)-30)+\'px\');'. PHP_EOL;
467
  }
468
 
469
  $content .= '<style type="text/css" media="screen">' . PHP_EOL;
470
+ $content .= ' body { font-size: 13px; font-family: Arial, Helvetica, sans-serif; margin: 0; padding: 0; } img { border: 0; } ' . PHP_EOL;
471
  $content .= '</style>' . PHP_EOL;
472
  $content .= '</head>'. PHP_EOL;
473
  $content .= '<body>'. PHP_EOL;
488
  case 'html5video': {
489
  $content .= powerpressplayer_build_html5video($media_url, $EpisodeData);
490
  }; break;
491
+ case 'mediaelement-audio':
492
+ case 'mejs-a': {
493
+ $content .= powerpressplayer_build_mediaelementaudio($media_url, $EpisodeData, true);
494
+ }; break;
495
+ case 'mediaelement-video':
496
+ case 'mejs-v': {
497
+ $content .= powerpressplayer_build_mediaelementvideo($media_url, $EpisodeData, true);
498
+ }; break;
499
  default: {
500
  $content .= '<strong>'. __('Player Not Available', 'powerpress') .'</strong>';
501
  };
503
 
504
  $content .= '</body>'. PHP_EOL;
505
  $content .= '</html>'. PHP_EOL;
506
+ echo $content;
507
  }
508
 
509
 
529
  case 'mp3':
530
  {
531
  $Settings = get_option('powerpress_general');
532
+ if( !isset($Settings['player']) && version_compare($GLOBALS['wp_version'], '3.6-alpha', '>') )
533
+ $Settings['player'] = 'mediaelement-audio';
534
+ else if( !isset($Settings['player']) )
535
  $Settings['player'] = 'default';
536
+
537
  switch( $Settings['player'] )
538
  {
539
  case 'default':
555
  case 'html5audio': {
556
  $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData);
557
  }; break;
558
+ case 'mediaelement-audio': {
559
+ $content .= powerpressplayer_build_mediaelementaudio($media_url, $EpisodeData);
560
+ }; break;
561
  }
562
 
563
  }; break;
567
  if( empty($Settings['m4a']) || $Settings['m4a'] != 'use_players' )
568
  break;
569
 
570
+ if( !isset($Settings['player']) && version_compare($GLOBALS['wp_version'], '3.6-alpha', '>') )
571
+ $Settings['player'] = 'mediaelement-audio';
572
+ else if( !isset($Settings['player']) )
573
  $Settings['player'] = 'default';
574
 
575
  switch( $Settings['player'] )
581
  case 'html5audio': {
582
  $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData);
583
  }; break;
584
+ case 'mediaelement-audio': {
585
+ $content .= powerpressplayer_build_mediaelementaudio($media_url, $EpisodeData);
586
+ }; break;
587
  default: {
588
  $content .= powerpressplayer_build_playimageaudio($media_url, true);
589
  };
596
  return $content; // Ogg is handled as video
597
  }
598
  case 'oga': {
599
+ if( !isset($Settings['player']) && version_compare($GLOBALS['wp_version'], '3.6-alpha', '>') )
600
+ $Settings['player'] = 'mediaelement-audio';
601
+
602
+ switch( $Settings['player'] )
603
+ {
604
+ case 'mediaelement-audio': {
605
+ $content .= powerpressplayer_build_mediaelementaudio($media_url, $EpisodeData);
606
+ }; break;
607
+ case 'html5audio':
608
+ default: {
609
+ $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData);
610
+ }
611
+ }
612
  }; break;
613
  }
614
 
636
  case 'webm':
637
  case 'ogv': { // Use native player when possible
638
  $Settings = get_option('powerpress_general');
639
+ if( !isset($Settings['video_player']) && version_compare($GLOBALS['wp_version'], '3.6-alpha', '>') )
640
+ $Settings['video_player'] = 'mediaelement-video';
641
+ else if( !isset($Settings['video_player']) )
642
  $Settings['video_player'] = 'html5video';
643
 
644
  // HTML5 Video as an embed
647
  case 'videojs-html5-video-player-for-wordpress': {
648
  $content .= powerpressplayer_build_videojs($media_url, $EpisodeData);
649
  }; break;
650
+ case 'mediaelement-video': {
651
+ $content .= powerpressplayer_build_mediaelementvideo($media_url, $EpisodeData);
652
+ }; break;
653
  default: {
654
  $content .= powerpressplayer_build_html5video($media_url, $EpisodeData);
655
  }; break;
660
  case 'mp4':
661
  // Okay, lets see if we we have a player setup to handle this
662
  {
 
663
  $Settings = get_option('powerpress_general');
664
+ if( !isset($Settings['video_player']) && version_compare($GLOBALS['wp_version'], '3.6-alpha', '>') )
665
+ $Settings['video_player'] = 'mediaelement-video';
666
+ else if( !isset($Settings['video_player']) )
667
+ $Settings['video_player'] = 'default';
668
 
669
  switch( $Settings['video_player'] )
670
  {
680
  // HTML5 Video as an embed
681
  $content .= powerpressplayer_build_html5video($media_url, $EpisodeData);
682
  }; break;
683
+ case 'mediaelement-video': {
684
+ $content .= powerpressplayer_build_mediaelementvideo($media_url, $EpisodeData);
685
+ }; break;
686
  }
687
  }; break;
688
  }
976
 
977
  $extension = powerpressplayer_get_extension($media_url);
978
  $player = false;
979
+ if( preg_match('/(mp3|m4a|oga|mp4|m4v|webm|ogg|ogv)/i', $extension ) )
980
  {
981
  $GeneralSettings = get_option('powerpress_general');
982
  if( empty($GeneralSettings['podcast_embed']) )
983
  return false;
984
+ if( !isset($GeneralSettings['player']) && version_compare($GLOBALS['wp_version'], '3.6-alpha', '>') )
985
+ $GeneralSettings['player'] = 'mediaelement-audio';
986
+ else if( !isset($GeneralSettings['player']) )
987
  $GeneralSettings['player'] = 'default';
988
+
989
+ if( !isset($GeneralSettings['video_player']) && version_compare($GLOBALS['wp_version'], '3.6-alpha', '>') )
990
+ $GeneralSettings['video_player'] = 'mediaelement-video';
991
+ else if( !isset($GeneralSettings['video_player']) )
992
  $GeneralSettings['video_player'] = 'flow-player-classic';
993
 
994
  switch( $extension )
995
  {
996
  case 'mp3':
997
+ case 'oga':
998
  case 'm4a': {
999
+ if( in_array( $GeneralSettings['player'], array('mediaelement-audio', 'flow-player-classic') ) )
1000
+ $player = $GeneralSettings['player'];
 
1001
  }; break;
1002
  case 'mp4':
1003
+ case 'm4v':
 
 
 
 
1004
  case 'webm':
1005
  case 'ogg':
1006
  case 'ogv': {
1007
+ if( in_array( $GeneralSettings['video_player'], array('mediaelement-video', 'html5video', 'flow-player-classic') ) )
1008
+ $player = $GeneralSettings['video_player'];
 
1009
  }; break;
1010
  }
1011
  }
1084
  $EpisodeData = powerpress_get_enclosure_data_podpress($post_id);
1085
  }
1086
 
1087
+ $GeneralSettings = get_option('powerpress_general');
1088
+
1089
+ echo '<!DOCTYPE html>'; // HTML5!
1090
  ?>
1091
  <html xmlns="http://www.w3.org/1999/xhtml">
1092
  <head>
1095
  <meta name="robots" content="noindex" />
1096
  <?php
1097
 
1098
+ wp_enqueue_script( 'powerpress-player', powerpress_get_root_url() .'player.js');
1099
+
1100
+ if( version_compare($GLOBALS['wp_version'], '3.6-alpha', '>') )
1101
+ {
1102
+ $include_mejs = false;
1103
+ if( empty($GeneralSettings['player']) || empty($GeneralSettings['video_player']) )
1104
+ {
1105
+ $include_mejs = true;
1106
+ }
1107
+ else if( !empty($GeneralSettings['player']) && ($GeneralSettings['player'] == 'mediaelement-audio' || $GeneralSettings['video_player'] == 'mediaelement-video' ) )
1108
+ {
1109
+ $include_mejs = true;
1110
+ }
1111
+
1112
+ if( $include_mejs )
1113
+ {
1114
+ wp_enqueue_style('mediaelement');
1115
+ wp_enqueue_style('wp-mediaelement');
1116
+ wp_enqueue_script('mediaelement');
1117
+ wp_enqueue_script( 'powerpress-mejs', powerpress_get_root_url() .'powerpress-mejs.js');
1118
+ }
1119
+ }
1120
+
1121
+ wp_print_styles();
1122
+ wp_print_scripts();
1123
 
1124
+ //wp_head();
1125
  ?>
1126
  <style type="text/css">
1127
+ body { font-size: 13px; font-family: Arial, Helvetica, sans-serif; /* width: 100%; min-height: 100%; } html { height: 100%; */ }
1128
  </style>
1129
  </head>
1130
  <body>
1131
  <div style="margin: 5px;">
1132
  <?php
1133
+
1134
  if( !$EpisodeData )
1135
  {
1136
  echo '<p>'. __('Unable to retrieve media information.', 'powerpress') .'</p>';
1170
  }
1171
 
1172
  // Embeds are only available for the following players
1173
+ do_powerpressplayer_embed($player, $EpisodeData['url'], $EpisodeData);
1174
  exit;
1175
  }
1176
 
1276
  return $content;
1277
  }
1278
 
1279
+ /*
1280
+ MediaElement.js Video Player
1281
+ */
1282
+ function powerpressplayer_build_mediaelementvideo($media_url, $EpisodeData=array(), $embed = false )
1283
+ {
1284
+ $player_id = powerpressplayer_get_next_id();
1285
+ $cover_image = '';
1286
+ $player_width = 400;
1287
+ $player_height = 225;
1288
+ $autoplay = false;
1289
+ // Global Settings
1290
+ $Settings = get_option('powerpress_general');
1291
+ if( !empty($Settings['player_width']) )
1292
+ $player_width = $Settings['player_width'];
1293
+ if( !empty($Settings['player_height']) )
1294
+ $player_height = $Settings['player_height'];
1295
+ if( !empty($Settings['poster_image']) )
1296
+ $cover_image = $Settings['poster_image'];
1297
+ // Episode Settings
1298
+ if( !empty($EpisodeData['image']) )
1299
+ $cover_image = $EpisodeData['image'];
1300
+ if( !empty($EpisodeData['width']) )
1301
+ $player_width = $EpisodeData['width'];
1302
+ if( !empty($EpisodeData['height']) )
1303
+ $player_height = $EpisodeData['height'];
1304
+ if( !empty($EpisodeData['autoplay']) )
1305
+ $autoplay = true;
1306
+
1307
+
1308
+
1309
+
1310
+ $content = '';
1311
+
1312
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $player_id .'">'.PHP_EOL;
1313
+ $content .= '<video class="powerpress-mejs-video" width="'. $player_width .'" height="'. $player_height .'" controls="controls"';
1314
+ if( $cover_image )
1315
+ $content .= ' poster="'. $cover_image .'"';
1316
+ if( $autoplay )
1317
+ $content .= ' autoplay="autoplay"';
1318
+ else
1319
+ $content .= ' preload="none"';
1320
+ $content .= '>'.PHP_EOL;
1321
+ $content_type = powerpress_get_contenttype($media_url);
1322
+
1323
+ // Prevent pre-loading in certain browsers
1324
+ $media_url_src = $media_url;
1325
+ if( preg_match('/msie|webkit|applecoremedia/i', $_SERVER['HTTP_USER_AGENT']) && !preg_match('/chrome/i', $_SERVER['HTTP_USER_AGENT']) ) {
1326
+ $media_url_src = '#'.$media_url;
1327
+ }
1328
+
1329
+ $content .='<source src="'. $media_url_src .'" type="'. $content_type .'" />';
1330
+
1331
+ if( !empty($EpisodeData['webm_src']) )
1332
+ {
1333
+ $EpisodeData['webm_src'] = powerpress_add_flag_to_redirect_url($EpisodeData['webm_src'], 'p');
1334
+ $content .='<source src="'. $EpisodeData['webm_src'] .'" type="video/webm" />';
1335
+ }
1336
+
1337
+ $content .= powerpressplayer_build_playimage($media_url, $EpisodeData);
1338
+ $content .= '</video>'.PHP_EOL;
1339
+ $content .= '</div>'.PHP_EOL;
1340
+ return $content;
1341
+ }
1342
+
1343
  /*
1344
  HTTML 5 Audio Player
1345
  */
1356
  $content .= '<div class="powerpress_player" id="powerpress_player_'. $player_id .'">'.PHP_EOL;
1357
  $content .= '<audio controls="controls"';
1358
  $content .=' src="'. $media_url .'"';
 
 
1359
  if( $autoplay )
1360
  $content .= ' autoplay="autoplay"';
1361
  else
1397
  return $content;
1398
  }
1399
 
1400
+ /*
1401
+ MediaElement.js Audio Player
1402
+ */
1403
+ function powerpressplayer_build_mediaelementaudio($media_url, $EpisodeData=array(), $embed = false )
1404
+ {
1405
+ $player_id = powerpressplayer_get_next_id();
1406
+ $autoplay = false;
1407
+ // Episode Settings
1408
+ if( !empty($EpisodeData['autoplay']) )
1409
+ $autoplay = true;
1410
+ $content = '';
1411
+
1412
+
1413
+ $content .= '<div class="powerpress_player" id="powerpress_player_'. $player_id .'">'.PHP_EOL;
1414
+ $content .= '<audio class="powerpress-mejs-audio" controls="controls"';
1415
+
1416
+ // Prevent pre-loading in certain browsers
1417
+ $media_url_src = $media_url;
1418
+ if( preg_match('/msie|webkit|applecoremedia/i', $_SERVER['HTTP_USER_AGENT']) && !preg_match('/chrome/i', $_SERVER['HTTP_USER_AGENT']) ) {
1419
+ $media_url_src = '#'.$media_url;
1420
+ }
1421
+
1422
+ $content .=' src="'. $media_url_src .'"';
1423
+ //if( $cover_image ) // Audio does not have a coverart image (not yet anyway)
1424
+ // $content .= ' poster="'. $cover_image .'"';
1425
+ if( $autoplay )
1426
+ $content .= ' autoplay="autoplay"';
1427
+ else
1428
+ $content .= ' preload="none"';
1429
+ $content .= '>'.PHP_EOL;
1430
+
1431
+
1432
+ $content .= powerpressplayer_build_playimageaudio($media_url);
1433
+ $content .= '</audio>'.PHP_EOL;
1434
+ $content .= '</div>'.PHP_EOL;
1435
+
1436
+
1437
+ return $content;
1438
+ }
1439
+
1440
  /*
1441
  HTTML 5 Mobile Player
1442
  */
1460
  case 'ogg':
1461
  case 'ogv': {
1462
  // Video
1463
+ $Settings = get_option('powerpress_general');
1464
+
1465
+ // MEJS is not ready for mobile, using native HTML5 performs more efficiently at this point. Someday though we will be able to use MEJS for mobile.
1466
+ if( false && $html5 && !empty($Settings['video_player']) && $Settings['video_player'] == 'mediaelement-video' )
1467
+ $content .= powerpressplayer_build_mediaelementvideo($media_url, $EpisodeData);
1468
+ else if( $html5 )
1469
  $content .= powerpressplayer_build_html5video($media_url, $EpisodeData);
1470
  else
1471
  $content .= powerpressplayer_build_playimage($media_url, $EpisodeData, true);
1474
  case 'm4a':
1475
  case 'oga': {
1476
  // Audio
1477
+ $Settings = get_option('powerpress_general');
1478
+
1479
+ // MEJS is not ready for mobile, using native HTML5 performs more efficiently at this point. Someday though we will be able to use MEJS for mobile.
1480
+ if( false && $html5 && !empty($Settings['player']) && $Settings['player'] == 'mediaelement-audio' )
1481
+ $content .= powerpressplayer_build_mediaelementaudio($media_url, $EpisodeData);
1482
+ else if( $html5 )
1483
  $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData);
1484
  else
1485
  $content .= powerpressplayer_build_playimageaudio($media_url, true);
2058
  return $content;
2059
  }
2060
 
 
 
2061
  ?>
powerpress.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Blubrry PowerPress
4
  Plugin URI: http://create.blubrry.com/resources/powerpress/
5
  Description: <a href="http://create.blubrry.com/resources/powerpress/" target="_blank">Blubrry PowerPress</a> adds podcasting support to your blog. Features include: media player, 3rd party statistics, iTunes integration, Blubrry Services (Media Statistics and Hosting) integration and a lot more.
6
- Version: 4.0.9
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
@@ -11,8 +11,7 @@ Change Log:
11
 
12
  Contributors:
13
  Angelo Mandato, CIO RawVoice - Plugin founder, architect and lead developer
14
- Pat McSweeny, Developer for RawVoice - Developed initial version (v0.1.0) of plugin
15
- Jerry Stephens, Way of the Geek (http://wayofthegeek.org/) - Contributed initial code fix for excerpt bug resolved in v0.6.1
16
 
17
  Credits:
18
  getID3(), License: GPL 2.0+ by James Heinrich <info [at] getid3.org> http://www.getid3.org
@@ -33,7 +32,7 @@ if( !function_exists('add_action') )
33
  die("access denied.");
34
 
35
  // WP_PLUGIN_DIR (REMEMBER TO USE THIS DEFINE IF NEEDED)
36
- define('POWERPRESS_VERSION', '4.0.9' );
37
 
38
  // Translation support:
39
  if ( !defined('POWERPRESS_ABSPATH') )
@@ -80,8 +79,6 @@ if( !defined('POWERPRESS_CAPABILITY_MANAGE_OPTIONS') )
80
  define('POWERPRESS_CAPABILITY_MANAGE_OPTIONS', 'manage_options');
81
  if( !defined('POWERPRESS_CAPABILITY_EDIT_PAGES') )
82
  define('POWERPRESS_CAPABILITY_EDIT_PAGES', 'edit_pages');
83
-
84
- //define('POWERPRESS_ENQUEUE_SCRIPTS', true); // Add this define to your wp-config.php if you want the audio.js enqueued with other plugin scripts in your blog.
85
 
86
  //define('POWERPRESS_ENABLE_HTTPS_MEDIA', true); // Add this define to your wp-config.php if you wnat to allow media URLs that begin with https://
87
 
@@ -319,10 +316,6 @@ function powerpress_header()
319
  if( !isset($Powerpress['player_function']) || $Powerpress['player_function'] > 0 ) // Don't include the player in the header if it is not needed...
320
  {
321
  $PowerpressPluginURL = powerpress_get_root_url();
322
- if( !defined('POWERPRESS_ENQUEUE_SCRIPTS') )
323
- {
324
- echo "<script type=\"text/javascript\" src=\"". powerpress_get_root_url() ."player.js\"></script>\n";
325
- }
326
  ?>
327
  <script type="text/javascript"><!--
328
  <?php
@@ -332,12 +325,12 @@ function powerpress_header()
332
  if( isset($Powerpress['new_window_width']) && $Powerpress['new_window_width'] > 0 )
333
  $new_window_width = $Powerpress['new_window_width'];
334
  else if( isset($Powerpress['new_window_width']) )
335
- $new_window_width = 50;
336
 
337
  if( isset($Powerpress['new_window_height']) && $Powerpress['new_window_height'] > 0 )
338
  $new_window_height = $Powerpress['new_window_height'];
339
  else if( isset($Powerpress['new_window_height']) )
340
- $new_window_height = 20;
341
 
342
  if( empty($Powerpress['new_window_nofactor']) )
343
  {
@@ -424,7 +417,12 @@ function powerpress_rss2_head()
424
  $General = get_option('powerpress_general');
425
 
426
  // We made it this far, lets write stuff to the feed!
427
- echo '<!-- podcast_generator="Blubrry PowerPress/'. POWERPRESS_VERSION .'" -->'.PHP_EOL;
 
 
 
 
 
428
 
429
  // add the itunes:new-feed-url tag to feed
430
  if( powerpress_is_custom_podcast_feed() )
@@ -751,7 +749,7 @@ function powerpress_rss2_item()
751
  echo "\t<itunes:subtitle>". powerpress_format_itunes_value($subtitle, 'subtitle') .'</itunes:subtitle>'.PHP_EOL;
752
  else if( $excerpt_no_html )
753
  echo "\t<itunes:subtitle>". powerpress_format_itunes_value($excerpt_no_html, 'subtitle') .'</itunes:subtitle>'.PHP_EOL;
754
- else
755
  echo "\t<itunes:subtitle>". powerpress_format_itunes_value($content_no_html, 'subtitle') .'</itunes:subtitle>'.PHP_EOL;
756
 
757
  if( empty($powerpress_feed['feed_maximizer_on']) )
@@ -769,6 +767,12 @@ function powerpress_rss2_item()
769
  echo "\t\t<itunes:author>" . esc_html($author) . '</itunes:author>'.PHP_EOL;
770
  else
771
  echo "\t\t<itunes:author>".'NO AUTHOR</itunes:author>'.PHP_EOL;
 
 
 
 
 
 
772
  }
773
 
774
  if( $explicit )
@@ -893,15 +897,30 @@ function powerpress_bloginfo_rss($content, $field = '')
893
  {
894
  if( powerpress_is_custom_podcast_feed() )
895
  {
896
- if( is_category() )
897
  $Feed = get_option('powerpress_cat_feed_'.get_query_var('cat') );
 
898
  else if( is_tax() || is_tag() ) {
899
  global $powerpress_feed;
900
  if( !empty($powerpress_feed['term_taxonomy_id']) )
901
  $Feed = get_option('powerpress_taxonomy_'.$powerpress_feed['term_taxonomy_id'] );
902
  }
903
  else
904
- $Feed = get_option('powerpress_feed_'.get_query_var('feed') );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
905
  //$Feed = true;
906
  if( $Feed )
907
  {
@@ -1148,7 +1167,9 @@ function powerpress_init()
1148
  }
1149
 
1150
  // Add the podcast feeds;
1151
- add_feed('podcast', 'powerpress_do_podcast_feed');
 
 
1152
  if( $GeneralSettings && isset($GeneralSettings['custom_feeds']) && is_array($GeneralSettings['custom_feeds']) )
1153
  {
1154
  while( list($feed_slug,$feed_title) = each($GeneralSettings['custom_feeds']) )
@@ -1158,6 +1179,22 @@ function powerpress_init()
1158
  }
1159
  }
1160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1161
 
1162
  if( defined('GAWP_VERSION') )
1163
  {
@@ -1173,13 +1210,17 @@ function powerpress_request($qv)
1173
  {
1174
  $podcast_feed_slug = false;
1175
  if( $qv['feed'] == 'podcast' ) {
1176
- $podcast_feed_slug = 'podcast';
 
 
1177
  } else if( $qv['feed'] == 'rss' || $qv['feed'] == 'rss2' || $qv['feed'] == 'atom' || $qv['feed'] == 'rdf' || $qv['feed'] == 'feed' ) { // 'feed', 'rdf', 'rss', 'rss2', 'atom'
1178
  // Skip
1179
  } else {
1180
  $GeneralSettings = get_option('powerpress_general');
1181
- if( isset($GeneralSettings['custom_feeds']) && is_array($GeneralSettings['custom_feeds']) && !empty($GeneralSettings['custom_feeds'][ $qv['feed'] ] ) )
1182
  $podcast_feed_slug = $qv['feed'];
 
 
1183
  }
1184
 
1185
  if( $podcast_feed_slug )
@@ -1263,6 +1304,8 @@ function powerpress_load_general_feed_settings()
1263
 
1264
  if( !empty($GeneralSettings['podcast_embed_in_feed']) )
1265
  $powerpress_feed['podcast_embed_in_feed'] = true;
 
 
1266
  return;
1267
  }
1268
  else if( ( defined('POWERPRESS_TAXONOMY_PODCASTING') || !empty($Powerpress['taxonomy_podcasting']) ) && ( is_tag() || is_tax() ) )
@@ -1304,49 +1347,76 @@ function powerpress_load_general_feed_settings()
1304
 
1305
  if( !empty($GeneralSettings['podcast_embed_in_feed']) )
1306
  $powerpress_feed['podcast_embed_in_feed'] = true;
 
 
1307
  return;
1308
  }
1309
  }
1310
  }
1311
 
1312
  $feed_slug = get_query_var('feed');
1313
-
1314
- if( isset($GeneralSettings['custom_feeds']) && is_array($GeneralSettings['custom_feeds']) && isset($GeneralSettings['custom_feeds'][ $feed_slug ] ))
1315
  {
1316
- $FeedCustom = get_option('powerpress_feed_'.$feed_slug); // Get custom feed specific settings
1317
- $Feed = powerpress_merge_empty_feed_settings($FeedCustom, $FeedSettingsBasic);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1318
 
1319
- $powerpress_feed = array();
1320
- $powerpress_feed['is_custom'] = true;
1321
- $powerpress_feed['feed-slug'] = $feed_slug;
1322
- $powerpress_feed['process_podpress'] = ($feed_slug=='podcast'? !empty($GeneralSettings['process_podpress']): false); // We don't touch podpress data for custom feeds
1323
- $powerpress_feed['rss_language'] = ''; // RSS language should be set by WordPress by default
1324
- $powerpress_feed['default_url'] = '';
1325
- if( !empty($powerpress_feed['default_url']) )
1326
- $powerpress_feed['default_url'] = rtrim($GeneralSettings['default_url'], '/') .'/';
1327
- $explicit = array("no", "yes", "clean");
1328
- $powerpress_feed['explicit'] ='no';
1329
- if( !empty($Feed['itunes_explicit']) )
1330
- $powerpress_feed['explicit'] = $explicit[ $Feed['itunes_explicit'] ];
1331
- if( !empty($Feed['itunes_talent_name']) )
1332
- $powerpress_feed['itunes_talent_name'] = $Feed['itunes_talent_name'];
1333
- else
1334
- $powerpress_feed['itunes_talent_name'] = get_bloginfo_rss('name');
1335
- $powerpress_feed['enhance_itunes_summary'] = $Feed['enhance_itunes_summary'];
1336
- $powerpress_feed['posts_per_rss'] = false;
1337
- if( !empty($Feed['posts_per_rss']) && is_numeric($Feed['posts_per_rss']) && $Feed['posts_per_rss'] > 0 )
1338
- $powerpress_feed['posts_per_rss'] = $Feed['posts_per_rss'];
1339
- if( !empty($Feed['feed_redirect_url']) )
1340
- $powerpress_feed['feed_redirect_url'] = $Feed['feed_redirect_url'];
1341
- if( !empty($Feed['itunes_author_post'] ) )
1342
- $powerpress_feed['itunes_author_post'] = true;
1343
- if( !empty($Feed['rss_language']) )
1344
- $powerpress_feed['rss_language'] = $Feed['rss_language'];
1345
- if( !empty($GeneralSettings['podcast_embed_in_feed']) )
1346
- $powerpress_feed['podcast_embed_in_feed'] = true;
1347
- if( !empty($Feed['maximize_feed']) )
1348
- $powerpress_feed['maximize_feed'] = true;
1349
- return;
 
 
 
 
 
 
 
1350
  }
1351
 
1352
  if( !isset($FeedSettingsBasic['apply_to']) )
@@ -1402,6 +1472,9 @@ function powerpress_load_general_feed_settings()
1402
  $powerpress_feed['rss_language'] = ''; // Cannot set the language setting in simple mode
1403
  if( !empty($GeneralSettings['podcast_embed_in_feed']) )
1404
  $powerpress_feed['podcast_embed_in_feed'] = true;
 
 
 
1405
  }; break;
1406
  // All other cases we let fall through
1407
  }
@@ -1957,6 +2030,7 @@ function powerpress_trim_itunes_value($value, $tag = 'summary')
1957
 
1958
  switch($tag)
1959
  {
 
1960
  case 'summary': {
1961
  // 4000 character limit
1962
  if( $length > 4000 )
@@ -2434,8 +2508,7 @@ function get_the_powerpress_all_players($slug = false, $no_link=false)
2434
  while( have_posts() )
2435
  {
2436
  the_post();
2437
- //$PostMetaKeys = get_post_custom_keys($post->ID);
2438
- //print_r($PostMetaKeys);
2439
  while( list($null,$feed_slug) = each($ChannelSlugs) )
2440
  {
2441
  // Do we follow the global settings to disable a player?
@@ -2470,7 +2543,6 @@ function get_the_powerpress_all_players($slug = false, $no_link=false)
2470
  if( !isset($EpisodeData['no_links']) && $no_link == false )
2471
  {
2472
  $return .= apply_filters('powerpress_player_links', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), $EpisodeData );
2473
- // $return .= powerpress_get_player_links(get_the_ID(), $feed_slug, $EpisodeData );
2474
  }
2475
  }
2476
  reset($ChannelSlugs);
3
  Plugin Name: Blubrry PowerPress
4
  Plugin URI: http://create.blubrry.com/resources/powerpress/
5
  Description: <a href="http://create.blubrry.com/resources/powerpress/" target="_blank">Blubrry PowerPress</a> adds podcasting support to your blog. Features include: media player, 3rd party statistics, iTunes integration, Blubrry Services (Media Statistics and Hosting) integration and a lot more.
6
+ Version: 5.0
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
11
 
12
  Contributors:
13
  Angelo Mandato, CIO RawVoice - Plugin founder, architect and lead developer
14
+ See readme.txt for full list of contributors.
 
15
 
16
  Credits:
17
  getID3(), License: GPL 2.0+ by James Heinrich <info [at] getid3.org> http://www.getid3.org
32
  die("access denied.");
33
 
34
  // WP_PLUGIN_DIR (REMEMBER TO USE THIS DEFINE IF NEEDED)
35
+ define('POWERPRESS_VERSION', '5.0' );
36
 
37
  // Translation support:
38
  if ( !defined('POWERPRESS_ABSPATH') )
79
  define('POWERPRESS_CAPABILITY_MANAGE_OPTIONS', 'manage_options');
80
  if( !defined('POWERPRESS_CAPABILITY_EDIT_PAGES') )
81
  define('POWERPRESS_CAPABILITY_EDIT_PAGES', 'edit_pages');
 
 
82
 
83
  //define('POWERPRESS_ENABLE_HTTPS_MEDIA', true); // Add this define to your wp-config.php if you wnat to allow media URLs that begin with https://
84
 
316
  if( !isset($Powerpress['player_function']) || $Powerpress['player_function'] > 0 ) // Don't include the player in the header if it is not needed...
317
  {
318
  $PowerpressPluginURL = powerpress_get_root_url();
 
 
 
 
319
  ?>
320
  <script type="text/javascript"><!--
321
  <?php
325
  if( isset($Powerpress['new_window_width']) && $Powerpress['new_window_width'] > 0 )
326
  $new_window_width = $Powerpress['new_window_width'];
327
  else if( isset($Powerpress['new_window_width']) )
328
+ $new_window_width = 420;
329
 
330
  if( isset($Powerpress['new_window_height']) && $Powerpress['new_window_height'] > 0 )
331
  $new_window_height = $Powerpress['new_window_height'];
332
  else if( isset($Powerpress['new_window_height']) )
333
+ $new_window_height = 240;
334
 
335
  if( empty($Powerpress['new_window_nofactor']) )
336
  {
417
  $General = get_option('powerpress_general');
418
 
419
  // We made it this far, lets write stuff to the feed!
420
+ echo '<!-- podcast_generator="Blubrry PowerPress/'. POWERPRESS_VERSION .'" ';
421
+ if( isset($General['advanced_mode_2']) && empty($General['advanced_mode_2']) )
422
+ echo 'mode="simple" ';
423
+ else
424
+ echo 'mode="advanced" ';
425
+ echo '-->'.PHP_EOL;
426
 
427
  // add the itunes:new-feed-url tag to feed
428
  if( powerpress_is_custom_podcast_feed() )
749
  echo "\t<itunes:subtitle>". powerpress_format_itunes_value($subtitle, 'subtitle') .'</itunes:subtitle>'.PHP_EOL;
750
  else if( $excerpt_no_html )
751
  echo "\t<itunes:subtitle>". powerpress_format_itunes_value($excerpt_no_html, 'subtitle') .'</itunes:subtitle>'.PHP_EOL;
752
+ else if( $content_no_html )
753
  echo "\t<itunes:subtitle>". powerpress_format_itunes_value($content_no_html, 'subtitle') .'</itunes:subtitle>'.PHP_EOL;
754
 
755
  if( empty($powerpress_feed['feed_maximizer_on']) )
767
  echo "\t\t<itunes:author>" . esc_html($author) . '</itunes:author>'.PHP_EOL;
768
  else
769
  echo "\t\t<itunes:author>".'NO AUTHOR</itunes:author>'.PHP_EOL;
770
+
771
+ // itunes episode image
772
+ if( !empty( $EpisodeData['itunes_image']) )
773
+ echo "\t\t".'<itunes:image href="' . esc_html( str_replace(' ', '+', $EpisodeData['itunes_image']), 'double') . '" />'.PHP_EOL;
774
+ else if( !empty($powerpress_feed['itunes_image']) )
775
+ echo "\t\t".'<itunes:image href="' . esc_html( str_replace(' ', '+', $powerpress_feed['itunes_image']), 'double') . '" />'.PHP_EOL;
776
  }
777
 
778
  if( $explicit )
897
  {
898
  if( powerpress_is_custom_podcast_feed() )
899
  {
900
+ if( is_category() ) {
901
  $Feed = get_option('powerpress_cat_feed_'.get_query_var('cat') );
902
+ }
903
  else if( is_tax() || is_tag() ) {
904
  global $powerpress_feed;
905
  if( !empty($powerpress_feed['term_taxonomy_id']) )
906
  $Feed = get_option('powerpress_taxonomy_'.$powerpress_feed['term_taxonomy_id'] );
907
  }
908
  else
909
+ {
910
+ global $powerpress_feed;
911
+ //var_dump($powerpress_feed);
912
+ if( !empty($powerpress_feed['post_type']) )
913
+ {
914
+ $feed_slug = get_query_var('feed');
915
+ $PostTypeSettingsArray = get_option('powerpress_posttype_'.$powerpress_feed['post_type'] );
916
+ if( !empty($PostTypeSettingsArray[ $feed_slug ]) )
917
+ $Feed = $PostTypeSettingsArray[ $feed_slug ];
918
+ }
919
+ else
920
+ {
921
+ $Feed = get_option('powerpress_feed_'.get_query_var('feed') );
922
+ }
923
+ }
924
  //$Feed = true;
925
  if( $Feed )
926
  {
1167
  }
1168
 
1169
  // Add the podcast feeds;
1170
+ if( !defined('POWERPRESS_NO_PODCAST_FEED') )
1171
+ add_feed('podcast', 'powerpress_do_podcast_feed');
1172
+
1173
  if( $GeneralSettings && isset($GeneralSettings['custom_feeds']) && is_array($GeneralSettings['custom_feeds']) )
1174
  {
1175
  while( list($feed_slug,$feed_title) = each($GeneralSettings['custom_feeds']) )
1179
  }
1180
  }
1181
 
1182
+ if( !empty($GeneralSettings['posttype_podcasting']) )
1183
+ {
1184
+ // Loop through the posttype podcasting settings and set the feeds for the custom post type slugs...
1185
+ global $wp_rewrite;
1186
+ $FeedSlugPostTypesArray = get_option('powerpress_posttype_podcasting');
1187
+ if( empty($FeedSlugPostTypesArray) )
1188
+ $FeedSlugPostTypesArray = array();
1189
+
1190
+ while( list($feed_slug, $FeedSlugPostTypes) = each($FeedSlugPostTypesArray) )
1191
+ {
1192
+ if ( !in_array($feed_slug, $wp_rewrite->feeds) ) // we need to add this feed name
1193
+ {
1194
+ add_feed($feed_slug, 'powerpress_do_podcast_feed');
1195
+ }
1196
+ }
1197
+ }
1198
 
1199
  if( defined('GAWP_VERSION') )
1200
  {
1210
  {
1211
  $podcast_feed_slug = false;
1212
  if( $qv['feed'] == 'podcast' ) {
1213
+ $GeneralSettings = get_option('powerpress_general');
1214
+ if( empty($GeneralSettings['posttype_podcasting']) )
1215
+ $podcast_feed_slug = 'podcast';
1216
  } else if( $qv['feed'] == 'rss' || $qv['feed'] == 'rss2' || $qv['feed'] == 'atom' || $qv['feed'] == 'rdf' || $qv['feed'] == 'feed' ) { // 'feed', 'rdf', 'rss', 'rss2', 'atom'
1217
  // Skip
1218
  } else {
1219
  $GeneralSettings = get_option('powerpress_general');
1220
+ if( empty($GeneralSettings['posttype_podcasting']) && isset($GeneralSettings['custom_feeds']) && is_array($GeneralSettings['custom_feeds']) && !empty($GeneralSettings['custom_feeds'][ $qv['feed'] ] ) )
1221
  $podcast_feed_slug = $qv['feed'];
1222
+
1223
+
1224
  }
1225
 
1226
  if( $podcast_feed_slug )
1304
 
1305
  if( !empty($GeneralSettings['podcast_embed_in_feed']) )
1306
  $powerpress_feed['podcast_embed_in_feed'] = true;
1307
+ if( !empty($Feed['episode_itunes_image']) && !empty($Feed['itunes_image']) )
1308
+ $powerpress_feed['itunes_image'] = $Feed['itunes_image'];
1309
  return;
1310
  }
1311
  else if( ( defined('POWERPRESS_TAXONOMY_PODCASTING') || !empty($Powerpress['taxonomy_podcasting']) ) && ( is_tag() || is_tax() ) )
1347
 
1348
  if( !empty($GeneralSettings['podcast_embed_in_feed']) )
1349
  $powerpress_feed['podcast_embed_in_feed'] = true;
1350
+ if( !empty($Feed['episode_itunes_image']) && !empty($Feed['itunes_image']) )
1351
+ $powerpress_feed['itunes_image'] = $Feed['itunes_image'];
1352
  return;
1353
  }
1354
  }
1355
  }
1356
 
1357
  $feed_slug = get_query_var('feed');
1358
+ // Are we dealing with a custom podcast channel or a custom post type podcast feed...
1359
+ if( !empty($GeneralSettings['posttype_podcasting']) || !empty($GeneralSettings['custom_feeds'][ $feed_slug ]) )
1360
  {
1361
+ $Feed = false;
1362
+ if( !empty($GeneralSettings['posttype_podcasting']) )
1363
+ {
1364
+ $post_type = get_query_var('post_type');
1365
+ //$post_type = get_post_type();
1366
+
1367
+ // Get the settings for this podcast post type
1368
+ $PostTypeSettingsArray = get_option('powerpress_posttype_'. $post_type);
1369
+ if( !empty($PostTypeSettingsArray[ $feed_slug ]) )
1370
+ {
1371
+ $FeedCustom = $PostTypeSettingsArray[ $feed_slug ];
1372
+ $Feed = powerpress_merge_empty_feed_settings($FeedCustom, $FeedSettingsBasic);
1373
+ $Feed['post_type'] = $post_type;
1374
+ }
1375
+ }
1376
+ if( empty($Feed) && !empty($GeneralSettings['custom_feeds'][ $feed_slug ]) )
1377
+ {
1378
+ $FeedCustom = get_option('powerpress_feed_'.$feed_slug); // Get custom feed specific settings
1379
+ $Feed = powerpress_merge_empty_feed_settings($FeedCustom, $FeedSettingsBasic);
1380
+ }
1381
 
1382
+ if( $Feed )
1383
+ {
1384
+ $powerpress_feed = array();
1385
+ $powerpress_feed['is_custom'] = true;
1386
+ $powerpress_feed['feed-slug'] = $feed_slug;
1387
+ if( !empty($Feed['post_type']) )
1388
+ $powerpress_feed['post_type'] = $Feed['post_type'];
1389
+ $powerpress_feed['process_podpress'] = ($feed_slug=='podcast'? !empty($GeneralSettings['process_podpress']): false); // We don't touch podpress data for custom feeds
1390
+ $powerpress_feed['rss_language'] = ''; // RSS language should be set by WordPress by default
1391
+ $powerpress_feed['default_url'] = '';
1392
+ if( !empty($powerpress_feed['default_url']) )
1393
+ $powerpress_feed['default_url'] = rtrim($GeneralSettings['default_url'], '/') .'/';
1394
+ $explicit = array("no", "yes", "clean");
1395
+ $powerpress_feed['explicit'] ='no';
1396
+ if( !empty($Feed['itunes_explicit']) )
1397
+ $powerpress_feed['explicit'] = $explicit[ $Feed['itunes_explicit'] ];
1398
+ if( !empty($Feed['itunes_talent_name']) )
1399
+ $powerpress_feed['itunes_talent_name'] = $Feed['itunes_talent_name'];
1400
+ else
1401
+ $powerpress_feed['itunes_talent_name'] = get_bloginfo_rss('name');
1402
+ $powerpress_feed['enhance_itunes_summary'] = $Feed['enhance_itunes_summary'];
1403
+ $powerpress_feed['posts_per_rss'] = false;
1404
+ if( !empty($Feed['posts_per_rss']) && is_numeric($Feed['posts_per_rss']) && $Feed['posts_per_rss'] > 0 )
1405
+ $powerpress_feed['posts_per_rss'] = $Feed['posts_per_rss'];
1406
+ if( !empty($Feed['feed_redirect_url']) )
1407
+ $powerpress_feed['feed_redirect_url'] = $Feed['feed_redirect_url'];
1408
+ if( !empty($Feed['itunes_author_post'] ) )
1409
+ $powerpress_feed['itunes_author_post'] = true;
1410
+ if( !empty($Feed['rss_language']) )
1411
+ $powerpress_feed['rss_language'] = $Feed['rss_language'];
1412
+ if( !empty($GeneralSettings['podcast_embed_in_feed']) )
1413
+ $powerpress_feed['podcast_embed_in_feed'] = true;
1414
+ if( !empty($Feed['maximize_feed']) )
1415
+ $powerpress_feed['maximize_feed'] = true;
1416
+ if( !empty($Feed['episode_itunes_image']) && !empty($Feed['itunes_image']) )
1417
+ $powerpress_feed['itunes_image'] = $Feed['itunes_image'];
1418
+ return;
1419
+ }
1420
  }
1421
 
1422
  if( !isset($FeedSettingsBasic['apply_to']) )
1472
  $powerpress_feed['rss_language'] = ''; // Cannot set the language setting in simple mode
1473
  if( !empty($GeneralSettings['podcast_embed_in_feed']) )
1474
  $powerpress_feed['podcast_embed_in_feed'] = true;
1475
+ if( !empty($Feed['episode_itunes_image']) && !empty($Feed['itunes_image']) )
1476
+ $powerpress_feed['itunes_image'] = $Feed['itunes_image'];
1477
+
1478
  }; break;
1479
  // All other cases we let fall through
1480
  }
2030
 
2031
  switch($tag)
2032
  {
2033
+ case 'description':
2034
  case 'summary': {
2035
  // 4000 character limit
2036
  if( $length > 4000 )
2508
  while( have_posts() )
2509
  {
2510
  the_post();
2511
+
 
2512
  while( list($null,$feed_slug) = each($ChannelSlugs) )
2513
  {
2514
  // Do we follow the global settings to disable a player?
2543
  if( !isset($EpisodeData['no_links']) && $no_link == false )
2544
  {
2545
  $return .= apply_filters('powerpress_player_links', '', powerpress_add_flag_to_redirect_url($EpisodeData['url'], 'p'), $EpisodeData );
 
2546
  }
2547
  }
2548
  reset($ChannelSlugs);
powerpressadmin-basic.php CHANGED
@@ -2,11 +2,24 @@
2
 
3
  function powerpress_admin_basic()
4
  {
 
 
 
5
  $General = powerpress_get_settings('powerpress_general');
6
  $General = powerpress_default_settings($General, 'basic');
 
 
7
 
8
  $FeedSettings = powerpress_get_settings('powerpress_feed');
9
  $FeedSettings = powerpress_default_settings($FeedSettings, 'editfeed');
 
 
 
 
 
 
 
 
10
  ?>
11
  <script type="text/javascript"><!--
12
  function CheckRedirect(obj)
@@ -36,6 +49,12 @@ function SelectEmbedField(checked)
36
 
37
  jQuery(document).ready(function($) {
38
 
 
 
 
 
 
 
39
  jQuery('#episode_box_player_links_options').change(function () {
40
 
41
  var objectChecked = jQuery('#episode_box_player_links_options').attr('checked');
@@ -97,14 +116,23 @@ jQuery(document).ready(function($) {
97
  $("#episode_box_order").removeAttr("disabled");
98
  }
99
  });
 
100
  } );
101
  //-->
102
  </script>
103
 
104
  <input type="hidden" name="action" value="powerpress-save-settings" />
 
 
 
105
  <input type="hidden" id="save_tab_pos" name="tab" value="<?php echo (empty($_POST['tab'])?0:$_POST['tab']); ?>" />
106
 
107
- <h2><?php echo __('Blubrry PowerPress Settings', 'powerpress'); ?></h2>
 
 
 
 
 
108
 
109
  <div id="powerpress_settings_page" class="powerpress_tabbed_content">
110
  <ul class="powerpress_settings_tabs">
@@ -114,7 +142,7 @@ jQuery(document).ready(function($) {
114
  <li><a href="#tab3"><span><?php echo htmlspecialchars(__('Media Appearance', 'powerpress')); ?></span></a></li>
115
  <li><a href="#tab4"><span><?php echo htmlspecialchars(__('Feeds', 'powerpress')); ?></span></a></li>
116
  <li><a href="#tab5"><span><?php echo htmlspecialchars(__('iTunes', 'powerpress')); ?></span></a></li>
117
- <li><a href="#tab6"><span><?php echo htmlspecialchars(__('T.V.', 'powerpress')); ?></span></a></li>
118
  </ul>
119
 
120
  <div id="tab0" class="powerpress_tab">
@@ -144,20 +172,21 @@ jQuery(document).ready(function($) {
144
  <div id="tab4" class="powerpress_tab">
145
  <?php
146
  powerpressadmin_edit_feed_general($FeedSettings, $General);
147
- powerpressadmin_edit_feed_settings($FeedSettings, $General);
 
148
  ?>
149
  </div>
150
 
151
  <div id="tab5" class="powerpress_tab">
152
  <?php
153
- powerpressadmin_edit_itunes_general($General);
154
- powerpressadmin_edit_itunes_feed($FeedSettings, $General);
155
  ?>
156
  </div>
157
 
158
  <div id="tab6" class="powerpress_tab">
159
  <?php
160
- powerpressadmin_edit_tv($FeedSettings);
161
  ?>
162
  </div>
163
 
@@ -165,6 +194,13 @@ jQuery(document).ready(function($) {
165
  <div class="clear">