PowerPress Podcasting plugin by Blubrry - Version 0.5.0

Version Description

Download this release

Release Info

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

Code changes from version 0.4.2 to 0.5.0

Files changed (5) hide show
  1. play_video_default.jpg +0 -0
  2. player.js +105 -36
  3. powerpress.php +82 -29
  4. powerpressadmin.php +64 -9
  5. readme.txt +12 -2
play_video_default.jpg ADDED
Binary file
player.js CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * jsMediaPlayer 1.0 for Blubrry Powerpress
3
  *
4
  * http://www.blubrry.com/powepress/
5
  *
@@ -8,16 +8,72 @@
8
  * Released under Aoache 2 license:
9
  * http://www.apache.org/licenses/LICENSE-2.0
10
  *
 
11
  * version 1.0.3 - 11/02/2008 - Added option for playing quicktime files in an intermediate fashion with an image to click to play.
12
  * version 1.0.2 - 07/26/2008 - Fixed pop up player bug caused by v 1.0.1
13
  * version 1.0.1 - 07/28/2008 - fixed flow player looping playback, flash player no longer loops.
14
  * version 1.0.0 - 07/26/2008 - initial release
15
  */
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  function jsMediaPlayer(FlashSrc) {
18
  // Member variables
19
  this.m_flash_src = FlashSrc;
20
- this.m_auto_play = false;
21
  this.m_width = 320;
22
  this.m_height = 240;
23
  this.m_player_div = false;
@@ -31,10 +87,6 @@ function jsMediaPlayer(FlashSrc) {
31
  this.m_flash_src = Src;
32
  }
33
 
34
- this.AutoPlay=function(Setting) {
35
- this.m_auto_play = Setting;
36
- }
37
-
38
  this.SetWidth=function(Width) {
39
  this.m_width = Width;
40
  }
@@ -68,6 +120,9 @@ function jsMediaPlayer(FlashSrc) {
68
  // Set the proeprties:
69
  this.m_media_url = this.PlayInPage.arguments[0];
70
  this.m_player_div = this.PlayInPage.arguments[1];
 
 
 
71
 
72
  var ext = this._getExt(this.m_media_url);
73
  switch( ext )
@@ -81,11 +136,10 @@ function jsMediaPlayer(FlashSrc) {
81
  case 'qt':
82
  case 'mov': {
83
 
84
- if( this.m_play_image && this.PlayInPage.arguments.length > 2 && this.PlayInPage.arguments[2] )
85
  {
86
- this.m_auto_play = true;
87
- document.getElementById( this.m_player_div ).innerHTML = '<a href="'+ this.m_media_url +'" onclick="return '+ this.PlayInPage.arguments[2] +'.PlayInPage(\''+ this.m_media_url +'\', \''+ this.m_player_div +'\');" title="Play on page"><img src="'+ this.m_play_image +'" alt="Play on page" /></a>';
88
- this.m_player_div = false; // Let tis player be used again on the page
89
  return false;
90
  }
91
 
@@ -99,24 +153,24 @@ function jsMediaPlayer(FlashSrc) {
99
  else if( ext == 'qt' || ext == 'mov' )
100
  contentType = 'video/quicktime';
101
 
102
- document.getElementById( this.m_player_div ).innerHTML = this._getQuickTime(contentType);
103
  }; break;
104
  case 'wma':
105
  case 'wmv':
106
  case 'asf': {
107
- document.getElementById( this.m_player_div ).innerHTML = this._getWinPlayer();
108
  }; break;
109
  case 'rm': {
110
- document.getElementById( this.m_player_div ).innerHTML = this._getRealPlayer();
111
  }
112
  case 'swf': {
113
- document.getElementById( this.m_player_div ).innerHTML = this._getFlash();
114
  }
115
  case 'flv': {
116
- this._doFlowPlayer();
117
  }; break;
118
  case 'mp3': {
119
- this._doFlowPlayer(24);
120
 
121
  }; break;
122
  default: {
@@ -191,18 +245,18 @@ function jsMediaPlayer(FlashSrc) {
191
  else if( ext == 'qt' || ext == 'mov' )
192
  contentType = 'video/quicktime';
193
 
194
- Html += this._getQuickTime(contentType);
195
  }; break;
196
  case 'wma':
197
  case 'wmv':
198
  case 'asf': {
199
- Html += this._getWinPlayer();
200
  }; break;
201
  case 'rm': {
202
- Html += this._getRealPlayer();
203
  }; break;
204
  case 'swf': {
205
- Html += this._getFlash();
206
  }; break;
207
  }
208
  }
@@ -230,13 +284,16 @@ function jsMediaPlayer(FlashSrc) {
230
  this._doFlowPlayer = function() {
231
 
232
  var height = this.m_height;
233
- if( this._doFlowPlayer.arguments.length > 0 )
 
234
  height = this._doFlowPlayer.arguments[0];
 
 
235
 
236
  flashembed(
237
  this.m_player_div,
238
  {src: this.m_flash_src, width: this.m_width, height: height },
239
- {config: { autoPlay: this.m_auto_play?true:false, autoBuffering: false, initialScale: 'scale', showFullScreenButton: false, showMenu: false, videoFile: this.m_media_url, loop: false, autoRewind: true } }
240
  );
241
 
242
  return false;
@@ -248,7 +305,7 @@ function jsMediaPlayer(FlashSrc) {
248
  if( this._getFlowPlayer.arguments.length > 1 )
249
  height = this._getFlowPlayer.arguments[1];
250
 
251
- var auto_play = this.m_auto_play;
252
  if( this._getFlowPlayer.arguments.length > 2 )
253
  auto_play = this._getFlowPlayer.arguments[2];
254
 
@@ -256,43 +313,52 @@ function jsMediaPlayer(FlashSrc) {
256
  Html += "flashembed(\n";
257
  Html += " '"+ destDiv +"', \n";
258
  Html += " {src: '"+ this.m_flash_src +"', width: "+ this.m_width +", height: "+ height +"}, \n";
259
- Html += " {config: { autoPlay: "+ (auto_play?'true':'false') +", autoBuffering: false, initialScale: 'scale', showFullScreenButton: false, showMenu: false, videoFile: '"+ this.m_media_url +"', loop: false, autoRewind: true } } \n";
260
  Html += " ); \n";
261
  return Html;
262
  }
263
 
264
  this._getFlash = function() {
265
-
 
 
 
266
  var Html = '';
267
- 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"'+ (this.m_auto_play?'':' play="false"') +' width="'+ this.m_width +'" height="'+ this.m_height +'" menu="true">\n';
268
  Html += ' <param name="movie" value="'+ this.m_media_url +'" />\n';
269
  Html += ' <param name="quality" value="high" />\n';
270
  Html += ' <param name="menu" value="true" />\n';
271
  Html += ' <param name="scale" value="noorder" />\n';
272
  Html += ' <param name="quality" value="high" />\n';
273
- Html += ' <embed src="'+ this.m_media_url +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"'+ (this.m_auto_play?'':' play="false"') +' width="'+ this.m_width +'" height="'+ this.m_height +'" menu="true"></embed>';
274
  Html += '</object>\n';
275
  return Html;
276
  }
277
 
278
  this._getRealPlayer = function() {
279
-
 
 
 
280
  var Html = '';
281
  Html += '<object id="realplayer" classid="clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa" width="'+ this.m_width +'" height="'+ this.m_height +'">\n';
282
  Html += ' <param name="src" value="'+ this.m_media_url +'" />\n';
283
- Html += ' <param name="autostart" value="'+ (this.m_auto_play?'true':'false') +'" />\n';
284
  Html += ' <param name="controls" value="imagewindow,controlpanel" />\n';
285
- Html += ' <embed src="'+ this.m_media_url +'" width="'+ this.m_width +'" height="'+ this.m_height +'" autostart="'+(this.m_auto_play?'true':'false')+'" controls="imagewindow,controlpanel" type="audio/x-pn-realaudio-plugin"></embed>';
286
  Html += '</object>\n';
287
  return Html;
288
  }
289
 
290
  this._getWinPlayer = function() {
291
-
 
 
 
292
  var Html = '';
293
  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';
294
  Html += ' <param name="url" value="'+ this.m_media_url +'" />\n';
295
- Html += ' <param name="AutoStart" value="'+ (this.m_auto_play?'true':'false') +'" />\n';
296
  Html += ' <param name="AutoSize" value="true" />\n';
297
  Html += ' <param name="AllowChangeDisplaySize" value="true" />\n';
298
  Html += ' <param name="standby" value="Media is loading..." />\n';
@@ -302,7 +368,7 @@ function jsMediaPlayer(FlashSrc) {
302
  Html += ' <param name="ShowCaptioning" value="false" />\n';
303
  Html += ' <param name="ShowDisplay" value="false" />\n';
304
  Html += ' <param name="ShowStatusBar" value="false" />\n';
305
- Html += ' <embed type="application/x-mplayer2" src="'+ this.m_media_url +'" width="'+ this.m_width +'" height="'+ this.m_height +'" scale="aspect" AutoStart="'+ (this.m_auto_play?'true':'false') +'" ShowDisplay="0" ShowStatusBar="0" AutoSize="1" AnimationAtStart="1" AllowChangeDisplaySize="1" ShowControls="1"></embed>\n';
306
  Html += '</object>\n';
307
  return Html;
308
  }
@@ -310,19 +376,22 @@ function jsMediaPlayer(FlashSrc) {
310
  this._getQuickTime = function() {
311
 
312
  var contentType = 'video/mpeg';
 
313
  if( this._getQuickTime.arguments.length > 0 )
314
  contentType = this._getQuickTime.arguments[0];
315
-
 
 
316
  var Html = '';
317
  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';
318
  Html += ' <param name="src" value="'+ this.m_media_url +'" />\n';
319
  Html += ' <param name="href" value="'+ this.m_media_url +'" />\n';
320
  Html += ' <param name="scale" value="aspect" />\n';
321
  Html += ' <param name="controller" value="true" />\n';
322
- Html += ' <param name="autoplay" value="'+ (this.m_auto_play?'true':'false') +'" />\n';
323
  Html += ' <param name="bgcolor" value="000000" />\n';
324
  Html += ' <param name="pluginspage" value="http://www.apple.com/quicktime/download/" />\n';
325
- Html += ' <embed src="'+ this.m_media_url +'" type="'+ contentType +'" width="'+ this.m_width +'" height="'+ this.m_height +'" scale="aspect" cache="true" bgcolor="000000" autoplay="'+ (this.m_auto_play?'true':'false') +'" controller="true" pluginspage="http://www.apple.com/quicktime/download/"></embed>';
326
  Html += '</object>\n';
327
  return Html;
328
  }
1
  /**
2
+ * jsMediaPlayer 1.1 for Blubrry Powerpress
3
  *
4
  * http://www.blubrry.com/powepress/
5
  *
8
  * Released under Aoache 2 license:
9
  * http://www.apache.org/licenses/LICENSE-2.0
10
  *
11
+ * versoin 1.1.0 - 11/25/20008 - Major re-write, object now stored in this include file, auto play is no longer a member variable and is determined by function call.
12
  * version 1.0.3 - 11/02/2008 - Added option for playing quicktime files in an intermediate fashion with an image to click to play.
13
  * version 1.0.2 - 07/26/2008 - Fixed pop up player bug caused by v 1.0.1
14
  * version 1.0.1 - 07/28/2008 - fixed flow player looping playback, flash player no longer loops.
15
  * version 1.0.0 - 07/26/2008 - initial release
16
  */
17
 
18
+ var g_bpPlayer = false;
19
+
20
+ /**
21
+ Initialize function for javascript based player
22
+
23
+ @PluginURL - where plugin files are located
24
+ @QuicktimeImage - image displayed in place of quicktime media types
25
+ @OnlyOnePlayer - pass 'true' if only one player should appear in the current page.
26
+ */
27
+ function powerpress_player_init(PluginURL, QuicktimeImage)
28
+ {
29
+ if( g_bpPlayer == false )
30
+ g_bpPlayer = new jsMediaPlayer(PluginURL +'FlowPlayerClassic.swf');
31
+ g_bpPlayer.PlayImage(QuicktimeImage);
32
+ if( powerpress_player_init.arguments.length > 2 )
33
+ g_bpPlayer.OnePlayerOnly(powerpress_player_init.arguments[2]);
34
+ }
35
+
36
+ /**
37
+ play media in page function
38
+
39
+ @MediaURL - complete url to media file
40
+ @PlayerDiv - Destiniation div id for player
41
+ @AutoPlay - Automatically start playing media file
42
+ */
43
+ function powerpress_play_page()
44
+ {
45
+ if( !g_bpPlayer )
46
+ return true; // Let the link handle itself
47
+
48
+ var media_url = powerpress_play_page.arguments[0];
49
+ var player_div = powerpress_play_page.arguments[1];
50
+ var auto_play = false;
51
+ if( powerpress_play_page.arguments.length > 2 && powerpress_play_page.arguments[2] )
52
+ auto_play = true;
53
+
54
+ return g_bpPlayer.PlayInPage(media_url, player_div, auto_play);
55
+ }
56
+
57
+ /**
58
+ play media in new window function
59
+
60
+ @MediaURL - complete url to media file
61
+ @AutoPlay - Automatically start playing media file
62
+ */
63
+ function powerpress_play_window()
64
+ {
65
+ if( !g_bpPlayer )
66
+ return true; // Let the link handle itself
67
+
68
+ var media_url = powerpress_play_window.arguments[0];
69
+ var auto_play = true; // Always auto play new window plays
70
+
71
+ return g_bpPlayer.PlayNewWindow(media_url);
72
+ }
73
+
74
  function jsMediaPlayer(FlashSrc) {
75
  // Member variables
76
  this.m_flash_src = FlashSrc;
 
77
  this.m_width = 320;
78
  this.m_height = 240;
79
  this.m_player_div = false;
87
  this.m_flash_src = Src;
88
  }
89
 
 
 
 
 
90
  this.SetWidth=function(Width) {
91
  this.m_width = Width;
92
  }
120
  // Set the proeprties:
121
  this.m_media_url = this.PlayInPage.arguments[0];
122
  this.m_player_div = this.PlayInPage.arguments[1];
123
+ var auto_play = false;
124
+ if( this.PlayInPage.arguments.length > 2 && this.PlayInPage.arguments[2] )
125
+ auto_play = true;
126
 
127
  var ext = this._getExt(this.m_media_url);
128
  switch( ext )
136
  case 'qt':
137
  case 'mov': {
138
 
139
+ if( this.m_play_image && auto_play == false )
140
  {
141
+ 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>';
142
+ this.m_player_div = false; // Let this player be used again on the page
 
143
  return false;
144
  }
145
 
153
  else if( ext == 'qt' || ext == 'mov' )
154
  contentType = 'video/quicktime';
155
 
156
+ document.getElementById( this.m_player_div ).innerHTML = this._getQuickTime(contentType, auto_play);
157
  }; break;
158
  case 'wma':
159
  case 'wmv':
160
  case 'asf': {
161
+ document.getElementById( this.m_player_div ).innerHTML = this._getWinPlayer(auto_play);
162
  }; break;
163
  case 'rm': {
164
+ document.getElementById( this.m_player_div ).innerHTML = this._getRealPlayer(auto_play);
165
  }
166
  case 'swf': {
167
+ document.getElementById( this.m_player_div ).innerHTML = this._getFlash(auto_play);
168
  }
169
  case 'flv': {
170
+ this._doFlowPlayer(0, auto_play);
171
  }; break;
172
  case 'mp3': {
173
+ this._doFlowPlayer(24, auto_play);
174
 
175
  }; break;
176
  default: {
245
  else if( ext == 'qt' || ext == 'mov' )
246
  contentType = 'video/quicktime';
247
 
248
+ Html += this._getQuickTime(contentType, true);
249
  }; break;
250
  case 'wma':
251
  case 'wmv':
252
  case 'asf': {
253
+ Html += this._getWinPlayer(true);
254
  }; break;
255
  case 'rm': {
256
+ Html += this._getRealPlayer(true);
257
  }; break;
258
  case 'swf': {
259
+ Html += this._getFlash(true);
260
  }; break;
261
  }
262
  }
284
  this._doFlowPlayer = function() {
285
 
286
  var height = this.m_height;
287
+ var auto_play = false;
288
+ if( this._doFlowPlayer.arguments.length > 0 && this._doFlowPlayer.arguments[0] > 0 )
289
  height = this._doFlowPlayer.arguments[0];
290
+ if( this._doFlowPlayer.arguments.length > 1 )
291
+ auto_play = this._doFlowPlayer.arguments[1];
292
 
293
  flashembed(
294
  this.m_player_div,
295
  {src: this.m_flash_src, width: this.m_width, height: height },
296
+ {config: { autoPlay: auto_play?true:false, autoBuffering: false, initialScale: 'scale', showFullScreenButton: false, showMenu: false, videoFile: this.m_media_url, loop: false, autoRewind: true } }
297
  );
298
 
299
  return false;
305
  if( this._getFlowPlayer.arguments.length > 1 )
306
  height = this._getFlowPlayer.arguments[1];
307
 
308
+ var auto_play = false;
309
  if( this._getFlowPlayer.arguments.length > 2 )
310
  auto_play = this._getFlowPlayer.arguments[2];
311
 
313
  Html += "flashembed(\n";
314
  Html += " '"+ destDiv +"', \n";
315
  Html += " {src: '"+ this.m_flash_src +"', width: "+ this.m_width +", height: "+ height +"}, \n";
316
+ 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";
317
  Html += " ); \n";
318
  return Html;
319
  }
320
 
321
  this._getFlash = function() {
322
+ var auto_play = false;
323
+ if( this._getFlash.arguments.length > 0 )
324
+ auto_play = this._getFlash.arguments[0];
325
+
326
  var Html = '';
327
+ 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';
328
  Html += ' <param name="movie" value="'+ this.m_media_url +'" />\n';
329
  Html += ' <param name="quality" value="high" />\n';
330
  Html += ' <param name="menu" value="true" />\n';
331
  Html += ' <param name="scale" value="noorder" />\n';
332
  Html += ' <param name="quality" value="high" />\n';
333
+ 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>';
334
  Html += '</object>\n';
335
  return Html;
336
  }
337
 
338
  this._getRealPlayer = function() {
339
+ var auto_play = false;
340
+ if( this._getRealPlayer.arguments.length > 0 )
341
+ auto_play = this._getRealPlayer.arguments[0];
342
+
343
  var Html = '';
344
  Html += '<object id="realplayer" classid="clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa" width="'+ this.m_width +'" height="'+ this.m_height +'">\n';
345
  Html += ' <param name="src" value="'+ this.m_media_url +'" />\n';
346
+ Html += ' <param name="autostart" value="'+ (auto_play?'true':'false') +'" />\n';
347
  Html += ' <param name="controls" value="imagewindow,controlpanel" />\n';
348
+ 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>';
349
  Html += '</object>\n';
350
  return Html;
351
  }
352
 
353
  this._getWinPlayer = function() {
354
+ var auto_play = false;
355
+ if( this._getWinPlayer.arguments.length > 0 )
356
+ auto_play = this._getWinPlayer.arguments[0];
357
+
358
  var Html = '';
359
  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';
360
  Html += ' <param name="url" value="'+ this.m_media_url +'" />\n';
361
+ Html += ' <param name="AutoStart" value="'+ (auto_play?'true':'false') +'" />\n';
362
  Html += ' <param name="AutoSize" value="true" />\n';
363
  Html += ' <param name="AllowChangeDisplaySize" value="true" />\n';
364
  Html += ' <param name="standby" value="Media is loading..." />\n';
368
  Html += ' <param name="ShowCaptioning" value="false" />\n';
369
  Html += ' <param name="ShowDisplay" value="false" />\n';
370
  Html += ' <param name="ShowStatusBar" value="false" />\n';
371
+ 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';
372
  Html += '</object>\n';
373
  return Html;
374
  }
376
  this._getQuickTime = function() {
377
 
378
  var contentType = 'video/mpeg';
379
+ var auto_play = false;
380
  if( this._getQuickTime.arguments.length > 0 )
381
  contentType = this._getQuickTime.arguments[0];
382
+ if( this._getQuickTime.arguments.length > 1 )
383
+ auto_play = this._getQuickTime.arguments[1];
384
+
385
  var Html = '';
386
  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';
387
  Html += ' <param name="src" value="'+ this.m_media_url +'" />\n';
388
  Html += ' <param name="href" value="'+ this.m_media_url +'" />\n';
389
  Html += ' <param name="scale" value="aspect" />\n';
390
  Html += ' <param name="controller" value="true" />\n';
391
+ Html += ' <param name="autoplay" value="'+ (auto_play?'true':'false') +'" />\n';
392
  Html += ' <param name="bgcolor" value="000000" />\n';
393
  Html += ' <param name="pluginspage" value="http://www.apple.com/quicktime/download/" />\n';
394
+ 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>';
395
  Html += '</object>\n';
396
  return Html;
397
  }
powerpress.php CHANGED
@@ -3,10 +3,11 @@
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.4.2
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
 
10
  2008-10-24 - v0.4.2: Fixed quicktime in-page player bug, fixed bug which caused itunes keywords and subtitle to be blank and incremented version number.
11
  2008-10-24 - v0.4.1: Fixed auto-play bug found in last update, only affected quicktime files with the play on page option.
12
  2008-10-21 - v0.4.0: Added two new play options adding 'play on page' links with and without play in new window links and now use a customizable play image for quicktime media.
@@ -38,11 +39,7 @@ License: Apache License version 2.0 (http://www.apache.org/licenses/)
38
  is interpreted as GPL version 3.0 for compatibility with Apache 2.0 license.
39
  */
40
 
41
- define('POWERPRESS_VERSION', '0.4.2' );
42
-
43
- // Include the <itunes:summary> tag in each rss <item> tag.
44
- //define('POWERPRESS_ITEM_SUMMARY', true); // Note, this is not necessary, itunes will use the description value if not present
45
- // Please place define above in your wp-config.php.
46
 
47
  // include <itunes:new-feed-url> tag in Main RSS feed:
48
  //define('POWERPRESS_NEW_FEED_URL', 'http://www.your-site.com/path/to/feed/');
@@ -57,12 +54,10 @@ define('POWERPRESS_VERSION', '0.4.2' );
57
  // define('POWERPRESS_PLAY_IMAGE', 'http://www.blubrry.com/themes/blubrry/images/player/PlayerBadge150x50NoBorder.jpg');
58
 
59
  // Define variables, advanced users could define these in their own wp-config.php so lets not try to re-define
60
- if( !defined('POWERPRESS_PLUGIN_PATH') )
61
- define('POWERPRESS_PLUGIN_PATH', '/wp-content/plugins/powerpress/');
62
  if( !defined('POWERPRESS_LINK_SEPARATOR') )
63
  define('POWERPRESS_LINK_SEPARATOR', '|');
64
  if( !defined('POWERPRESS_PLAY_IMAGE') )
65
- define('POWERPRESS_PLAY_IMAGE', 'play_default.jpg');
66
  if( !defined('PHP_EOL') )
67
  define('PHP_EOL', "\n"); // We need this variable defined for new lines.
68
 
@@ -87,7 +82,11 @@ function powerpress_content($content)
87
  //$Settings = get_option('powerpress_general');
88
  $podPressMedia = get_post_meta($post->ID, 'podPressMedia', true);
89
  if( $podPressMedia )
 
90
  $EnclosureURL = $podPressMedia[0]['URI'];
 
 
 
91
  if( !$EnclosureURL )
92
  return $content;
93
  if( strpos($EnclosureURL, 'http://' ) !== 0 )
@@ -130,20 +129,20 @@ function powerpress_content($content)
130
  switch( $Powerpress['player_function'] )
131
  {
132
  case 1: { // On page and new window
133
- $player_links .= "<a href=\"$EnclosureURL\" title=\"Play in new window\" onclick=\"return bpPlayer.PlayNewWindow(this.href);\">Play in new window</a>".PHP_EOL;
134
  }; break;
135
  case 2: { // Play in page only
136
  }; break;
137
  case 3: { //Play in new window only
138
- $player_links .= "<a href=\"$EnclosureURL\" title=\"Play in new window\" onclick=\"return bpPlayer.PlayNewWindow(this.href);\">Play in new window</a>".PHP_EOL;
139
  }; break;
140
  case 4: { // Play on page link only
141
- $player_links .= "<a href=\"$EnclosureURL\" title=\"Play on page\" onclick=\"return bpPlayer.PlayInPage(this.href, 'powerpress_player_{$post->ID}');\">Play on page</a>".PHP_EOL;
142
  }; break;
143
  case 5: { //Play on page link and new window
144
- $player_links .= "<a href=\"$EnclosureURL\" title=\"Play on page\" onclick=\"return bpPlayer.PlayInPage(this.href, 'powerpress_player_{$post->ID}');\">Play on page</a>".PHP_EOL;
145
  $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
146
- $player_links .= "<a href=\"$EnclosureURL\" title=\"Play in new window\" onclick=\"return bpPlayer.PlayNewWindow(this.href);\">Play in new window</a>".PHP_EOL;
147
  }; break;
148
  }//end switch
149
 
@@ -153,13 +152,29 @@ function powerpress_content($content)
153
  $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
154
  $player_links .= "<a href=\"$EnclosureURL\" title=\"Download\">Download</a>".PHP_EOL;
155
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
 
157
  $new_content = '';
158
  if( $Powerpress['player_function'] == 1 || $Powerpress['player_function'] == 2 ) // We have some kind of on-line player
159
  {
160
  $new_content .= '<div class="powerpress_player" id="powerpress_player_'. $post->ID .'"></div>'.PHP_EOL;
161
  $new_content .= '<script type="text/javascript">'.PHP_EOL;
162
- $new_content .= "bpPlayer.PlayInPage('$EnclosureURL', 'powerpress_player_{$post->ID}', 'bpPlayer');\n";
163
  $new_content .= '</script>'.PHP_EOL;
164
  }
165
  else if( $Powerpress['player_function'] == 4 || $Powerpress['player_function'] == 5 )
@@ -194,17 +209,15 @@ function powerpress_header()
194
  ?>
195
  <script type="text/javascript" src="<?php echo $PowerpressPluginURL; ?>player.js"></script>
196
  <script type="text/javascript">
197
- var bpPlayer = new jsMediaPlayer('<?php echo $PowerpressPluginURL; ?>FlowPlayerClassic.swf');
198
  <?php
199
- if( $Powerpress['player_function'] == 4 || $Powerpress['player_function'] == 5 )
200
- {
201
- echo 'bpPlayer.OnePlayerOnly(true);'.PHP_EOL;
202
- echo 'bpPlayer.AutoPlay(true);'.PHP_EOL;
203
- }
204
  $player_image_url = POWERPRESS_PLAY_IMAGE;
205
  if( strstr($player_image_url, 'http://') !== $player_image_url )
206
  $player_image_url = powerpress_get_root_url().$player_image_url;
207
- echo 'bpPlayer.PlayImage(\''.$player_image_url.'\');'.PHP_EOL;
 
 
 
 
208
  ?>
209
  </script>
210
  <style type="text/css">
@@ -281,7 +294,7 @@ function powerpress_rss2_head()
281
  echo "\t<itunes:new-feed-url>". constant('POWERPRESS_NEW_FEED_URL') .'</itunes:new-feed-url>'.PHP_EOL;
282
  else if( defined('POWERPRESS_NEW_FEED_URL_'.strtoupper($feed) ) )
283
  echo "\t<itunes:new-feed-url>". constant( 'POWERPRESS_NEW_FEED_URL_'.strtoupper($feed) ) .'</itunes:new-feed-url>'.PHP_EOL;
284
-
285
  if( $Feed['itunes_summary'] )
286
  echo "\t".'<itunes:summary>'. htmlentities( $Feed['itunes_summary'], ENT_NOQUOTES, 'UTF-8') .'</itunes:summary>'.PHP_EOL;
287
  else
@@ -292,6 +305,8 @@ function powerpress_rss2_head()
292
 
293
  $powerpress_itunes_explicit = $explicit[$Feed['itunes_explicit']];
294
  $powerpress_itunes_talent_name = $Feed['itunes_talent_name'];
 
 
295
 
296
  if( $powerpress_itunes_explicit )
297
  echo "\t".'<itunes:explicit>' . $powerpress_itunes_explicit . '</itunes:explicit>'.PHP_EOL;
@@ -507,8 +522,8 @@ function powerpress_rss2_item()
507
  else
508
  echo "\t\t<itunes:subtitle>". powerpress_format_itunes_value(powerpress_smart_trim($content_no_html, 250, true)) .'</itunes:subtitle>'.PHP_EOL;
509
 
510
- if( defined('POWERPRESS_ITEM_SUMMARY') )
511
- echo "\t\t<itunes:summary>". powerpress_format_itunes_value(powerpress_smart_trim($content_no_html, 4000)) .'</itunes:summary>'.PHP_EOL;
512
  if( $powerpress_itunes_talent_name )
513
  echo "\t\t<itunes:author>" . $powerpress_itunes_talent_name . '</itunes:author>'.PHP_EOL;
514
 
@@ -574,7 +589,17 @@ function powerpress_posts_where($where)
574
  if( is_feed() && get_query_var('feed') == 'podcast' )
575
  {
576
  global $wpdb;
577
- $where .= " AND {$wpdb->postmeta}.meta_key = 'enclosure' ";
 
 
 
 
 
 
 
 
 
 
578
  }
579
  return $where;
580
  }
@@ -690,17 +715,18 @@ function powerpress_itunes_categories($PrefixSubCategories = false)
690
 
691
  function powerpress_get_root_url()
692
  {
693
- return get_bloginfo('url') . POWERPRESS_PLUGIN_PATH;
 
694
  }
695
 
696
  function powerpress_format_itunes_value($value)
697
  {
698
  $value = htmlentities($value, ENT_NOQUOTES, 'UTF-8');
699
- $value = str_replace('&quot;', '', $value);
700
  $value = str_replace('&amp;', '', $value);
701
  $value = str_replace('&lt;', '', $value);
702
  $value = str_replace('&gt;', '', $value);
703
- $value = str_replace('&nbsp;', '', $value);
704
  $value = str_replace('&', '', $value); // Last attempt to fix, just remove the &
705
  return $value;
706
  }
@@ -758,6 +784,33 @@ function powerpress_add_redirect_url($MediaURL, $GeneralSettings = false)
758
 
759
  return $NewURL;
760
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
761
  /*
762
  End Helper Functions
763
  */
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.5.0
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
10
+ 2008-11-26 - v0.5.0: Added options to report media duration and file size next to download links, new Media URL check performed when adding episode to new post and fixed a number of bugs including the player auto play bug caused by version v0.4.2.
11
  2008-10-24 - v0.4.2: Fixed quicktime in-page player bug, fixed bug which caused itunes keywords and subtitle to be blank and incremented version number.
12
  2008-10-24 - v0.4.1: Fixed auto-play bug found in last update, only affected quicktime files with the play on page option.
13
  2008-10-21 - v0.4.0: Added two new play options adding 'play on page' links with and without play in new window links and now use a customizable play image for quicktime media.
39
  is interpreted as GPL version 3.0 for compatibility with Apache 2.0 license.
40
  */
41
 
42
+ define('POWERPRESS_VERSION', '0.5.0' );
 
 
 
 
43
 
44
  // include <itunes:new-feed-url> tag in Main RSS feed:
45
  //define('POWERPRESS_NEW_FEED_URL', 'http://www.your-site.com/path/to/feed/');
54
  // define('POWERPRESS_PLAY_IMAGE', 'http://www.blubrry.com/themes/blubrry/images/player/PlayerBadge150x50NoBorder.jpg');
55
 
56
  // Define variables, advanced users could define these in their own wp-config.php so lets not try to re-define
 
 
57
  if( !defined('POWERPRESS_LINK_SEPARATOR') )
58
  define('POWERPRESS_LINK_SEPARATOR', '|');
59
  if( !defined('POWERPRESS_PLAY_IMAGE') )
60
+ define('POWERPRESS_PLAY_IMAGE', 'play_video_default.jpg');
61
  if( !defined('PHP_EOL') )
62
  define('PHP_EOL', "\n"); // We need this variable defined for new lines.
63
 
82
  //$Settings = get_option('powerpress_general');
83
  $podPressMedia = get_post_meta($post->ID, 'podPressMedia', true);
84
  if( $podPressMedia )
85
+ {
86
  $EnclosureURL = $podPressMedia[0]['URI'];
87
+ $EnclosureSize = $podPressMedia[0]['size'];
88
+ $EnclosureType = '';
89
+ }
90
  if( !$EnclosureURL )
91
  return $content;
92
  if( strpos($EnclosureURL, 'http://' ) !== 0 )
129
  switch( $Powerpress['player_function'] )
130
  {
131
  case 1: { // On page and new window
132
+ $player_links .= "<a href=\"$EnclosureURL\" title=\"Play in new window\" onclick=\"return powerpress_play_window(this.href);\">Play in new window</a>".PHP_EOL;
133
  }; break;
134
  case 2: { // Play in page only
135
  }; break;
136
  case 3: { //Play in new window only
137
+ $player_links .= "<a href=\"$EnclosureURL\" title=\"Play in new window\" onclick=\"return powerpress_play_window(this.href);\">Play in new window</a>".PHP_EOL;
138
  }; break;
139
  case 4: { // Play on page link only
140
+ $player_links .= "<a href=\"$EnclosureURL\" title=\"Play on page\" onclick=\"return powerpress_play_page(this.href, 'powerpress_player_{$post->ID}','true');\">Play on page</a>".PHP_EOL;
141
  }; break;
142
  case 5: { //Play on page link and new window
143
+ $player_links .= "<a href=\"$EnclosureURL\" title=\"Play on page\" onclick=\"return powerpress_play_page(this.href, 'powerpress_player_{$post->ID}','true');\">Play on page</a>".PHP_EOL;
144
  $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
145
+ $player_links .= "<a href=\"$EnclosureURL\" title=\"Play in new window\" onclick=\"return powerpress_play_window(this.href);\">Play in new window</a>".PHP_EOL;
146
  }; break;
147
  }//end switch
148
 
152
  $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
153
  $player_links .= "<a href=\"$EnclosureURL\" title=\"Download\">Download</a>".PHP_EOL;
154
  }
155
+ else if( $Powerpress['podcast_link'] == 2 )
156
+ {
157
+ if( $player_links )
158
+ $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
159
+ $player_links .= "<a href=\"$EnclosureURL\" title=\"Download\">Download</a> (".powerpress_byte_size($EnclosureSize).") ".PHP_EOL;
160
+ }
161
+ else if( $Powerpress['podcast_link'] == 3 )
162
+ {
163
+ $duration = get_post_meta($post->ID, 'itunes:duration', true);
164
+ if( $player_links )
165
+ $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
166
+ if( $duration && ltrim($duration, '0:') != '' )
167
+ $player_links .= "<a href=\"$EnclosureURL\" title=\"Download\">Download</a> (duration: " . ltrim($duration, '0:') ." &#8212; ".powerpress_byte_size($EnclosureSize).")".PHP_EOL;
168
+ else
169
+ $player_links .= "<a href=\"$EnclosureURL\" title=\"Download\">Download</a> (".powerpress_byte_size($EnclosureSize).")".PHP_EOL;
170
+ }
171
 
172
  $new_content = '';
173
  if( $Powerpress['player_function'] == 1 || $Powerpress['player_function'] == 2 ) // We have some kind of on-line player
174
  {
175
  $new_content .= '<div class="powerpress_player" id="powerpress_player_'. $post->ID .'"></div>'.PHP_EOL;
176
  $new_content .= '<script type="text/javascript">'.PHP_EOL;
177
+ $new_content .= "powerpress_play_page('$EnclosureURL', 'powerpress_player_{$post->ID}');\n";
178
  $new_content .= '</script>'.PHP_EOL;
179
  }
180
  else if( $Powerpress['player_function'] == 4 || $Powerpress['player_function'] == 5 )
209
  ?>
210
  <script type="text/javascript" src="<?php echo $PowerpressPluginURL; ?>player.js"></script>
211
  <script type="text/javascript">
 
212
  <?php
 
 
 
 
 
213
  $player_image_url = POWERPRESS_PLAY_IMAGE;
214
  if( strstr($player_image_url, 'http://') !== $player_image_url )
215
  $player_image_url = powerpress_get_root_url().$player_image_url;
216
+
217
+ if( $Powerpress['player_function'] == 4 || $Powerpress['player_function'] == 5 ) // Links would imply only one player in the page
218
+ echo 'powerpress_player_init(\''. $PowerpressPluginURL .'\',\''. $player_image_url .'\',true);'.PHP_EOL;
219
+ else
220
+ echo 'powerpress_player_init(\''. $PowerpressPluginURL .'\',\''. $player_image_url .'\');'.PHP_EOL;
221
  ?>
222
  </script>
223
  <style type="text/css">
294
  echo "\t<itunes:new-feed-url>". constant('POWERPRESS_NEW_FEED_URL') .'</itunes:new-feed-url>'.PHP_EOL;
295
  else if( defined('POWERPRESS_NEW_FEED_URL_'.strtoupper($feed) ) )
296
  echo "\t<itunes:new-feed-url>". constant( 'POWERPRESS_NEW_FEED_URL_'.strtoupper($feed) ) .'</itunes:new-feed-url>'.PHP_EOL;
297
+
298
  if( $Feed['itunes_summary'] )
299
  echo "\t".'<itunes:summary>'. htmlentities( $Feed['itunes_summary'], ENT_NOQUOTES, 'UTF-8') .'</itunes:summary>'.PHP_EOL;
300
  else
305
 
306
  $powerpress_itunes_explicit = $explicit[$Feed['itunes_explicit']];
307
  $powerpress_itunes_talent_name = $Feed['itunes_talent_name'];
308
+ if( $powerpress_itunes_talent_name )
309
+ echo "\t\t<itunes:author>" . $powerpress_itunes_talent_name . '</itunes:author>'.PHP_EOL;
310
 
311
  if( $powerpress_itunes_explicit )
312
  echo "\t".'<itunes:explicit>' . $powerpress_itunes_explicit . '</itunes:explicit>'.PHP_EOL;
522
  else
523
  echo "\t\t<itunes:subtitle>". powerpress_format_itunes_value(powerpress_smart_trim($content_no_html, 250, true)) .'</itunes:subtitle>'.PHP_EOL;
524
 
525
+ echo "\t\t<itunes:summary>". powerpress_format_itunes_value(powerpress_smart_trim($content_no_html, 4000)) .'</itunes:summary>'.PHP_EOL;
526
+
527
  if( $powerpress_itunes_talent_name )
528
  echo "\t\t<itunes:author>" . $powerpress_itunes_talent_name . '</itunes:author>'.PHP_EOL;
529
 
589
  if( is_feed() && get_query_var('feed') == 'podcast' )
590
  {
591
  global $wpdb;
592
+ $where .= " AND (";
593
+ $where .= " {$wpdb->postmeta}.meta_key = 'enclosure' ";
594
+
595
+ // Powerpress settings:
596
+ $Powerpress = get_option('powerpress_general');
597
+
598
+ // Include Podpress data if exists...
599
+ if( $Powerpress['process_podpress'] )
600
+ $where .= " OR {$wpdb->postmeta}.meta_key = 'podPressMedia' ";
601
+
602
+ $where .=") ";
603
  }
604
  return $where;
605
  }
715
 
716
  function powerpress_get_root_url()
717
  {
718
+ $powerpress_dirname = basename( dirname(__FILE__) );
719
+ return WP_PLUGIN_URL . '/'. $powerpress_dirname .'/';
720
  }
721
 
722
  function powerpress_format_itunes_value($value)
723
  {
724
  $value = htmlentities($value, ENT_NOQUOTES, 'UTF-8');
725
+ //$value = str_replace('&quot;', '', $value);
726
  $value = str_replace('&amp;', '', $value);
727
  $value = str_replace('&lt;', '', $value);
728
  $value = str_replace('&gt;', '', $value);
729
+ //$value = str_replace('&nbsp;', '', $value);
730
  $value = str_replace('&', '', $value); // Last attempt to fix, just remove the &
731
  return $value;
732
  }
784
 
785
  return $NewURL;
786
  }
787
+
788
+ /*
789
+ Code contributed from upekshapriya on the Blubrry Forums
790
+ */
791
+ function powerpress_byte_size($ppbytes)
792
+ {
793
+ $ppsize = $ppbytes / 1024;
794
+ if($ppsize < 1024)
795
+ {
796
+ $ppsize = number_format($ppsize, 1);
797
+ $ppsize .= 'KB';
798
+ }
799
+ else
800
+ {
801
+ if($ppsize / 1024 < 1024)
802
+ {
803
+ $ppsize = number_format($ppsize / 1024, 1);
804
+ $ppsize .= 'MB';
805
+ }
806
+ else if ($ppsize / 1024 / 1024 < 1024)
807
+ {
808
+ $ppsize = number_format($ppsize / 1024 / 1024, 1);
809
+ $ppsize .= 'GB';
810
+ }
811
+ }
812
+ return $ppsize;
813
+ }
814
  /*
815
  End Helper Functions
816
  */
powerpressadmin.php CHANGED
@@ -58,7 +58,39 @@ function powerpress_meta_box($object, $box)
58
  #powerpress_podcast_box .powerpress_row_content {
59
  margin-left: 120px;
60
  }
 
 
 
 
 
 
 
 
 
 
61
  </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  <div id="powerpress_podcast_box"<?php if( $EnclosureURL ) echo ' style="display:none;"'; ?>>
63
  <?php
64
  if( $EnclosureURL )
@@ -75,10 +107,11 @@ function powerpress_meta_box($object, $box)
75
  }
76
  ?>
77
  <div id="powerpress_podcast_edit">
 
78
  <div class="powerpress_row">
79
  <label for "Powerpress[url]">Media URL</label>
80
  <div class="powerpress_row_content">
81
- <input id="powerpress_url" name="Powerpress[url]" value="<?php echo $EnclosureURL; ?>" style="width: 70%; font-size: 90%;" />
82
  </div>
83
  </div>
84
  <div class="powerpress_row">
@@ -286,8 +319,8 @@ function powerpress_admin_head()
286
  echo ' text-align: center;'.PHP_EOL;
287
  echo ' border-width: 1px;'.PHP_EOL;
288
  echo ' border-style: solid;'.PHP_EOL;
289
- echo ' border-color: #c69;'.PHP_EOL;
290
- echo ' background-color: #ffeff7;'.PHP_EOL;
291
  echo ' font-weight: bold;'.PHP_EOL;
292
  echo '}'.PHP_EOL;
293
  echo '</style>'.PHP_EOL;
@@ -300,9 +333,18 @@ function powerpress_admin_page()
300
  {
301
  global $wp_version;
302
 
 
 
 
 
 
 
 
 
 
303
  $VersionDiff = version_compare($wp_version, 2.5);
304
  if( $VersionDiff < 0 )
305
- echo '<div class="powerpress-error">Blubrry Powerpress requires Wordpress version 2.5 or greater.</div>';
306
 
307
 
308
  $UploadArray = wp_upload_dir();
@@ -347,7 +389,7 @@ function powerpress_admin_page()
347
  }
348
  else
349
  {
350
- echo '<div class="powerpress-error">Invalid iTunes image: ' . htmlspecialchars($_FILES['itunes_image_file']['name']) . '</div>';
351
  }
352
  }
353
 
@@ -373,7 +415,7 @@ function powerpress_admin_page()
373
  }
374
  else
375
  {
376
- echo '<div class="powerpress-error">Invalid RSS image: ' . htmlspecialchars($_FILES['rss2_image_file']['name']) . '</div>';
377
  }
378
  }
379
 
@@ -405,7 +447,7 @@ function powerpress_admin_page()
405
  }
406
  else
407
  {
408
- echo '<div class="powerpress-error">' . htmlspecialchars($PingResults['content']) . '</div>';
409
  }
410
  }
411
 
@@ -611,12 +653,23 @@ while( list($value,$desc) = each($options) )
611
  ?>
612
  </select> (Notify iTunes when you publish a new episode.)
613
  <p><input name="TestiTunesPing" type="checkbox" value="1"<?php if( $OpenSSLSupport == false ) echo ' disabled'; ?> /> Test iTunes Ping (recommended)</p>
 
 
 
 
 
 
 
 
 
 
 
614
  </td>
615
  </tr>
616
 
617
  </table>
618
  <?php if( $OpenSSLSupport == false ) { ?>
619
- <div class="powerpress-error">Ping iTunes requires OpenSSL in PHP. Please refer to your php.ini to enable the php_openssl module.</div>
620
  <?php } ?>
621
  <br />
622
 
@@ -656,6 +709,7 @@ while( list($value,$desc) = each($playeroptions) )
656
  <p style="margin-top: 0;">
657
  Note: "On Page Link" is a link to "play on page", the player is not displayed until link is clicked.
658
  </p>
 
659
  </td>
660
  </tr>
661
 
@@ -666,7 +720,7 @@ while( list($value,$desc) = each($playeroptions) )
666
  <td>
667
  <select name="General[podcast_link]">
668
  <?php
669
- $linkoptions = array(1=>"Display", 0=>"Disable");
670
 
671
  while( list($value,$desc) = each($linkoptions) )
672
  echo "\t<option value=\"$value\"". ($General['podcast_link']==$value?' selected':''). ">$desc</option>\n";
@@ -937,6 +991,7 @@ while( list($value,$desc) = each($explicit) )
937
  </table>
938
  <p style="font-size: 85%; text-align: center;">
939
  <a href="http://www.blubrry.com/powerpress/" title="Blubrry Powerpress" target="_blank">Blubrry Powerpress</a> <?php echo POWERPRESS_VERSION; ?>
 
940
  </p>
941
  <p class="submit">
942
  <input type="submit" name="Submit" value="<?php _e('Save Changes' ) ?>" />
58
  #powerpress_podcast_box .powerpress_row_content {
59
  margin-left: 120px;
60
  }
61
+ #powerpress_podcast_box .error {
62
+ margin-top: 10px;
63
+ margin-bottom: 10px;
64
+ padding: 5px;
65
+ font-size: 12px;
66
+ text-align: center;
67
+ border-width: 1px;
68
+ border-style: solid;
69
+ font-weight: bold;
70
+ }
71
  </style>
72
+ <script language="javascript">
73
+ function powerpress_check_url(url)
74
+ {
75
+ var validChars = ':0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/-_.';
76
+
77
+ for( var x = 0; x < url.length; x++ )
78
+ {
79
+ if( validChars.indexOf( url.charAt(x) ) == -1 )
80
+ {
81
+ document.getElementById('powerpress_warning').innerHTML = 'Media URL contains characters that may cause problems for some clients. For maximum compatibility, only use letters, numbers, dash - and underscore _ characters only.';
82
+ document.getElementById('powerpress_warning').style.display = 'block';
83
+ return;
84
+ }
85
+
86
+ if( x == 5 )
87
+ validChars = validChars.substring(1); // remove the colon, should no longer appear in URLs
88
+ }
89
+
90
+ document.getElementById('powerpress_warning').style.display = 'none';
91
+ }
92
+
93
+ </script>
94
  <div id="powerpress_podcast_box"<?php if( $EnclosureURL ) echo ' style="display:none;"'; ?>>
95
  <?php
96
  if( $EnclosureURL )
107
  }
108
  ?>
109
  <div id="powerpress_podcast_edit">
110
+ <div class="error" id="powerpress_warning" style="display:none;">None</div>
111
  <div class="powerpress_row">
112
  <label for "Powerpress[url]">Media URL</label>
113
  <div class="powerpress_row_content">
114
+ <input id="powerpress_url" name="Powerpress[url]" value="<?php echo $EnclosureURL; ?>" onblur="powerpress_check_url(this.value)" style="width: 70%; font-size: 90%;" />
115
  </div>
116
  </div>
117
  <div class="powerpress_row">
319
  echo ' text-align: center;'.PHP_EOL;
320
  echo ' border-width: 1px;'.PHP_EOL;
321
  echo ' border-style: solid;'.PHP_EOL;
322
+ //echo ' border-color: #c69;'.PHP_EOL;
323
+ //echo ' background-color: #ffeff7;'.PHP_EOL;
324
  echo ' font-weight: bold;'.PHP_EOL;
325
  echo '}'.PHP_EOL;
326
  echo '</style>'.PHP_EOL;
333
  {
334
  global $wp_version;
335
 
336
+ if( isset($_POST['CheckSWF']) )
337
+ {
338
+ $md5 = md5_file( dirname(__FILE__).'/FlowPlayerClassic.swf' );
339
+ if( $md5 == '051ed574774436e228e5dafd97d0f5f0' )
340
+ echo '<div class="updated powerpress-notice">Flash player verified successfully.</div>';
341
+ else
342
+ echo '<div class="error powerpress-error">FlowPlayerClassic.swf is corrupt, please re-upload.</div>';
343
+ }
344
+
345
  $VersionDiff = version_compare($wp_version, 2.5);
346
  if( $VersionDiff < 0 )
347
+ echo '<div class="error powerpress-error">Blubrry Powerpress requires Wordpress version 2.5 or greater.</div>';
348
 
349
 
350
  $UploadArray = wp_upload_dir();
389
  }
390
  else
391
  {
392
+ echo '<div class="error powerpress-error">Invalid iTunes image: ' . htmlspecialchars($_FILES['itunes_image_file']['name']) . '</div>';
393
  }
394
  }
395
 
415
  }
416
  else
417
  {
418
+ echo '<div class="error powerpress-error">Invalid RSS image: ' . htmlspecialchars($_FILES['rss2_image_file']['name']) . '</div>';
419
  }
420
  }
421
 
447
  }
448
  else
449
  {
450
+ echo '<div class="error powerpress-error">' . htmlspecialchars($PingResults['content']) . '</div>';
451
  }
452
  }
453
 
653
  ?>
654
  </select> (Notify iTunes when you publish a new episode.)
655
  <p><input name="TestiTunesPing" type="checkbox" value="1"<?php if( $OpenSSLSupport == false ) echo ' disabled'; ?> /> Test iTunes Ping (recommended)</p>
656
+ <?php if( $General['itunes_url'] ) {
657
+
658
+ $ping_url = str_replace(
659
+ array( 'https://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=',
660
+ 'http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=',
661
+ 'https://www.itunes.com/podcast?id=',
662
+ 'http://www.itunes.com/podcast?id='),
663
+ 'https://phobos.apple.com/WebObjects/MZFinance.woa/wa/pingPodcast?id=', $General['itunes_url']);
664
+ ?>
665
+ <p>You may also ping iTunes by using the following link: <a href="#" onclick="javascript: window.open('<?php echo $ping_url; ?>'); return false;" title="Ping iTunes in New Window">Ping iTunes in New Window</a></p>
666
+ <?php } ?>
667
  </td>
668
  </tr>
669
 
670
  </table>
671
  <?php if( $OpenSSLSupport == false ) { ?>
672
+ <div class="error powerpress-error">Ping iTunes requires OpenSSL in PHP. Please refer to your php.ini to enable the php_openssl module.</div>
673
  <?php } ?>
674
  <br />
675
 
709
  <p style="margin-top: 0;">
710
  Note: "On Page Link" is a link to "play on page", the player is not displayed until link is clicked.
711
  </p>
712
+ <p><input name="CheckSWF" type="checkbox" value="1" /> Verify flash player</p>
713
  </td>
714
  </tr>
715
 
720
  <td>
721
  <select name="General[podcast_link]">
722
  <?php
723
+ $linkoptions = array(1=>"Display", 2=>"Display with file size", 3=>"Display with file size and duration", 0=>"Disable");
724
 
725
  while( list($value,$desc) = each($linkoptions) )
726
  echo "\t<option value=\"$value\"". ($General['podcast_link']==$value?' selected':''). ">$desc</option>\n";
991
  </table>
992
  <p style="font-size: 85%; text-align: center;">
993
  <a href="http://www.blubrry.com/powerpress/" title="Blubrry Powerpress" target="_blank">Blubrry Powerpress</a> <?php echo POWERPRESS_VERSION; ?>
994
+ &#8212; <a href="http://help.blubrry.com/blubrry-powerpress/" target="_blank">Documentation</a>
995
  </p>
996
  <p class="submit">
997
  <input type="submit" name="Submit" value="<?php _e('Save Changes' ) ?>" />
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: Angelo Mandato, Blubrry.com
3
  Tags: podcast, podcasting, itunes, enclosure, zune, iphone, audio, video, rss2, feed, player, media, rss
4
  Requires at least: 2.5.0
5
- Tested up to: 2.6.3
6
- Stable tag: 0.4.2
7
 
8
  Add podcasting support to your blog.
9
 
@@ -28,6 +28,10 @@ For the latest information visit the website.
28
 
29
  http://www.blubrry.com/powerpress/
30
 
 
 
 
 
31
  == Frequently Asked Questions ==
32
 
33
  = Why doesn't Blubrry Powerpress support multiple enclosures? =
@@ -74,5 +78,11 @@ Fixed auto-play bug found in last update, only affected quicktime files with the
74
  0.4.2 released on 11/02/2008
75
  Fixed quicktime in-page player bug, fixed bug which caused itunes keywords and subtitle to be blank and incremented version number.
76
 
 
 
 
77
  == Feedback ==
78
  http://www.blubrry.com/powerpress/
 
 
 
2
  Contributors: Angelo Mandato, Blubrry.com
3
  Tags: podcast, podcasting, itunes, enclosure, zune, iphone, audio, video, rss2, feed, player, media, rss
4
  Requires at least: 2.5.0
5
+ Tested up to: 2.6.5
6
+ Stable tag: 0.5.0
7
 
8
  Add podcasting support to your blog.
9
 
28
 
29
  http://www.blubrry.com/powerpress/
30
 
31
+ Documentation available on the blubrry help site.
32
+
33
+ http://help.blubrry.com/blubrry-powerpress/
34
+
35
  == Frequently Asked Questions ==
36
 
37
  = Why doesn't Blubrry Powerpress support multiple enclosures? =
78
  0.4.2 released on 11/02/2008
79
  Fixed quicktime in-page player bug, fixed bug which caused itunes keywords and subtitle to be blank and incremented version number.
80
 
81
+ 0.5.0 released on 11/26/2008
82
+ Added options to report media duration and file size next to download links. Removed optional defines POWERPRESS _ PLUGIN _ PATH and POWERPRESS _ ITEM _ SUMMARY, defines no longer necessary. Added itunes:author and itunes:subtitle to header portion of podcast feeds and itunes:summary to post items. No longer removing quotes or extra spaces from itunes summary. Player auto-play bug fixed when quicktime files mixed with mp3s. Added new option to ping iTunes in a new browser window. Verify flash player check added, Wordpress auto plugin update will corrupt the flash player. This bug is fixed in Wordpress 2.7 beta 2 and newer. Media URL now displays a warning if the value contains characters which may cause problems.
83
+
84
  == Feedback ==
85
  http://www.blubrry.com/powerpress/
86
+
87
+ == Support ==
88
+ http://help.blubrry.com/blubrry-powerpress/