PowerPress Podcasting plugin by Blubrry - Version 0.9.0

Version Description

Download this release

Release Info

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

Code changes from version 0.8.3 to 0.9.0

images/blubrry_folder.png ADDED
Binary file
player.js CHANGED
@@ -1,13 +1,14 @@
1
  /**
2
- * jsMediaPlayer 1.1.1 for Blubrry PowerPress
3
  *
4
  * http://www.blubrry.com/powepress/
5
  *
6
- * Copyright (c) 2008 Angelo Mandato (angelo [at] mandato {period} com)
7
  *
8
  * Released under Aoache 2 license:
9
  * http://www.apache.org/licenses/LICENSE-2.0
10
  *
 
11
  * versoin 1.1.3 - 03/23/2009 - Added code to support FlowPlayer v3.
12
  * versoin 1.1.2 - 03/04/2009 - Added options to set the width for audio, width and height for video.
13
  * versoin 1.1.1 - 12/22/20008 - Minor change to support Windows Media in Firefox. Includes link to preferred Firefox Windows Media Player plugin.
@@ -18,463 +19,65 @@
18
  * version 1.0.0 - 07/26/2008 - initial release
19
  */
20
 
21
- var g_bpPlayer = false;
22
 
23
  /**
24
- Initialize function for javascript based player
25
 
26
- @PluginURL - where plugin files are located
27
- @QuicktimeImage - image displayed in place of quicktime media types
28
- @OnlyOnePlayer - pass 'true' if only one player should appear in the current page.
 
29
  */
30
- function powerpress_player_init(PluginURL, QuicktimeImage)
31
  {
32
- var FlowPlayerVer = 2;
33
- if( powerpress_player_init.arguments.length > 3 )
34
- FlowPlayerVer = powerpress_player_init.arguments[3];
35
-
36
- if( g_bpPlayer == false && FlowPlayerVer == 3 )
37
- {
38
- g_bpPlayer = new jsMediaPlayer(PluginURL +'flowplayer-3.0.7.swf');
39
- g_bpPlayer.FlashSrcPlugin( PluginURL + 'flowplayer.audio-3.0.4.swf');
40
- }
41
- else
42
  {
43
- g_bpPlayer = new jsMediaPlayer(PluginURL +'FlowPlayerClassic.swf');
44
- }
45
-
46
- g_bpPlayer.PlayImage(QuicktimeImage);
47
- if( powerpress_player_init.arguments.length > 2 )
48
- g_bpPlayer.OnePlayerOnly(powerpress_player_init.arguments[2]);
49
- }
50
-
51
- /**
52
- Initialize function for javascript based player
53
-
54
- @Width - width of player
55
- @Height - height of player
56
- @WidthAudio - width of player (mp3 audio only)
57
- */
58
- function powerpress_player_size(Width, Height, WidthAudio)
59
- {
60
- if( g_bpPlayer )
61
- {
62
- if( Width >= 100 )
63
- g_bpPlayer.SetWidth(Width);
64
- if( Height >= 24 )
65
- g_bpPlayer.SetHeight(Height);
66
- if( WidthAudio >= 100 )
67
- g_bpPlayer.SetWidthAudio(WidthAudio);
68
  }
69
- }
70
-
71
- /**
72
- play media in page function
73
-
74
- @MediaURL - complete url to media file
75
- @PlayerDiv - Destiniation div id for player
76
- @AutoPlay - Automatically start playing media file
77
- */
78
- function powerpress_play_page()
79
- {
80
- if( !g_bpPlayer )
81
- return true; // Let the link handle itself
82
-
83
- var media_url = powerpress_play_page.arguments[0];
84
- var player_div = powerpress_play_page.arguments[1];
85
- var auto_play = false;
86
- if( powerpress_play_page.arguments.length > 2 && powerpress_play_page.arguments[2] )
87
- auto_play = true;
88
 
89
- return g_bpPlayer.PlayInPage(media_url, player_div, auto_play);
90
  }
91
 
92
  /**
93
- play media in new window function
94
 
95
- @MediaURL - complete url to media file
96
- @AutoPlay - Automatically start playing media file
 
 
97
  */
98
- function powerpress_play_window()
99
  {
100
- if( !g_bpPlayer )
101
- return true; // Let the link handle itself
102
-
103
- var media_url = powerpress_play_window.arguments[0];
104
- var auto_play = true; // Always auto play new window plays
105
-
106
- return g_bpPlayer.PlayNewWindow(media_url);
107
- }
108
-
109
- function jsMediaPlayer(FlashSrc) {
110
- // Member variables
111
- this.m_flash_src = FlashSrc;
112
- this.m_width = 320;
113
- this.m_height = 240;
114
- this.m_widthAudio = 320;
115
- this.m_player_div = false;
116
- this.m_player_wnd = false;
117
- this.m_one_player_only = false;
118
- this.m_media_url = false;
119
- this.m_play_image = false;
120
- this.m_FlowPlayerVer = 2;
121
- this.m_flash_src_plugin = '';
122
-
123
-
124
- this.FlashSrc=function(Src) {
125
- this.m_flash_src = Src;
126
- }
127
-
128
- this.SetWidth=function(Width) {
129
- this.m_width = Width;
130
- }
131
-
132
- this.SetHeight=function(Height) {
133
- this.m_height = Height;
134
- }
135
-
136
- this.SetWidthAudio=function(Width) {
137
- this.m_widthAudio = Width;
138
- }
139
-
140
- this.OnePlayerOnly=function(Setting) {
141
- this.m_one_player_only = Setting;
142
- }
143
-
144
- this.FlashSrcPlugin=function(Src) {
145
- this.m_FlowPlayerVer = (Src==''?2:3);
146
- this.m_flash_src_plugin = Src;
147
- }
148
-
149
- this.PlayImage=function(URL) {
150
- this.m_play_image = URL;
151
- }
152
-
153
- this.PlayInPage = function() {
154
-
155
- // Check if we should even use javascript based player
156
- if( this._passthru() )
157
- return true;
158
-
159
- // Make sure we're not already playing this div...
160
- if( this.m_player_div == this.PlayInPage.arguments[1] )
161
- return false;
162
-
163
- // Close the last opened player
164
- if( this.m_one_player_only )
165
- this._closePrevPlayer();
166
-
167
- // Set the proeprties:
168
- this.m_media_url = this.PlayInPage.arguments[0];
169
- this.m_player_div = this.PlayInPage.arguments[1];
170
- var auto_play = false;
171
- if( this.PlayInPage.arguments.length > 2 && this.PlayInPage.arguments[2] )
172
- auto_play = true;
173
-
174
- var ext = this._getExt(this.m_media_url);
175
- switch( ext )
176
- {
177
- case 'm4v':
178
- case 'm4a':
179
- case 'avi':
180
- case 'mpg':
181
- case 'mpeg':
182
- case 'mp4':
183
- case 'qt':
184
- case 'mov': {
185
-
186
- if( this.m_play_image && auto_play == false )
187
- {
188
- document.getElementById( this.m_player_div ).innerHTML = '<a href="'+ this.m_media_url +'" onclick="return powerpress_play_page(\''+ this.m_media_url +'\', \''+ this.m_player_div +'\',\'true\');" title="Play on page"><img src="'+ this.m_play_image +'" alt="Play on page" /></a>';
189
- this.m_player_div = false; // Let this player be used again on the page
190
- return false;
191
- }
192
-
193
- var contentType = 'video/mpeg'; // Default content type
194
- if( ext == 'm4v' )
195
- contentType = 'video/x-m4v';
196
- else if( ext == 'm4a' )
197
- contentType = 'audio/x-m4a';
198
- else if( ext == 'avi' )
199
- contentType = 'video/avi';
200
- else if( ext == 'qt' || ext == 'mov' )
201
- contentType = 'video/quicktime';
202
-
203
- document.getElementById( this.m_player_div ).innerHTML = this._getQuickTime(contentType, auto_play);
204
- }; break;
205
- case 'wma':
206
- case 'wmv':
207
- case 'asf': {
208
-
209
- if( navigator.userAgent.indexOf("Firefox") !=-1 && this.m_play_image && auto_play == false )
210
- {
211
- document.getElementById( this.m_player_div ).innerHTML = '<a href="'+ this.m_media_url +'" onclick="return powerpress_play_page(\''+ this.m_media_url +'\', \''+ this.m_player_div +'\',\'true\');" title="Play on page"><img src="'+ this.m_play_image +'" alt="Play on page" /></a>';
212
- this.m_player_div = false; // Let this player be used again on the page
213
- return false;
214
- }
215
-
216
- if( navigator.userAgent.indexOf("Firefox") !=-1 ) // Firefox:
217
- document.getElementById( this.m_player_div ).innerHTML = this._getWinPlayerFirefox(auto_play);
218
- else
219
- document.getElementById( this.m_player_div ).innerHTML = this._getWinPlayer(auto_play);
220
- }; break;
221
- case 'rm': {
222
- document.getElementById( this.m_player_div ).innerHTML = this._getRealPlayer(auto_play);
223
- }
224
- case 'swf': {
225
- document.getElementById( this.m_player_div ).innerHTML = this._getFlash(auto_play);
226
- }
227
- case 'flv': {
228
- this._doFlowPlayer(0, auto_play);
229
- }; break;
230
- case 'mp3': {
231
- this._doFlowPlayer(24, auto_play);
232
-
233
- }; break;
234
- default: {
235
- return true; // We didn't handle this, so lets let the click to the media handle itself.
236
- };
237
- }
238
-
239
- // Display the div
240
- document.getElementById( this.m_player_div ).style.display = 'block';
241
- return false; // Don't let the href go
242
- }
243
-
244
- this.PlayNewWindow=function() {
245
-
246
- // Check if we should even use javascript based player
247
- if( this._passthru() )
248
- return true;
249
-
250
- if( this.m_one_player_only )
251
- this._closePrevPlayer();
252
-
253
- // Get the media file and extension
254
- this.m_media_url = this.PlayNewWindow.arguments[0];
255
- var ext = this._getExt(this.m_media_url);
256
-
257
- // Calculate the window height
258
- height = this.m_height;
259
- if( ext == 'mp3' )
260
- {
261
- height = 24;
262
- // Adjust the height for Opera web browser, only needed for mp3s
263
- if( navigator.userAgent.indexOf("Opera") != -1 )
264
- height += 40;
265
- }
266
- else
267
- height += 40; // Add area for menu navigation
268
-
269
- this.m_player_wnd = window.open(null,"jsPlayer", 'toolbar=0,status=0,resizable=1,width='+ (this.m_width +40).toString() +',height='+ height.toString() )
270
- var Html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
271
- Html += '<html xmlns="http://www.w3.org/1999/xhtml">';
272
- Html += '<head>';
273
- Html += '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
274
- Html += '<title>Media Player</title>';
275
- if( ext == 'mp3' || ext == 'flv' || ext == 'mp4' )
276
- {
277
- Html += '<script type="text/javascript">\n';
278
- Html += 'function flashembed(root,userParams,flashvars){function getHTML(){var html="";if(typeof flashvars==\'function\'){flashvars=flashvars();}if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){html=\'<embed type="application/x-shockwave-flash" \';if(params.id){extend(params,{name:params.id});}for(var key in params){if(params[key]!==null){html+=[key]+\'="\'+params[key]+\'"\\n\\t\';}}if(flashvars){html+=\'flashvars=\\\'\'+concatVars(flashvars)+\'\\\'\';}html+=\'/>\';}else{html=\'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" \';html+=\'width="\'+params.width+\'" height="\'+params.height+\'"\';if(!params.id&&document.all){params.id="_"+(""+Math.random()).substring(5);}if(params.id){html+=\' id="\'+params.id+\'"\';}html+=\'>\';html+=\'\\n\\t<param name="movie" value="\'+params.src+\'" />\';params.id=params.src=params.width=params.height=null;for(var k in params){if(params[k]!==null){html+=\'\\n\\t<param name="\'+k+\'" value="\'+params[k]+\'" />\';}}if(flashvars){html+=\'\\n\\t<param name="flashvars" value=\\\'\'+concatVars(flashvars)+\'\\\' />\';}html+="</object>";if(debug){alert(html);}}return html;}function init(name){var timer=setInterval(function(){var doc=document;var el=doc.getElementById(name);if(el){flashembed(el,userParams,flashvars);clearInterval(timer);}else if(doc&&doc.getElementsByTagName&&doc.getElementById&&doc.body){clearInterval(timer);}},13);return true;}function extend(to,from){if(from){for(key in from){if(from.hasOwnProperty(key)){to[key]=from[key];}}}}var params={src:\'#\',width:\'100%\',height:\'100%\',version:null,onFail:null,expressInstall:null,debug:false,bgcolor:\'#ffffff\',allowfullscreen:true,allowscriptaccess:\'always\',quality:\'high\',type:\'application/x-shockwave-flash\',pluginspage:\'http://www.adobe.com/go/getflashplayer\'};if(typeof userParams==\'string\'){userParams={src:userParams};}extend(params,userParams);var version=flashembed.getVersion();var required=params.version;var express=params.expressInstall;var debug=params.debug;if(typeof root==\'string\'){var el=document.getElementById(root);if(el){root=el;}else{return init(root);}}if(!root){return;}if(!required||flashembed.isSupported(required)){params.onFail=params.version=params.expressInstall=params.debug=null;root.innerHTML=getHTML();return root.firstChild;}else if(params.onFail){var ret=params.onFail.call(params,flashembed.getVersion(),flashvars);if(ret){root.innerHTML=ret;}}else if(required&&express&&flashembed.isSupported([6,65])){extend(params,{src:express});flashvars={MMredirectURL:location.href,MMplayerType:\'PlugIn\',MMdoctitle:document.title};root.innerHTML=getHTML();}else{if(root.innerHTML.replace(/\\s/g,\'\')!==\'\'){}else{root.innerHTML="<h2>Flash version "+required+" or greater is required</h2>"+"<h3>"+(version[0]>0?"Your version is "+version:"You have no flash plugin installed")+"</h3>"+"<p>Download latest version from <a href=\'"+params.pluginspage+"\'>here</a></p>";}}function concatVars(vars){var out="";for(var key in vars){if(vars[key]){out+=[key]+\'=\'+asString(vars[key])+\'&\';}}return out.substring(0,out.length-1);}function asString(obj){switch(typeOf(obj)){case\'string\':return\'"\'+obj.replace(new RegExp(\'(["\\\\\\\\])\',\'g\'),\'\\\\$1\')+\'"\';case\'array\':return\'[\'+map(obj,function(el){return asString(el);}).join(\',\')+\']\';case\'function\':return\'"function()"\';case\'object\':var str=[];for(var prop in obj){if(obj.hasOwnProperty(prop)){str.push(\'"\'+prop+\'":\'+asString(obj[prop]));}}return\'{\'+str.join(\',\')+\'}\';}return String(obj).replace(/\\s/g," ").replace(/\\\'/g,"\\"");}function typeOf(obj){if(obj===null||obj===undefined){return false;}var type=typeof obj;return(type==\'object\'&&obj.push)?\'array\':type;}if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};});}function map(arr,func){var newArr=[];for(var i in arr){if(arr.hasOwnProperty(i)){newArr[i]=func(arr[i]);}}return newArr;}return root;}if(typeof jQuery==\'function\'){(function($){$.fn.extend({flashembed:function(params,flashvars){return this.each(function(){flashembed(this,params,flashvars);});}});})(jQuery);}flashembed=flashembed||{};flashembed.getVersion=function(){var version=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var _d=navigator.plugins["Shockwave Flash"].description;if(typeof _d!="undefined"){_d=_d.replace(/^.*\\s+(\\S+\\s+\\S+$)/,"$1");var _m=parseInt(_d.replace(/^(.*)\\..*$/,"$1"),10);var _r=/r/.test(_d)?parseInt(_d.replace(/^.*r(.*)$/,"$1"),10):0;version=[_m,_r];}}else if(window.ActiveXObject){try{var _a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{_a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version=[6,0];_a.AllowScriptAccess="always";}catch(ee){if(version[0]==6){return;}}try{_a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(eee){}}if(typeof _a=="object"){_d=_a.GetVariable("$version");if(typeof _d!="undefined"){_d=_d.replace(/^\\S+\\s+(.*)$/,"$1").split(",");version=[parseInt(_d[0],10),parseInt(_d[2],10)];}}}return version;};flashembed.isSupported=function(version){var now=flashembed.getVersion();var ret=(now[0]>version[0])||(now[0]==version[0]&&now[1]>=version[1]);return ret;};\n';
279
- Html += '</script>\n';
280
- }
281
- Html += '</head>';
282
- Html += '<body>';
283
-
284
- Html += '<div id="player" style="margin-top: 20px; margin-left: 10px;">';
285
- if( ext != 'mp3' && ext != 'flv' && ext != 'mp4' )
286
- {
287
- switch( ext )
288
- {
289
- case 'm4v':
290
- case 'm4a':
291
- case 'avi':
292
- case 'mpg':
293
- case 'mpeg':
294
- case 'qt':
295
- case 'mov': {
296
-
297
- var contentType = 'video/mpeg'; // Default content type
298
- if( ext == 'm4v' )
299
- contentType = 'video/x-m4v';
300
- else if( ext == 'm4a' )
301
- contentType = 'audio/x-m4a';
302
- else if( ext == 'avi' )
303
- contentType = 'video/avi';
304
- else if( ext == 'qt' || ext == 'mov' )
305
- contentType = 'video/quicktime';
306
-
307
- Html += this._getQuickTime(contentType, true);
308
- }; break;
309
- case 'wma':
310
- case 'wmv':
311
- case 'asf': {
312
-
313
- if( navigator.userAgent.indexOf("Firefox") !=-1 ) // Firefox:
314
- {
315
- Html += '<style>body { font-family: Arial, Helvetica, Sans-Serif; font-size: 90%;}</style>';
316
- Html += this._getWinPlayerFirefox(true);
317
- }
318
- else
319
- {
320
- Html += this._getWinPlayer(true);
321
- }
322
- }; break;
323
- case 'rm': {
324
- Html += this._getRealPlayer(true);
325
- }; break;
326
- case 'swf': {
327
- Html += this._getFlash(true);
328
- }; break;
329
- }
330
- }
331
- Html += '</div>';
332
- if( ext == 'mp3' || ext == 'flv' || ext == 'mp4' )
333
- {
334
- Html += '<script type="text/javascript">\n';
335
- if( ext == 'mp3' )
336
- Html += this._getFlowPlayer('player', 24, true);
337
- else
338
- Html += this._getFlowPlayer('player', this.m_height, true);
339
- Html += '</script>\n';
340
- }
341
- Html += '</body>';
342
- Html += '</html>';
343
- this.m_player_wnd.document.write( Html );
344
- this.m_player_wnd.document.close();
345
- this.m_player_wnd.focus();
346
- return false;
347
- }
348
-
349
- /*
350
- Private functions:
351
- */
352
- this._doFlowPlayer = function() {
353
-
354
- var height = this.m_height;
355
- var width = this.m_width;
356
- var auto_play = false;
357
- if( this._doFlowPlayer.arguments.length > 0 && this._doFlowPlayer.arguments[0] > 0 )
358
- height = this._doFlowPlayer.arguments[0];
359
- if( this._doFlowPlayer.arguments.length > 1 )
360
- auto_play = this._doFlowPlayer.arguments[1];
361
- if( height == 24 )
362
- width = this.m_widthAudio;
363
- if( this.m_FlowPlayerVer == 3 )
364
- {
365
- flashembed(
366
- this.m_player_div,
367
- {src: this.m_flash_src, width: width, height: height },
368
- {
369
- config: {
370
- plugins: {
371
- controls: {
372
- borderRadius: '0',
373
- durationColor: '#000000',
374
- timeColor: '#ECECEC',
375
- sliderColor: '#6F6F6F',
376
- sliderGradient: 'low',
377
- progressColor: '#6F6F6F',
378
- progressGradient: 'low',
379
- bufferColor: '#CCCCCC',
380
- bufferGradient: 'low',
381
- buttonColor: '#6F6F6F',
382
- buttonOverColor: '#7F7F7F',
383
- backgroundColor: '#9F9F9F',
384
- backgroundGradient: 'low',
385
- fullscreen: false,
386
- opacity:1.0
387
- },
388
- audio: {
389
- url: this.m_flash_src_plugin
390
- }
391
- },
392
- clip: {
393
- autoPlay: false,
394
- autoBuffering: false,
395
- url: this.m_media_url
396
- }
397
- }
398
- }
399
- );
400
- // {config: { autoPlay: auto_play?true:false, autoBuffering: false, initialScale: 'scale', showFullScreenButton: false, showMenu: false, videoFile: this.m_media_url, loop: false, autoRewind: true } }
401
- }
402
- else
403
- {
404
- flashembed(
405
- this.m_player_div,
406
- {src: this.m_flash_src, width: width, height: height },
407
- {config: { autoPlay: auto_play?true:false, autoBuffering: false, initialScale: 'scale', showFullScreenButton: false, showMenu: false, videoFile: this.m_media_url, loop: false, autoRewind: true } }
408
- );
409
- }
410
-
411
- return false;
412
- }
413
-
414
- this._getFlowPlayer = function(destDiv) {
415
-
416
- var height = this.m_height;
417
- if( this._getFlowPlayer.arguments.length > 1 )
418
- height = this._getFlowPlayer.arguments[1];
419
-
420
- var width = this.m_width;
421
- if( height == 24 ) // Player height
422
- width = this.m_widthAudio;
423
-
424
- var auto_play = false;
425
- if( this._getFlowPlayer.arguments.length > 2 )
426
- auto_play = this._getFlowPlayer.arguments[2];
427
-
428
- var Html = '';
429
- Html += "flashembed(\n";
430
- Html += " '"+ destDiv +"', \n";
431
- Html += " {src: '"+ this.m_flash_src +"', width: "+ width +", height: "+ height +"}, \n";
432
- Html += " {config: { autoPlay: "+ (auto_play?'true':'false') +", duration: 633, autoBuffering: false, initialScale: 'scale', showFullScreenButton: false, showMenu: false, videoFile: '"+ this.m_media_url +"', loop: false, autoRewind: true } } \n";
433
- Html += " ); \n";
434
- return Html;
435
- }
436
-
437
- this._getFlash = function() {
438
- var auto_play = false;
439
- if( this._getFlash.arguments.length > 0 )
440
- auto_play = this._getFlash.arguments[0];
441
-
442
- var Html = '';
443
- Html += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"'+ (auto_play?'':' play="false"') +' width="'+ this.m_width +'" height="'+ this.m_height +'" menu="true">\n';
444
- Html += ' <param name="movie" value="'+ this.m_media_url +'" />\n';
445
- Html += ' <param name="quality" value="high" />\n';
446
- Html += ' <param name="menu" value="true" />\n';
447
- Html += ' <param name="scale" value="noorder" />\n';
448
- Html += ' <param name="quality" value="high" />\n';
449
- Html += ' <embed src="'+ this.m_media_url +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"'+ (auto_play?'':' play="false"') +' width="'+ this.m_width +'" height="'+ this.m_height +'" menu="true"></embed>';
450
- Html += '</object>\n';
451
- return Html;
452
- }
453
-
454
- this._getRealPlayer = function() {
455
- var auto_play = false;
456
- if( this._getRealPlayer.arguments.length > 0 )
457
- auto_play = this._getRealPlayer.arguments[0];
458
-
459
- var Html = '';
460
- Html += '<object id="realplayer" classid="clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa" width="'+ this.m_width +'" height="'+ this.m_height +'">\n';
461
- Html += ' <param name="src" value="'+ this.m_media_url +'" />\n';
462
- Html += ' <param name="autostart" value="'+ (auto_play?'true':'false') +'" />\n';
463
- Html += ' <param name="controls" value="imagewindow,controlpanel" />\n';
464
- Html += ' <embed src="'+ this.m_media_url +'" width="'+ this.m_width +'" height="'+ this.m_height +'" autostart="'+(auto_play?'true':'false')+'" controls="imagewindow,controlpanel" type="audio/x-pn-realaudio-plugin"></embed>';
465
- Html += '</object>\n';
466
- return Html;
467
- }
468
-
469
- this._getWinPlayer = function() {
470
- var auto_play = false;
471
- if( this._getWinPlayer.arguments.length > 0 )
472
- auto_play = this._getWinPlayer.arguments[0];
473
-
474
  var Html = '';
475
- Html += '<object id="winplayer" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="'+ this.m_width +'" height="'+ this.m_height +'" standby="Media is loading..." type="application/x-oleobject">\n';
476
- Html += ' <param name="url" value="'+ this.m_media_url +'" />\n';
477
- Html += ' <param name="AutoStart" value="'+ (auto_play?'true':'false') +'" />\n';
478
  Html += ' <param name="AutoSize" value="true" />\n';
479
  Html += ' <param name="AllowChangeDisplaySize" value="true" />\n';
480
  Html += ' <param name="standby" value="Media is loading..." />\n';
@@ -484,146 +87,41 @@ function jsMediaPlayer(FlashSrc) {
484
  Html += ' <param name="ShowCaptioning" value="false" />\n';
485
  Html += ' <param name="ShowDisplay" value="false" />\n';
486
  Html += ' <param name="ShowStatusBar" value="false" />\n';
487
- Html += ' <embed type="application/x-mplayer2" src="'+ this.m_media_url +'" width="'+ this.m_width +'" height="'+ this.m_height +'" scale="aspect" AutoStart="'+ (auto_play?'true':'false') +'" ShowDisplay="0" ShowStatusBar="0" AutoSize="1" AnimationAtStart="1" AllowChangeDisplaySize="1" ShowControls="1"></embed>\n';
488
  Html += '</object>\n';
489
- return Html;
 
490
  }
491
-
492
- this._getWinPlayerFirefox = function() {
493
- var auto_play = false;
494
- if( this._getWinPlayerFirefox.arguments.length > 0 )
495
- auto_play = this._getWinPlayerFirefox.arguments[0];
496
 
497
- var Html = '';
498
- Html += '<object id="winplayer" data="' + this.m_media_url +'" width="'+ this.m_width +'" height="'+ this.m_height +'" type="application/x-ms-wmp">\n';
499
- Html += ' <param name="url" value="'+ this.m_media_url +'" />\n';
500
- Html += ' <param name="AutoStart" value="'+ (auto_play?'true':'false') +'" />\n';
501
- Html += ' <param name="AutoSize" value="true" />\n';
502
- Html += ' <param name="AllowChangeDisplaySize" value="true" />\n';
503
- Html += ' <param name="standby" value="Media is loading..." />\n';
504
- Html += ' <param name="AnimationAtStart" value="true" />\n';
505
- Html += ' <param name="scale" value="aspect" />\n';
506
- Html += ' <param name="ShowControls" value="true" />\n';
507
- Html += ' <param name="ShowCaptioning" value="false" />\n';
508
- Html += ' <param name="ShowDisplay" value="false" />\n';
509
- Html += ' <param name="ShowStatusBar" value="false" />\n';
510
- Html += '</object>\n';
511
- Html += '<p style="font-size: 85%;margin-top:0;">Best viewed with <a href="http://support.mozilla.com/en-US/kb/Using+the+Windows+Media+Player+plugin+with+Firefox#Installing_the_plugin" target="_blank">';
512
- Html += 'Windows Media Player plugin for Firefox</a></p>\n';
513
- return Html;
514
- }
515
 
516
- this._getQuickTime = function() {
517
-
518
- var contentType = 'video/mpeg';
519
- var auto_play = false;
520
- if( this._getQuickTime.arguments.length > 0 )
521
- contentType = this._getQuickTime.arguments[0];
522
- if( this._getQuickTime.arguments.length > 1 )
523
- auto_play = this._getQuickTime.arguments[1];
524
-
525
  var Html = '';
526
- Html += '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="'+ this.m_width +'" height="'+ this.m_height +'" codebase="http://www.apple.com/qtactivex/qtplugin.cab">\n';
527
- Html += ' <param name="src" value="'+ this.m_media_url +'" />\n';
528
- Html += ' <param name="href" value="'+ this.m_media_url +'" />\n';
529
- Html += ' <param name="scale" value="aspect" />\n';
530
- Html += ' <param name="controller" value="true" />\n';
531
- Html += ' <param name="autoplay" value="'+ (auto_play?'true':'false') +'" />\n';
532
- Html += ' <param name="bgcolor" value="000000" />\n';
533
- Html += ' <param name="pluginspage" value="http://www.apple.com/quicktime/download/" />\n';
534
- Html += ' <embed src="'+ this.m_media_url +'" type="'+ contentType +'" width="'+ this.m_width +'" height="'+ this.m_height +'" scale="aspect" cache="true" bgcolor="000000" autoplay="'+ (auto_play?'true':'false') +'" controller="true" pluginspage="http://www.apple.com/quicktime/download/"></embed>';
535
  Html += '</object>\n';
536
- return Html;
 
537
  }
538
-
539
- this._getExt = function(File) {
540
- // First remove any anchor if any
541
- var anchor = File.indexOf('#');
542
- if( anchor > -1 )
543
- File = File.substring(0, anchor);
544
- // Next, get rid of the query string if exists..
545
- var question = File.indexOf('?');
546
- if( question > -1 )
547
- File = File.substring(0, question);
548
- // Find the last dot at the end of the file
549
- var dot = File.lastIndexOf('.');
550
- if( dot > -1 )
551
- return File.substring(dot+1).toLowerCase();
552
- return false; // Unable to find a file extension
553
- }
554
-
555
- this._passthru = function() {
556
-
557
- // If we have ourselves an iPhone, let the media passtru when clicked
558
- if( navigator.userAgent.indexOf("iPhone") != -1 )
559
- return true; // Let this client download and play the content itself.
560
-
561
- // Add additional user agents which cannot handle embed, object or flash code here:
562
-
563
- return false;
564
- }
565
-
566
- this._closePrevPlayer = function() {
567
- if( this.m_player_div )
568
- {
569
- document.getElementById( this.m_player_div ).innerHTML = '';
570
- document.getElementById( this.m_player_div ).style.display = 'none';
571
- this.m_player_div = false;
572
- }
573
- if( this.m_player_wnd )
574
- {
575
- this.m_player_wnd.close();
576
- this.m_player_wnd = false;
577
- }
578
- }
579
- }
580
-
581
-
582
- function powerpress_onload()
583
- {
584
- if( g_bpLoadDelay )
585
- setTimeout('powerpress_load_delay()', g_bpLoadDelay);
586
- else
587
- powerpress_load_delay();
588
- }
589
-
590
- function powerpress_load_delay()
591
- {
592
- for( var x = 0; x < g_pbPlayerArray.length; x++ )
593
- powerpress_play_page( g_pbPlayerArray[x][0], g_pbPlayerArray[x][1] );
594
  }
595
 
596
- var g_pbPlayerArray = new Array();
597
- function powerpress_queue_player(media, div )
598
- {
599
- //alert('test');
600
- var pos = g_pbPlayerArray.length;
601
- g_pbPlayerArray[pos] = new Array();
602
- g_pbPlayerArray[pos][0] = media;
603
- g_pbPlayerArray[pos][1] = div;
604
- }
605
-
606
- function powerpress_addLoadEvent(func)
607
- {
608
- var oldonload = window.onload;
609
- if (typeof window.onload != 'function')
610
- {
611
- window.onload = func;
612
- }
613
- else
614
- {
615
- window.onload = function()
616
- {
617
- if (oldonload)
618
- {
619
- oldonload();
620
- }
621
- func();
622
- }
623
- }
624
- }
625
-
626
-
627
  /**
628
  * flashembed 0.31. Adobe Flash embedding script
629
  *
@@ -640,4 +138,4 @@ function powerpress_addLoadEvent(func)
640
  * version 0.31 - Tue Jul 22 2008 06:30:31 GMT+0200 (GMT+02:00)
641
  */
642
 
643
- function flashembed(root,userParams,flashvars){function getHTML(){var html="";if(typeof flashvars=='function'){flashvars=flashvars();}if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){html='<embed type="application/x-shockwave-flash" ';if(params.id){extend(params,{name:params.id});}for(var key in params){if(params[key]!==null){html+=[key]+'="'+params[key]+'"\n\t';}}if(flashvars){html+='flashvars=\''+concatVars(flashvars)+'\'';}html+='/>';}else{html='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';html+='width="'+params.width+'" height="'+params.height+'"';if(!params.id&&document.all){params.id="_"+(""+Math.random()).substring(5);}if(params.id){html+=' id="'+params.id+'"';}html+='>';html+='\n\t<param name="movie" value="'+params.src+'" />';params.id=params.src=params.width=params.height=null;for(var k in params){if(params[k]!==null){html+='\n\t<param name="'+k+'" value="'+params[k]+'" />';}}if(flashvars){html+='\n\t<param name="flashvars" value=\''+concatVars(flashvars)+'\' />';}html+="</object>";if(debug){alert(html);}}return html;}function init(name){var timer=setInterval(function(){var doc=document;var el=doc.getElementById(name);if(el){flashembed(el,userParams,flashvars);clearInterval(timer);}else if(doc&&doc.getElementsByTagName&&doc.getElementById&&doc.body){clearInterval(timer);}},13);return true;}function extend(to,from){if(from){for(key in from){if(from.hasOwnProperty(key)){to[key]=from[key];}}}}var params={src:'#',width:'100%',height:'100%',version:null,onFail:null,expressInstall:null,debug:false,bgcolor:'#ffffff',allowfullscreen:true,allowscriptaccess:'always',quality:'high',type:'application/x-shockwave-flash',pluginspage:'http://www.adobe.com/go/getflashplayer'};if(typeof userParams=='string'){userParams={src:userParams};}extend(params,userParams);var version=flashembed.getVersion();var required=params.version;var express=params.expressInstall;var debug=params.debug;if(typeof root=='string'){var el=document.getElementById(root);if(el){root=el;}else{return init(root);}}if(!root){return;}if(!required||flashembed.isSupported(required)){params.onFail=params.version=params.expressInstall=params.debug=null;root.innerHTML=getHTML();return root.firstChild;}else if(params.onFail){var ret=params.onFail.call(params,flashembed.getVersion(),flashvars);if(ret){root.innerHTML=ret;}}else if(required&&express&&flashembed.isSupported([6,65])){extend(params,{src:express});flashvars={MMredirectURL:location.href,MMplayerType:'PlugIn',MMdoctitle:document.title};root.innerHTML=getHTML();}else{if(root.innerHTML.replace(/\s/g,'')!==''){}else{root.innerHTML="<h2>Flash version "+required+" or greater is required</h2>"+"<h3>"+(version[0]>0?"Your version is "+version:"You have no flash plugin installed")+"</h3>"+"<p>Download latest version from <a href='"+params.pluginspage+"'>here</a></p>";}}function concatVars(vars){var out="";for(var key in vars){if(vars[key]){out+=[key]+'='+asString(vars[key])+'&';}}return out.substring(0,out.length-1);}function asString(obj){switch(typeOf(obj)){case'string':return'"'+obj.replace(new RegExp('(["\\\\])','g'),'\\$1')+'"';case'array':return'['+map(obj,function(el){return asString(el);}).join(',')+']';case'function':return'"function()"';case'object':var str=[];for(var prop in obj){if(obj.hasOwnProperty(prop)){str.push('"'+prop+'":'+asString(obj[prop]));}}return'{'+str.join(',')+'}';}return String(obj).replace(/\s/g," ").replace(/\'/g,"\"");}function typeOf(obj){if(obj===null||obj===undefined){return false;}var type=typeof obj;return(type=='object'&&obj.push)?'array':type;}if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};});}function map(arr,func){var newArr=[];for(var i in arr){if(arr.hasOwnProperty(i)){newArr[i]=func(arr[i]);}}return newArr;}return root;}if(typeof jQuery=='function'){(function($){$.fn.extend({flashembed:function(params,flashvars){return this.each(function(){flashembed(this,params,flashvars);});}});})(jQuery);}flashembed=flashembed||{};flashembed.getVersion=function(){var version=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var _d=navigator.plugins["Shockwave Flash"].description;if(typeof _d!="undefined"){_d=_d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var _m=parseInt(_d.replace(/^(.*)\..*$/,"$1"),10);var _r=/r/.test(_d)?parseInt(_d.replace(/^.*r(.*)$/,"$1"),10):0;version=[_m,_r];}}else if(window.ActiveXObject){try{var _a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{_a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version=[6,0];_a.AllowScriptAccess="always";}catch(ee){if(version[0]==6){return;}}try{_a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(eee){}}if(typeof _a=="object"){_d=_a.GetVariable("$version");if(typeof _d!="undefined"){_d=_d.replace(/^\S+\s+(.*)$/,"$1").split(",");version=[parseInt(_d[0],10),parseInt(_d[2],10)];}}}return version;};flashembed.isSupported=function(version){var now=flashembed.getVersion();var ret=(now[0]>version[0])||(now[0]==version[0]&&now[1]>=version[1]);return ret;};
1
  /**
2
+ * jsMediaPlayer 1.2.0 for Blubrry PowerPress
3
  *
4
  * http://www.blubrry.com/powepress/
5
  *
6
+ * Copyright (c) 2008-2009 Angelo Mandato (angelo [at] mandato {period} com)
7
  *
8
  * Released under Aoache 2 license:
9
  * http://www.apache.org/licenses/LICENSE-2.0
10
  *
11
+ * versoin 1.2.0 - 07/20/2009 - Major rewrite, we're now replying less upon this javascript to make way for flexibility for adding future players.
12
  * versoin 1.1.3 - 03/23/2009 - Added code to support FlowPlayer v3.
13
  * versoin 1.1.2 - 03/04/2009 - Added options to set the width for audio, width and height for video.
14
  * versoin 1.1.1 - 12/22/20008 - Minor change to support Windows Media in Firefox. Includes link to preferred Firefox Windows Media Player plugin.
19
  * version 1.0.0 - 07/26/2008 - initial release
20
  */
21
 
 
22
 
23
  /**
24
+ Insert embed for quicktime within specified div
25
 
26
+ @div - specific div to insert embed into
27
+ @media_url - URL of media file to play
28
+ @width - width of player
29
+ @height - height of player
30
  */
31
+ function powerpress_embed_quicktime(div,media_url,width,height)
32
  {
33
+ if( document.getElementById(div) )
 
 
 
 
 
 
 
 
 
34
  {
35
+ var contentType = 'video/mpeg'; // Default content type
36
+ if( media_url.indexOf('.m4v') > -1 )
37
+ contentType = 'video/x-m4v';
38
+ else if( media_url.indexOf('.m4a') > -1 )
39
+ contentType = 'audio/x-m4a';
40
+ else if( media_url.indexOf('.avi') > -1 )
41
+ contentType = 'video/avi';
42
+ else if( media_url.indexOf('.qt') > -1 )
43
+ contentType = 'video/quicktime';
44
+ else if( media_url.indexOf('.mov') > -1 )
45
+ contentType = 'video/quicktime';
46
+
47
+ var Html = '';
48
+ Html += '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="'+ width +'" height="'+ height +'" codebase="http://www.apple.com/qtactivex/qtplugin.cab">\n';
49
+ Html += ' <param name="src" value="'+ media_url +'" />\n';
50
+ Html += ' <param name="href" value="'+ media_url +'" />\n';
51
+ Html += ' <param name="scale" value="aspect" />\n';
52
+ Html += ' <param name="controller" value="true" />\n';
53
+ Html += ' <param name="autoplay" value="true" />\n';
54
+ Html += ' <param name="bgcolor" value="000000" />\n';
55
+ Html += ' <param name="pluginspage" value="http://www.apple.com/quicktime/download/" />\n';
56
+ Html += ' <embed src="'+ media_url +'" type="'+ contentType +'" width="'+ width +'" height="'+ height +'" scale="aspect" cache="true" bgcolor="000000" autoplay="true" controller="true" pluginspage="http://www.apple.com/quicktime/download/"></embed>';
57
+ Html += '</object>\n';
58
+ document.getElementById(div).innerHTML = Html;
59
+ return false; // stop the default link from proceeding
60
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
+ return true; // let the default link to the media open...
63
  }
64
 
65
  /**
66
+ Insert embed for windows media within specified div
67
 
68
+ @div - specific div to insert embed into
69
+ @media_url - URL of media file to play
70
+ @width - width of player
71
+ @height - height of player
72
  */
73
+ function powerpress_embed_winplayer(div,media_url,width,height)
74
  {
75
+ if( document.getElementById(div) )
76
+ {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  var Html = '';
78
+ Html += '<object id="winplayer" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="'+ width +'" height="'+ height +'" standby="loading..." type="application/x-oleobject">\n';
79
+ Html += ' <param name="url" value="'+ media_url +'" />\n';
80
+ Html += ' <param name="AutoStart" value="true" />\n';
81
  Html += ' <param name="AutoSize" value="true" />\n';
82
  Html += ' <param name="AllowChangeDisplaySize" value="true" />\n';
83
  Html += ' <param name="standby" value="Media is loading..." />\n';
87
  Html += ' <param name="ShowCaptioning" value="false" />\n';
88
  Html += ' <param name="ShowDisplay" value="false" />\n';
89
  Html += ' <param name="ShowStatusBar" value="false" />\n';
90
+ Html += ' <embed type="application/x-mplayer2" src="'+ media_url +'" width="'+ width +'" height="'+ height +'" scale="aspect" AutoStart="true" ShowDisplay="0" ShowStatusBar="0" AutoSize="1" AnimationAtStart="1" AllowChangeDisplaySize="1" ShowControls="1"></embed>\n';
91
  Html += '</object>\n';
92
+ document.getElementById(div).innerHTML = Html;
93
+ return false; // stop the default link from proceeding
94
  }
95
+ return true; // let the default link to the media open...
96
+ }
 
 
 
97
 
98
+ /**
99
+ Insert embed for swf flash within specified div
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
+ @div - specific div to insert embed into
102
+ @media_url - URL of media file to play
103
+ @width - width of player
104
+ @height - height of player
105
+ */
106
+ function powerpress_embed_swf(div,media_url,width,height)
107
+ {
108
+ if( document.getElementById(div) )
109
+ {
110
  var Html = '';
111
+ Html += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ width +'" height="'+ height +'" menu="true">\n';
112
+ Html += ' <param name="movie" value="'+ media_url +'" />\n';
113
+ Html += ' <param name="quality" value="high" />\n';
114
+ Html += ' <param name="menu" value="true" />\n';
115
+ Html += ' <param name="scale" value="noorder" />\n';
116
+ Html += ' <param name="quality" value="high" />\n';
117
+ Html += ' <embed src="'+ media_url +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ width +'" height="'+ height +'" menu="true"></embed>';
 
 
118
  Html += '</object>\n';
119
+ document.getElementById(div).innerHTML = Html;
120
+ return false; // stop the default link from proceeding
121
  }
122
+ return true; // let the default link to the media open...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  }
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  /**
126
  * flashembed 0.31. Adobe Flash embedding script
127
  *
138
  * version 0.31 - Tue Jul 22 2008 06:30:31 GMT+0200 (GMT+02:00)
139
  */
140
 
141
+ function pp_flashembed(root,userParams,flashvars){function getHTML(){var html="";if(typeof flashvars=='function'){flashvars=flashvars();}if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){html='<embed type="application/x-shockwave-flash" ';if(params.id){extend(params,{name:params.id});}for(var key in params){if(params[key]!==null){html+=[key]+'="'+params[key]+'"\n\t';}}if(flashvars){html+='flashvars=\''+concatVars(flashvars)+'\'';}html+='/>';}else{html='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';html+='width="'+params.width+'" height="'+params.height+'"';if(!params.id&&document.all){params.id="_"+(""+Math.random()).substring(5);}if(params.id){html+=' id="'+params.id+'"';}html+='>';html+='\n\t<param name="movie" value="'+params.src+'" />';params.id=params.src=params.width=params.height=null;for(var k in params){if(params[k]!==null){html+='\n\t<param name="'+k+'" value="'+params[k]+'" />';}}if(flashvars){html+='\n\t<param name="flashvars" value=\''+concatVars(flashvars)+'\' />';}html+="</object>";if(debug){alert(html);}}return html;}function init(name){var timer=setInterval(function(){var doc=document;var el=doc.getElementById(name);if(el){pp_flashembed(el,userParams,flashvars);clearInterval(timer);}else if(doc&&doc.getElementsByTagName&&doc.getElementById&&doc.body){clearInterval(timer);}},13);return true;}function extend(to,from){if(from){for(key in from){if(from.hasOwnProperty(key)){to[key]=from[key];}}}}var params={src:'#',width:'100%',height:'100%',version:null,onFail:null,expressInstall:null,debug:false,bgcolor:'#ffffff',allowfullscreen:true,allowscriptaccess:'always',quality:'high',type:'application/x-shockwave-flash',pluginspage:'http://www.adobe.com/go/getflashplayer'};if(typeof userParams=='string'){userParams={src:userParams};}extend(params,userParams);var version=pp_flashembed.getVersion();var required=params.version;var express=params.expressInstall;var debug=params.debug;if(typeof root=='string'){var el=document.getElementById(root);if(el){root=el;}else{return init(root);}}if(!root){return;}if(!required||pp_flashembed.isSupported(required)){params.onFail=params.version=params.expressInstall=params.debug=null;root.innerHTML=getHTML();return root.firstChild;}else if(params.onFail){var ret=params.onFail.call(params,pp_flashembed.getVersion(),flashvars);if(ret){root.innerHTML=ret;}}else if(required&&express&&pp_flashembed.isSupported([6,65])){extend(params,{src:express});flashvars={MMredirectURL:location.href,MMplayerType:'PlugIn',MMdoctitle:document.title};root.innerHTML=getHTML();}else{if(root.innerHTML.replace(/\s/g,'')!==''){}else{root.innerHTML="<h2>Flash version "+required+" or greater is required</h2>"+"<h3>"+(version[0]>0?"Your version is "+version:"You have no flash plugin installed")+"</h3>"+"<p>Download latest version from <a href='"+params.pluginspage+"'>here</a></p>";}}function concatVars(vars){var out="";for(var key in vars){if(vars[key]){out+=[key]+'='+asString(vars[key])+'&';}}return out.substring(0,out.length-1);}function asString(obj){switch(typeOf(obj)){case'string':return'"'+obj.replace(new RegExp('(["\\\\])','g'),'\\$1')+'"';case'array':return'['+map(obj,function(el){return asString(el);}).join(',')+']';case'function':return'"function()"';case'object':var str=[];for(var prop in obj){if(obj.hasOwnProperty(prop)){str.push('"'+prop+'":'+asString(obj[prop]));}}return'{'+str.join(',')+'}';}return String(obj).replace(/\s/g," ").replace(/\'/g,"\"");}function typeOf(obj){if(obj===null||obj===undefined){return false;}var type=typeof obj;return(type=='object'&&obj.push)?'array':type;}if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};});}function map(arr,func){var newArr=[];for(var i in arr){if(arr.hasOwnProperty(i)){newArr[i]=func(arr[i]);}}return newArr;}return root;}if(typeof jQuery=='function'){(function($){$.fn.extend({pp_flashembed:function(params,flashvars){return this.each(function(){pp_flashembed(this,params,flashvars);});}});})(jQuery);}pp_flashembed=pp_flashembed||{};pp_flashembed.getVersion=function(){var version=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var _d=navigator.plugins["Shockwave Flash"].description;if(typeof _d!="undefined"){_d=_d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var _m=parseInt(_d.replace(/^(.*)\..*$/,"$1"),10);var _r=/r/.test(_d)?parseInt(_d.replace(/^.*r(.*)$/,"$1"),10):0;version=[_m,_r];}}else if(window.ActiveXObject){try{var _a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{_a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version=[6,0];_a.AllowScriptAccess="always";}catch(ee){if(version[0]==6){return;}}try{_a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(eee){}}if(typeof _a=="object"){_d=_a.GetVariable("$version");if(typeof _d!="undefined"){_d=_d.replace(/^\S+\s+(.*)$/,"$1").split(",");version=[parseInt(_d[0],10),parseInt(_d[2],10)];}}}return version;};pp_flashembed.isSupported=function(version){var now=pp_flashembed.getVersion();var ret=(now[0]>version[0])||(now[0]==version[0]&&now[1]>=version[1]);return ret;};
powerpress.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Blubrry PowerPress
4
  Plugin URI: http://www.blubrry.com/powerpress/
5
  Description: <a href="http://www.blubrry.com/powerpress/" target="_blank">Blubrry PowerPress</a> adds podcasting support to your blog. Features include: media player, 3rd party statistics and iTunes integration.
6
- Version: 0.8.3
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
@@ -29,7 +29,7 @@ License: GPL (http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt)
29
  */
30
 
31
  // WP_PLUGIN_DIR (REMEMBER TO USE THIS DEFINE IF NEEDED)
32
- define('POWERPRESS_VERSION', '0.8.3' );
33
 
34
  /////////////////////////////////////////////////////
35
  // The following define options should be placed in your
@@ -44,25 +44,12 @@ if( !defined('POWERPRESS_DURATION_TEXT') )
44
  define('POWERPRESS_DURATION_TEXT', __('Duration') );
45
  if( !defined('POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT') )
46
  define('POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT', __('Play in new window') );
47
- if( !defined('POWERPRESS_PLAY_ON_PAGE_TEXT') )
48
- define('POWERPRESS_PLAY_ON_PAGE_TEXT', __('Play on page') );
49
  if( !defined('POWERPRESS_DOWNLOAD_TEXT') )
50
  define('POWERPRESS_DOWNLOAD_TEXT', __('Download') );
 
 
51
 
52
- // Load players in the footer of the page, improves page load times but requires wp_footer() function to be included in WP Theme.
53
- //define('POWERPRESS_USE_FOOTER', true);
54
- // You can also define the delay.
55
- //define('POWERPRESS_USE_FOOTER_DELAY', 300); // Milliseconds delay should occur, e.g. 500 is 1/2 of a second, 2000 is 2 seconds.
56
-
57
- // Set whether players should be loaded using the page onload event
58
- if( !defined('POWERPRESS_USE_ONLOAD') ) // Add define('POWERPRESS_USE_ONLOAD', false); to your wp-config.php to turn this feature off
59
- define('POWERPRESS_USE_ONLOAD', false);
60
-
61
- // define how much of a delay should exist when media players are loaded
62
- if( !defined('POWERPRESS_USE_ONLOAD_DELAY') ) // Add define('POWERPRESS_USE_ONLOAD_DELAY', 1000); to your wp-config.php to set a full 1 second delay.
63
- define('POWERPRESS_USE_ONLOAD_DELAY', 500);
64
-
65
- if( !defined('POWERPRESS_BLUBRRY_API_URL') ) // Add define('POWERPRESS_USE_ONLOAD_DELAY', 1000); to your wp-config.php to set a full 1 second delay.
66
  define('POWERPRESS_BLUBRRY_API_URL', 'http://api.blubrry.com/');
67
 
68
  // Display custom play image for quicktime media. Applies to on page player only.
@@ -70,6 +57,8 @@ if( !defined('POWERPRESS_BLUBRRY_API_URL') ) // Add define('POWERPRESS_USE_ONLO
70
 
71
  if( !defined('POWERPRESS_CONTENT_ACTION_PRIORITY') )
72
  define('POWERPRESS_CONTENT_ACTION_PRIORITY', 10 );
 
 
73
 
74
  // Define variables, advanced users could define these in their own wp-config.php so lets not try to re-define
75
  if( !defined('POWERPRESS_LINK_SEPARATOR') )
@@ -85,7 +74,11 @@ function powerpress_content($content)
85
  {
86
  global $post, $g_powerpress_excerpt_post_id;
87
 
88
- if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) )
 
 
 
 
89
  return;
90
 
91
  if( is_feed() )
@@ -96,7 +89,7 @@ function powerpress_content($content)
96
  if( post_password_required($post) )
97
  return $content;
98
  }
99
-
100
  // Problem: If the_excerpt is used instead of the_content, both the_exerpt and the_content will be called here.
101
  // Important to note, get_the_excerpt will be called before the_content is called, so we add a simple little hack
102
  if( current_filter() == 'get_the_excerpt' )
@@ -110,164 +103,177 @@ function powerpress_content($content)
110
  }
111
 
112
  // PowerPress settings:
113
- $Powerpress = get_option('powerpress_general');
 
 
 
 
 
 
 
 
 
114
 
115
- if( current_filter() == 'the_excerpt' && !$Powerpress['display_player_excerpt'] )
116
- {
 
 
 
117
  return $content; // We didn't want to modify this since the user didn't enable it for excerpts
118
- }
119
-
120
- // Get the enclosure data
121
- $enclosureData = get_post_meta($post->ID, 'enclosure', true);
122
- $duration = false;
123
-
124
- if( !$enclosureData )
125
  {
126
- $EnclosureURL = '';
127
- if( $Powerpress['process_podpress'] )
128
  {
129
- //$Settings = get_option('powerpress_general');
130
- $podPressMedia = get_post_meta($post->ID, 'podPressMedia', true);
131
- if( $podPressMedia )
132
  {
133
- if( !is_array($podPressMedia) )
 
134
  {
135
- // Sometimes the stored data gets messed up, we can fix it here:
136
- $podPressMedia = powerpress_repair_serialize($podPressMedia);
137
- $podPressMedia = @unserialize($podPressMedia);
138
  }
139
-
140
- if( is_array($podPressMedia) )
141
  {
142
- $EnclosureURL = $podPressMedia[0]['URI'];
143
- $EnclosureSize = $podPressMedia[0]['size'];
144
- $EnclosureType = '';
 
 
 
 
145
  }
146
  }
147
- if( !$EnclosureURL )
148
- return $content;
149
- if( strpos($EnclosureURL, 'http://' ) !== 0 )
150
- $EnclosureURL = rtrim($Powerpress['default_url'], '/') .'/'. $EnclosureURL;
151
  }
152
  }
153
- else
154
- {
155
- list($EnclosureURL, $EnclosureSize, $EnclosureType, $Serialized) = split("\n", $enclosureData);
156
- $EnclosureURL = trim($EnclosureURL);
157
- if( $Serialized )
158
- {
159
- $ExtraData = unserialize($Serialized);
160
- if( isset($ExtraData['duration']) )
161
- $duration = $ExtraData['duration'];
162
- }
163
- }
164
-
165
- // Just in case, if there's no URL lets escape!
166
- if( !$EnclosureURL )
167
- return $content;
168
-
169
 
170
- if( !isset($Powerpress['display_player']) )
171
- $Powerpress['display_player'] = 1;
172
- if( !isset($Powerpress['player_function']) )
173
- $Powerpress['player_function'] = 1;
174
- if( !isset($Powerpress['podcast_link']) )
175
- $Powerpress['podcast_link'] = 1;
176
-
177
- // The blog owner doesn't want anything displayed, so don't bother wasting anymore CPU cycles
178
- if( $Powerpress['display_player'] == 0 )
179
- return $content;
180
-
181
- // Add redirects to Media URL
182
- $EnclosureURL = powerpress_add_redirect_url($EnclosureURL, $Powerpress);
183
 
184
- // Build links for player
185
- $player_links = '';
186
- switch( $Powerpress['player_function'] )
187
- {
188
- case 1: { // On page and new window
189
- $player_links .= "<a href=\"$EnclosureURL\" class=\"powerpress_link_pinw\" target=\"_blank\" title=\"". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."\" onclick=\"return powerpress_play_window(this.href);\">". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."</a>".PHP_EOL;
190
- }; break;
191
- case 2: { // Play in page only
192
- }; break;
193
- case 3: { //Play in new window only
194
- $player_links .= "<a href=\"$EnclosureURL\" class=\"powerpress_link_pinw\" target=\"_blank\" title=\"". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."\" onclick=\"return powerpress_play_window(this.href);\">". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."</a>".PHP_EOL;
195
- }; break;
196
- case 4: { // Play on page link only
197
- $player_links .= "<a href=\"$EnclosureURL\" class=\"powerpress_link_pop\" title=\"". POWERPRESS_PLAY_ON_PAGE_TEXT ."\" onclick=\"return powerpress_play_page(this.href, 'powerpress_player_{$post->ID}','true');\">". POWERPRESS_PLAY_ON_PAGE_TEXT ."</a>".PHP_EOL;
198
- }; break;
199
- case 5: { //Play on page link and new window
200
- $player_links .= "<a href=\"$EnclosureURL\" class=\"powerpress_link_pop\" title=\"". POWERPRESS_PLAY_ON_PAGE_TEXT ."\" onclick=\"return powerpress_play_page(this.href, 'powerpress_player_{$post->ID}','true');\">". POWERPRESS_PLAY_ON_PAGE_TEXT ."</a>".PHP_EOL;
201
- $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
202
- $player_links .= "<a href=\"$EnclosureURL\" class=\"powerpress_link_pinw\" target=\"_blank\" title=\"". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."\" onclick=\"return powerpress_play_window(this.href);\">". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."</a>".PHP_EOL;
203
- }; break;
204
- }//end switch
205
-
206
- if( $Powerpress['podcast_link'] == 1 )
207
- {
208
- if( $player_links )
209
- $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
210
- $player_links .= "<a href=\"$EnclosureURL\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a>".PHP_EOL;
211
- }
212
- else if( $Powerpress['podcast_link'] == 2 )
213
- {
214
- if( $player_links )
215
- $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
216
- $player_links .= "<a href=\"$EnclosureURL\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a> (".powerpress_byte_size($EnclosureSize).") ".PHP_EOL;
217
- }
218
- else if( $Powerpress['podcast_link'] == 3 )
219
- {
220
- if( $duration == false )
221
- $duration = get_post_meta($post->ID, 'itunes:duration', true);
222
- if( $player_links )
223
- $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
224
- if( $duration && ltrim($duration, '0:') != '' )
225
- $player_links .= "<a href=\"$EnclosureURL\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a> (". htmlspecialchars(POWERPRESS_DURATION_TEXT) .": " . powerpress_readable_duration($duration) ." &#8212; ".powerpress_byte_size($EnclosureSize).")".PHP_EOL;
226
- else
227
- $player_links .= "<a href=\"$EnclosureURL\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a> (".powerpress_byte_size($EnclosureSize).")".PHP_EOL;
228
- }
229
 
 
230
  $new_content = '';
231
- if( $Powerpress['player_function'] == 1 || $Powerpress['player_function'] == 2 ) // We have some kind of on-line player
232
  {
233
- $new_content .= '<div class="powerpress_player" id="powerpress_player_'. $post->ID .'"></div>'.PHP_EOL;
234
- if( defined('POWERPRESS_USE_ONLOAD') && POWERPRESS_USE_ONLOAD )
 
 
 
 
 
 
 
 
235
  {
236
- if( defined('POWERPRESS_USE_FOOTER') && POWERPRESS_USE_FOOTER )
237
  {
238
- global $g_powerpress_footer;
239
- $g_powerpress_footer['player_js'] .= "powerpress_queue_player('$EnclosureURL', 'powerpress_player_{$post->ID}');\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  }
241
- else
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  {
243
- $new_content .= '<script type="text/javascript">'.PHP_EOL;
244
- $new_content .= "powerpress_queue_player('$EnclosureURL', 'powerpress_player_{$post->ID}');\n";
245
- $new_content .= '</script>'.PHP_EOL;
 
246
  }
247
  }
248
- else if( defined('POWERPRESS_USE_FOOTER') && POWERPRESS_USE_FOOTER ) // $g_powerpress_footer['player_js']
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
  {
250
- global $g_powerpress_footer;
251
- $g_powerpress_footer['player_js'] .= "powerpress_play_page('$EnclosureURL', 'powerpress_player_{$post->ID}');\n";
 
252
  }
253
- else
254
  {
255
- $new_content .= '<script type="text/javascript">'.PHP_EOL;
256
- $new_content .= "powerpress_play_page('$EnclosureURL', 'powerpress_player_{$post->ID}');\n";
257
- $new_content .= '</script>'.PHP_EOL;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
  }
259
  }
260
- else if( $Powerpress['player_function'] == 4 || $Powerpress['player_function'] == 5 )
261
- {
262
- $new_content .= '<div class="powerpress_player" id="powerpress_player_'. $post->ID .'"></div>'.PHP_EOL;
263
- }
264
- if( $player_links )
265
- $new_content .= '<p class="powerpress_links">'. htmlspecialchars(POWERPRESS_LINKS_TEXT) .': '. $player_links . '</p>'.PHP_EOL;
266
 
267
  if( $new_content == '' )
268
  return $content;
269
 
270
- switch( $Powerpress['display_player'] )
271
  {
272
  case 1: { // Below posts
273
  return $content.$new_content;
@@ -285,7 +291,7 @@ add_filter('the_excerpt', 'powerpress_content', POWERPRESS_CONTENT_ACTION_PRIORI
285
 
286
  function powerpress_header()
287
  {
288
- if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) )
289
  return;
290
  // PowerPress settings:
291
  $Powerpress = get_option('powerpress_general');
@@ -294,34 +300,19 @@ function powerpress_header()
294
  {
295
  $PowerpressPluginURL = powerpress_get_root_url();
296
  ?>
297
- <script type="text/javascript" src="<?php echo $PowerpressPluginURL; ?>player.js"></script>
298
  <script type="text/javascript">
299
  <?php
300
- $player_image_url = POWERPRESS_PLAY_IMAGE;
301
- if( strstr($player_image_url, 'http://') !== $player_image_url )
302
- $player_image_url = powerpress_get_root_url().$player_image_url;
303
 
304
- if( $Powerpress['player_function'] == 4 || $Powerpress['player_function'] == 5 ) // Links would imply only one player in the page
305
- echo 'powerpress_player_init(\''. $PowerpressPluginURL .'\',\''. $player_image_url .'\',true);'.PHP_EOL;
306
- else
307
- echo 'powerpress_player_init(\''. $PowerpressPluginURL .'\',\''. $player_image_url .'\');'.PHP_EOL;
308
-
309
- if( isset($Powerpress['player_width']) && isset($Powerpress['player_height']) && isset($Powerpress['player_width_audio']) )
310
- echo 'powerpress_player_size('. (int)trim($Powerpress['player_width']) .','. (int)trim($Powerpress['player_height']) .','. (int)trim($Powerpress['player_width_audio']) .');'.PHP_EOL;
311
-
312
- if( defined('POWERPRESS_USE_ONLOAD') && POWERPRESS_USE_ONLOAD )
313
- {
314
- echo 'powerpress_addLoadEvent(powerpress_onload);'.PHP_EOL;
315
- echo "var g_bpLoadDelay = ".POWERPRESS_USE_ONLOAD_DELAY.";\n";
316
- }
317
  ?>
 
318
  </script>
319
- <style type="text/css">
320
- .powerpress_player_old {
321
- margin-bottom: 3px;
322
- margin-top: 10px;
323
- }
324
- </style>
325
  <?php
326
  }
327
  }
@@ -371,11 +362,22 @@ function powerpress_rss2_head()
371
  }
372
 
373
  $General = get_option('powerpress_general');
 
374
  // We made it this far, lets write stuff to the feed!
 
375
  if( $General['advanced_mode'] == 0 )
376
- echo '<!-- podcast_generator="Blubrry PowerPress/'. POWERPRESS_VERSION .'" mode="simple" -->'.PHP_EOL;
 
 
 
 
 
 
 
377
  else
378
- echo '<!-- podcast_generator="Blubrry PowerPress/'. POWERPRESS_VERSION .'" mode="advanced" -->'.PHP_EOL;
 
 
379
 
380
  // add the itunes:new-feed-url tag to feed
381
  if( powerpress_is_custom_podcast_feed() )
@@ -622,11 +624,11 @@ function powerpress_rss2_item()
622
  }
623
 
624
  // Split the episode information into parts...
625
- list($EnclosureURL, $EnclosureSize, $EnclosureType, $Serialized) = split("\n", $enclosureData);
626
  $EnclosureURL = trim($EnclosureURL);
627
  $EnclosureType = trim($EnclosureType);
628
  $EnclosureSize = trim($EnclosureSize);
629
- $author = $powerpress_feed['itunes_talent_name'];
630
  $explicit = $powerpress_feed['explicit'];
631
  $summary = false;
632
  $subtitle = false;
@@ -638,18 +640,22 @@ function powerpress_rss2_item()
638
  $EpisodeData = unserialize($Serialized);
639
  if( isset( $EpisodeData['duration'] ) )
640
  $duration = $EpisodeData['duration'];
641
- if( isset( $EpisodeData['author'] ) )
642
- $author = $EpisodeData['author'];
643
- if( isset( $EpisodeData['explicit'] ) )
644
- $explicit = $EpisodeData['explicit'];
645
- if( isset( $EpisodeData['summary'] ) )
646
- $summary = $EpisodeData['summary'];
647
- if( isset( $EpisodeData['subtitle'] ) )
648
- $subtitle = $EpisodeData['subtitle'];
649
- if( isset( $EpisodeData['keywords'] ) )
650
- $keywords = $EpisodeData['keywords'];
651
- if( isset( $EpisodeData['block'] ) )
652
- $block = $EpisodeData['block'];
 
 
 
 
653
  }
654
 
655
  if( !$duration && !$custom_enclosure )
@@ -699,10 +705,11 @@ function powerpress_rss2_item()
699
  else
700
  echo "\t\t<itunes:subtitle>". powerpress_format_itunes_value($content_no_html, 'subtitle', true) .'</itunes:subtitle>'.PHP_EOL;
701
 
702
- if( $powerpress_feed['enhance_itunes_summary'] )
703
- echo "\t\t<itunes:summary>". powerpress_itunes_summary($post->post_content) .'</itunes:summary>'.PHP_EOL;
704
- else if( $summary )
705
  echo "\t\t<itunes:summary>". powerpress_format_itunes_value($summary, 'summary') .'</itunes:summary>'.PHP_EOL;
 
 
706
  else if( $excerpt_no_html )
707
  echo "\t\t<itunes:summary>". powerpress_format_itunes_value($excerpt_no_html, 'summary') .'</itunes:summary>'.PHP_EOL;
708
  else
@@ -725,7 +732,7 @@ add_action('rss2_item', 'powerpress_rss2_item');
725
 
726
  function powerpress_filter_rss_enclosure($content)
727
  {
728
- if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) )
729
  return $content; // Another podcasting plugin is enabled...
730
 
731
 
@@ -876,9 +883,12 @@ add_action('template_redirect', 'powerpress_template_redirect', 0);
876
 
877
  function powerpress_init()
878
  {
879
- if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) )
880
  return false; // Another podcasting plugin is enabled...
881
 
 
 
 
882
  add_feed('podcast', 'powerpress_do_podcast_feed');
883
 
884
  $GeneralSettings = get_option('powerpress_general');
@@ -936,6 +946,7 @@ function powerpress_load_general_feed_settings()
936
 
937
  $powerpress_feed = array();
938
  $powerpress_feed['is_custom'] = true;
 
939
  $powerpress_feed['category'] = $cat_ID;
940
  $powerpress_feed['process_podpress'] = true; // Category feeds could originate from Podpress
941
  $powerpress_feed['default_url'] = rtrim($GeneralSettings['default_url'], '/') .'/';
@@ -949,6 +960,8 @@ function powerpress_load_general_feed_settings()
949
  $powerpress_feed['posts_per_rss'] = $Feed['posts_per_rss'];
950
  if( $Feed['feed_redirect_url'] != '' )
951
  $powerpress_feed['feed_redirect_url'] = $Feed['feed_redirect_url'];
 
 
952
  return;
953
  }
954
 
@@ -962,6 +975,7 @@ function powerpress_load_general_feed_settings()
962
 
963
  $powerpress_feed = array();
964
  $powerpress_feed['is_custom'] = true;
 
965
  $powerpress_feed['feed-slug'] = $feed_slug;
966
  $powerpress_feed['process_podpress'] = false; // We don't touch podpress data for custom feeds
967
  $powerpress_feed['default_url'] = rtrim($GeneralSettings['default_url'], '/') .'/';
@@ -1007,6 +1021,7 @@ function powerpress_load_general_feed_settings()
1007
  {
1008
  $powerpress_feed = array(); // Only store what's needed for each feed item
1009
  $powerpress_feed['is_custom'] = false; // ($feed_slug == 'podcast'?true:false);
 
1010
  $powerpress_feed['feed-slug'] = $feed_slug;
1011
  $powerpress_feed['process_podpress'] = $GeneralSettings['process_podpress']; // We don't touch podpress data for custom feeds
1012
  $powerpress_feed['default_url'] = rtrim($GeneralSettings['default_url'], '/') .'/';
@@ -1032,7 +1047,7 @@ function powerpress_load_general_feed_settings()
1032
  // Returns true of the feed should be treated as a podcast feed
1033
  function powerpress_is_podcast_feed()
1034
  {
1035
- if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) )
1036
  return false; // Another podcasting plugin is enabled...
1037
 
1038
  global $powerpress_feed;
@@ -1046,7 +1061,7 @@ function powerpress_is_podcast_feed()
1046
  // Returns true if the feed is a custom feed added by PowerPress
1047
  function powerpress_is_custom_podcast_feed()
1048
  {
1049
- if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) )
1050
  return false; // Another podcasting plugin is enabled...
1051
 
1052
  global $powerpress_feed;
@@ -1126,38 +1141,305 @@ function powerpress_post_limits($limits)
1126
  }
1127
  add_filter('post_limits', 'powerpress_post_limits');
1128
 
1129
- function powerpress_wp_footer()
 
1130
  {
1131
- global $g_powerpress_footer;
 
1132
 
1133
- if( is_array($g_powerpress_footer) )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1134
  {
1135
- if( isset($g_powerpress_footer['player_js']) )
1136
- {
1137
- echo '<script type="text/javascript">'.PHP_EOL;
1138
- if( POWERPRESS_USE_ONLOAD == false && defined('POWERPRESS_USE_FOOTER_DELAY') && POWERPRESS_USE_FOOTER_DELAY && is_numeric(POWERPRESS_USE_FOOTER_DELAY) )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1139
  {
1140
- echo 'function powerpress_onload_delay() {'.PHP_EOL;
1141
- echo $g_powerpress_footer['player_js'];
1142
- echo '}'.PHP_EOL;
1143
- echo "setTimeout('powerpress_onload_delay()', ".POWERPRESS_USE_FOOTER_DELAY.");\n";
 
 
 
 
 
 
 
 
 
 
1144
  }
1145
  else
1146
  {
1147
- echo $g_powerpress_footer['player_js'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1148
  }
1149
- echo '</script>'.PHP_EOL;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1150
  }
1151
  }
 
 
1152
  }
1153
 
1154
- if( defined('POWERPRESS_USE_FOOTER') && POWERPRESS_USE_FOOTER ) // $g_powerpress_footer['player_js']
1155
- add_action('wp_footer', 'powerpress_wp_footer');
1156
 
1157
  /*
1158
  Helper functions:
1159
  */
1160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1161
  // Add types that are missing from the default wp_check_filetype function
1162
  function powerpress_check_filetype($file)
1163
  {
@@ -1174,6 +1456,10 @@ function powerpress_check_filetype($file)
1174
  return 'audio/mpeg';
1175
  case 'm4a':
1176
  return 'audio/x-m4a';
 
 
 
 
1177
  case 'ogg':
1178
  return 'audio/ogg';
1179
  case 'wma':
@@ -1604,12 +1890,52 @@ function powerpress_repair_serialize($string)
1604
  ),
1605
  $string);
1606
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1607
  /*
1608
  End Helper Functions
1609
  */
1610
 
1611
  // Are we in the admin?
1612
  if( is_admin() )
1613
- require_once('powerpressadmin.php');
 
 
 
 
1614
 
1615
  ?>
3
  Plugin Name: Blubrry PowerPress
4
  Plugin URI: http://www.blubrry.com/powerpress/
5
  Description: <a href="http://www.blubrry.com/powerpress/" target="_blank">Blubrry PowerPress</a> adds podcasting support to your blog. Features include: media player, 3rd party statistics and iTunes integration.
6
+ Version: 0.9.0
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
29
  */
30
 
31
  // WP_PLUGIN_DIR (REMEMBER TO USE THIS DEFINE IF NEEDED)
32
+ define('POWERPRESS_VERSION', '0.9.0' );
33
 
34
  /////////////////////////////////////////////////////
35
  // The following define options should be placed in your
44
  define('POWERPRESS_DURATION_TEXT', __('Duration') );
45
  if( !defined('POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT') )
46
  define('POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT', __('Play in new window') );
 
 
47
  if( !defined('POWERPRESS_DOWNLOAD_TEXT') )
48
  define('POWERPRESS_DOWNLOAD_TEXT', __('Download') );
49
+ if( !defined('POWERPRESS_PLAY_TEXT') )
50
+ define('POWERPRESS_PLAY_TEXT', __('Play') );
51
 
52
+ if( !defined('POWERPRESS_BLUBRRY_API_URL') )
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  define('POWERPRESS_BLUBRRY_API_URL', 'http://api.blubrry.com/');
54
 
55
  // Display custom play image for quicktime media. Applies to on page player only.
57
 
58
  if( !defined('POWERPRESS_CONTENT_ACTION_PRIORITY') )
59
  define('POWERPRESS_CONTENT_ACTION_PRIORITY', 10 );
60
+
61
+ //define('POWERPRESS_IN_THE_LOOP_CHECK', true); // Add this define if you are using a theme such as the Hybrid Theme that improperly calls the_content() and the_excerpt() filters incorrectly.
62
 
63
  // Define variables, advanced users could define these in their own wp-config.php so lets not try to re-define
64
  if( !defined('POWERPRESS_LINK_SEPARATOR') )
74
  {
75
  global $post, $g_powerpress_excerpt_post_id;
76
 
77
+ // For those poorly written themes that call in_the_loop only functions such as the_content() and the_excerpt() outside of the loop, such as in the wp_head action.
78
+ if( in_the_loop() == false )
79
+ return $content;
80
+
81
+ if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) || defined('PODCASTING_VERSION') )
82
  return;
83
 
84
  if( is_feed() )
89
  if( post_password_required($post) )
90
  return $content;
91
  }
92
+
93
  // Problem: If the_excerpt is used instead of the_content, both the_exerpt and the_content will be called here.
94
  // Important to note, get_the_excerpt will be called before the_content is called, so we add a simple little hack
95
  if( current_filter() == 'get_the_excerpt' )
103
  }
104
 
105
  // PowerPress settings:
106
+ $GeneralSettings = get_option('powerpress_general');
107
+ // Lets set some default settings, if not already set...
108
+ if( !isset($GeneralSettings['custom_feeds']['podcast']) )
109
+ $GeneralSettings['custom_feeds']['podcast'] = 'Podcast Feed'; // Fixes scenario where the user never configured the custom default podcast feed.
110
+ if( !isset($GeneralSettings['display_player']) )
111
+ $GeneralSettings['display_player'] = 1;
112
+ if( !isset($GeneralSettings['player_function']) )
113
+ $GeneralSettings['player_function'] = 1;
114
+ if( !isset($GeneralSettings['podcast_link']) )
115
+ $GeneralSettings['podcast_link'] = 1;
116
 
117
+ // The blog owner doesn't want anything displayed, so don't bother wasting anymore CPU cycles
118
+ if( $GeneralSettings['display_player'] == 0 )
119
+ return $content;
120
+
121
+ if( current_filter() == 'the_excerpt' && !$GeneralSettings['display_player_excerpt'] )
122
  return $content; // We didn't want to modify this since the user didn't enable it for excerpts
123
+
124
+ // Figure out which players are alerady in the body of the page...
125
+ $ExcludePlayers = array();
126
+ if( preg_match_all('/(.?)\[(powerpress)\b(.*?)(?:(\/))?\](?:(.+?)\[\/\2\])?(.?)/s', $content, $matches) )
 
 
 
127
  {
128
+ if( isset($matches[3]) )
 
129
  {
130
+ while( list($key,$row) = each($matches[3]) )
 
 
131
  {
132
+ $attributes = shortcode_parse_atts($row);
133
+ if( isset($attributes['url']) )
134
  {
135
+ // not a problem...
 
 
136
  }
137
+ else if( isset($attributes['feed']) )
 
138
  {
139
+ // we want to exclude this feed from the links aera...
140
+ $ExcludePlayers[ $attributes['feed'] ] = true;
141
+ }
142
+ else
143
+ {
144
+ // we don't want to include any players below...
145
+ $ExcludePlayers = $GeneralSettings['custom_feeds'];
146
  }
147
  }
 
 
 
 
148
  }
149
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
 
153
+ // TODO: START LOOP HERE TO DISPLAY EACH MEDIA TYPE
154
  $new_content = '';
155
+ while( list($feed_slug,$feed_title) = each($GeneralSettings['custom_feeds']) )
156
  {
157
+ // Get the enclosure data
158
+ $EpisodeData = powerpress_get_enclosure_data($post->ID, $feed_slug);
159
+
160
+ //$enclosureData = get_post_meta($post->ID, 'enclosure', true);
161
+ $duration = false;
162
+ $EnclosureURL = '';
163
+ $EnclosureSize = '';
164
+ $EnclosureType = '';
165
+
166
+ if( !$EpisodeData )
167
  {
168
+ if( $GeneralSettings['process_podpress'] && $feed_slug == 'podcast' )
169
  {
170
+ //$Settings = get_option('powerpress_general');
171
+ $podPressMedia = get_post_meta($post->ID, 'podPressMedia', true);
172
+ if( $podPressMedia )
173
+ {
174
+ if( !is_array($podPressMedia) )
175
+ {
176
+ // Sometimes the stored data gets messed up, we can fix it here:
177
+ $podPressMedia = powerpress_repair_serialize($podPressMedia);
178
+ $podPressMedia = @unserialize($podPressMedia);
179
+ }
180
+
181
+ if( is_array($podPressMedia) )
182
+ {
183
+ $EnclosureURL = $podPressMedia[0]['URI'];
184
+ $EnclosureSize = $podPressMedia[0]['size'];
185
+ $EnclosureType = '';
186
+ }
187
+ }
188
+ if( !$EnclosureURL )
189
+ continue;
190
+ if( strpos($EnclosureURL, 'http://' ) !== 0 )
191
+ $EnclosureURL = rtrim($GeneralSettings['default_url'], '/') .'/'. $EnclosureURL;
192
+
193
+ // Add redirects to Media URL
194
+ $EnclosureURL = powerpress_add_redirect_url($EnclosureURL, $GeneralSettings);
195
  }
196
+ }
197
+ else
198
+ {
199
+ $EnclosureURL = $EpisodeData['url']; // Already includes redirect
200
+ $EnclosureSize = $EpisodeData['size'];
201
+ $EnclosureType = $EpisodeData['type'];
202
+ $duration = $EpisodeData['duration']; // Always set, though may be set to false
203
+ }
204
+
205
+ // Just in case, if there's no URL lets escape!
206
+ if( !$EnclosureURL )
207
+ continue;
208
+
209
+ // If the player is not already inserted in the body of the post using the shortcode...
210
+ //if( preg_match('/\[powerpress(.*)\]/is', $content) == 0 )
211
+ if( !isset($ExcludePlayers[ $feed_slug ]) ) // If the player is not in our exclude list because it's already in the post body somewhere...
212
+ {
213
+ if( $GeneralSettings['player_function'] != 3 && $GeneralSettings['player_function'] != 0 ) // Play in new window only or disabled
214
  {
215
+ if( $EpisodeData && isset($EpisodeData['embed']) )
216
+ $new_content .= $EpisodeData['embed'];
217
+ if( !isset($EpisodeData['no_player']) )
218
+ $new_content .= apply_filters('powerpress_player', '', $EnclosureURL, array('feed'=>$feed_slug) );
219
  }
220
  }
221
+
222
+ // Build links for player
223
+ $player_links = '';
224
+ switch( $GeneralSettings['player_function'] )
225
+ {
226
+ case 1: // Play on page and new window
227
+ case 3: // Play in new window only
228
+ case 5: { // Play in page and new window
229
+ $player_links .= "<a href=\"$EnclosureURL\" class=\"powerpress_link_pinw\" target=\"_blank\" title=\"". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."\" onclick=\"return powerpress_pinw('{$post->ID}-{$feed_slug}');\">". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."</a>".PHP_EOL;
230
+ }; break;
231
+ case 2:
232
+ case 4:{ // Play in/on page only
233
+ }; break;
234
+ }//end switch
235
+
236
+ if( $GeneralSettings['podcast_link'] == 1 )
237
+ {
238
+ if( $player_links )
239
+ $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
240
+ $player_links .= "<a href=\"$EnclosureURL\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a>".PHP_EOL;
241
+ }
242
+ else if( $GeneralSettings['podcast_link'] == 2 )
243
  {
244
+ if( $player_links )
245
+ $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
246
+ $player_links .= "<a href=\"$EnclosureURL\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a> (".powerpress_byte_size($EnclosureSize).") ".PHP_EOL;
247
  }
248
+ else if( $GeneralSettings['podcast_link'] == 3 )
249
  {
250
+ if( $duration == false )
251
+ $duration = get_post_meta($post->ID, 'itunes:duration', true);
252
+ if( $player_links )
253
+ $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
254
+ if( $duration && ltrim($duration, '0:') != '' )
255
+ $player_links .= "<a href=\"$EnclosureURL\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a> (". htmlspecialchars(POWERPRESS_DURATION_TEXT) .": " . powerpress_readable_duration($duration) ." &#8212; ".powerpress_byte_size($EnclosureSize).")".PHP_EOL;
256
+ else
257
+ $player_links .= "<a href=\"$EnclosureURL\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a> (".powerpress_byte_size($EnclosureSize).")".PHP_EOL;
258
+ }
259
+
260
+ if( $player_links )
261
+ {
262
+ if( count($GeneralSettings['custom_feeds']) > 1 && $feed_slug != 'podcast' )
263
+ {
264
+ $new_content .= '<p class="powerpress_links">'. htmlspecialchars(POWERPRESS_LINKS_TEXT) .' ('. htmlspecialchars($feed_slug) .'): '. $player_links . '</p>'.PHP_EOL;
265
+ }
266
+ else
267
+ {
268
+ $new_content .= '<p class="powerpress_links">'. htmlspecialchars(POWERPRESS_LINKS_TEXT) .': '. $player_links . '</p>'.PHP_EOL;
269
+ }
270
  }
271
  }
 
 
 
 
 
 
272
 
273
  if( $new_content == '' )
274
  return $content;
275
 
276
+ switch( $GeneralSettings['display_player'] )
277
  {
278
  case 1: { // Below posts
279
  return $content.$new_content;
291
 
292
  function powerpress_header()
293
  {
294
+ if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) || defined('PODCASTING_VERSION') )
295
  return;
296
  // PowerPress settings:
297
  $Powerpress = get_option('powerpress_general');
300
  {
301
  $PowerpressPluginURL = powerpress_get_root_url();
302
  ?>
303
+ <script type="text/javascript" src="<?php echo powerpress_get_root_url(); ?>player.js"></script>
304
  <script type="text/javascript">
305
  <?php
306
+ $new_window_width = 320;
307
+ $new_window_height = 240;
 
308
 
309
+ if( isset($Powerpress['new_window_width']) && $Powerpress['new_window_width'] > 100 )
310
+ $new_window_width = $Powerpress['new_window_width'];
311
+ if( isset($Powerpress['new_window_height']) && $Powerpress['new_window_height'] > 40 )
312
+ $new_window_height = $Powerpress['new_window_height'];
 
 
 
 
 
 
 
 
 
313
  ?>
314
+ function powerpress_pinw(pinw){window.open('<?php echo get_bloginfo('url'); ?>/?powerpress_pinw='+pinw, 'PowerPressPlayer','toolbar=0,status=0,resizable=1,width=<?php echo ($new_window_width + 40); ?>,height=<?php echo ($new_window_height + 80); ?>'); return false;}
315
  </script>
 
 
 
 
 
 
316
  <?php
317
  }
318
  }
362
  }
363
 
364
  $General = get_option('powerpress_general');
365
+
366
  // We made it this far, lets write stuff to the feed!
367
+ echo '<!-- podcast_generator="Blubrry PowerPress/'. POWERPRESS_VERSION .'" ';
368
  if( $General['advanced_mode'] == 0 )
369
+ echo 'mode="simple" ';
370
+ else
371
+ echo 'mode="advanced" ';
372
+
373
+ if( $General['episode_box_mode'] == 0 )
374
+ echo 'entry="normal" ';
375
+ else if( $General['episode_box_mode'] == 1)
376
+ echo 'entry="simple" ';
377
  else
378
+ echo 'entry="advanced" ';
379
+
380
+ echo '-->'.PHP_EOL;
381
 
382
  // add the itunes:new-feed-url tag to feed
383
  if( powerpress_is_custom_podcast_feed() )
624
  }
625
 
626
  // Split the episode information into parts...
627
+ list($EnclosureURL, $EnclosureSize, $EnclosureType, $Serialized) = explode("\n", $enclosureData, 4);
628
  $EnclosureURL = trim($EnclosureURL);
629
  $EnclosureType = trim($EnclosureType);
630
  $EnclosureSize = trim($EnclosureSize);
631
+ $author = (isset($powerpress_feed['itunes_author_post'])?get_the_author() :$powerpress_feed['itunes_talent_name']);
632
  $explicit = $powerpress_feed['explicit'];
633
  $summary = false;
634
  $subtitle = false;
640
  $EpisodeData = unserialize($Serialized);
641
  if( isset( $EpisodeData['duration'] ) )
642
  $duration = $EpisodeData['duration'];
643
+ if( $powerpress_feed['itunes_custom'] )
644
+ {
645
+ if( isset( $EpisodeData['summary'] ) )
646
+ $summary = $EpisodeData['summary'];
647
+ if( isset( $EpisodeData['subtitle'] ) )
648
+ $subtitle = $EpisodeData['subtitle'];
649
+ if( isset( $EpisodeData['keywords'] ) )
650
+ $keywords = $EpisodeData['keywords'];
651
+ // Code for future use:
652
+ if( isset( $EpisodeData['author'] ) )
653
+ $author = $EpisodeData['author'];
654
+ if( isset( $EpisodeData['explicit'] ) )
655
+ $explicit = $EpisodeData['explicit'];
656
+ if( isset( $EpisodeData['block'] ) )
657
+ $block = $EpisodeData['block'];
658
+ }
659
  }
660
 
661
  if( !$duration && !$custom_enclosure )
705
  else
706
  echo "\t\t<itunes:subtitle>". powerpress_format_itunes_value($content_no_html, 'subtitle', true) .'</itunes:subtitle>'.PHP_EOL;
707
 
708
+
709
+ if( $summary )
 
710
  echo "\t\t<itunes:summary>". powerpress_format_itunes_value($summary, 'summary') .'</itunes:summary>'.PHP_EOL;
711
+ else if( $powerpress_feed['enhance_itunes_summary'] )
712
+ echo "\t\t<itunes:summary>". powerpress_itunes_summary($post->post_content) .'</itunes:summary>'.PHP_EOL;
713
  else if( $excerpt_no_html )
714
  echo "\t\t<itunes:summary>". powerpress_format_itunes_value($excerpt_no_html, 'summary') .'</itunes:summary>'.PHP_EOL;
715
  else
732
 
733
  function powerpress_filter_rss_enclosure($content)
734
  {
735
+ if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) || defined('PODCASTING_VERSION') )
736
  return $content; // Another podcasting plugin is enabled...
737
 
738
 
883
 
884
  function powerpress_init()
885
  {
886
+ if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) || defined('PODCASTING_VERSION') )
887
  return false; // Another podcasting plugin is enabled...
888
 
889
+ if( isset($_GET['powerpress_pinw']) )
890
+ powerpress_do_pinw($_GET['powerpress_pinw']);
891
+
892
  add_feed('podcast', 'powerpress_do_podcast_feed');
893
 
894
  $GeneralSettings = get_option('powerpress_general');
946
 
947
  $powerpress_feed = array();
948
  $powerpress_feed['is_custom'] = true;
949
+ $powerpress_feed['itunes_custom'] = ($GeneralSettings['episode_box_mode'] == 2);
950
  $powerpress_feed['category'] = $cat_ID;
951
  $powerpress_feed['process_podpress'] = true; // Category feeds could originate from Podpress
952
  $powerpress_feed['default_url'] = rtrim($GeneralSettings['default_url'], '/') .'/';
960
  $powerpress_feed['posts_per_rss'] = $Feed['posts_per_rss'];
961
  if( $Feed['feed_redirect_url'] != '' )
962
  $powerpress_feed['feed_redirect_url'] = $Feed['feed_redirect_url'];
963
+ if( $Feed['itunes_author_post'] == true )
964
+ $powerpress_feed['itunes_author_post'] = true;
965
  return;
966
  }
967
 
975
 
976
  $powerpress_feed = array();
977
  $powerpress_feed['is_custom'] = true;
978
+ $powerpress_feed['itunes_custom'] = ($GeneralSettings['episode_box_mode'] == 2);
979
  $powerpress_feed['feed-slug'] = $feed_slug;
980
  $powerpress_feed['process_podpress'] = false; // We don't touch podpress data for custom feeds
981
  $powerpress_feed['default_url'] = rtrim($GeneralSettings['default_url'], '/') .'/';
1021
  {
1022
  $powerpress_feed = array(); // Only store what's needed for each feed item
1023
  $powerpress_feed['is_custom'] = false; // ($feed_slug == 'podcast'?true:false);
1024
+ $powerpress_feed['itunes_custom'] = ($GeneralSettings['episode_box_mode'] == 2);
1025
  $powerpress_feed['feed-slug'] = $feed_slug;
1026
  $powerpress_feed['process_podpress'] = $GeneralSettings['process_podpress']; // We don't touch podpress data for custom feeds
1027
  $powerpress_feed['default_url'] = rtrim($GeneralSettings['default_url'], '/') .'/';
1047
  // Returns true of the feed should be treated as a podcast feed
1048
  function powerpress_is_podcast_feed()
1049
  {
1050
+ if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) || defined('PODCASTING_VERSION') )
1051
  return false; // Another podcasting plugin is enabled...
1052
 
1053
  global $powerpress_feed;
1061
  // Returns true if the feed is a custom feed added by PowerPress
1062
  function powerpress_is_custom_podcast_feed()