PowerPress Podcasting plugin by Blubrry - Version 0.6.1

Version Description

Download this release

Release Info

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

Code changes from version 0.6.0 to 0.6.1

Files changed (4) hide show
  1. player.js +50 -4
  2. powerpress.php +69 -47
  3. powerpressadmin.php +3 -3
  4. readme.txt +15 -5
player.js CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * jsMediaPlayer 1.1 for Blubrry Powerpress
3
  *
4
  * http://www.blubrry.com/powepress/
5
  *
@@ -8,6 +8,7 @@
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
@@ -158,7 +159,18 @@ function jsMediaPlayer(FlashSrc) {
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);
@@ -195,7 +207,7 @@ function jsMediaPlayer(FlashSrc) {
195
  // Get the media file and extension
196
  this.m_media_url = this.PlayNewWindow.arguments[0];
197
  var ext = this._getExt(this.m_media_url);
198
-
199
  // Calculate the window height
200
  height = this.m_height;
201
  if( ext == 'mp3' )
@@ -222,6 +234,7 @@ function jsMediaPlayer(FlashSrc) {
222
  }
223
  Html += '</head>';
224
  Html += '<body>';
 
225
  Html += '<div id="player" style="margin-top: 20px; margin-left: 10px;">';
226
  if( ext != 'mp3' && ext != 'flv' && ext != 'mp4' )
227
  {
@@ -250,7 +263,16 @@ function jsMediaPlayer(FlashSrc) {
250
  case 'wma':
251
  case 'wmv':
252
  case 'asf': {
253
- Html += this._getWinPlayer(true);
 
 
 
 
 
 
 
 
 
254
  }; break;
255
  case 'rm': {
256
  Html += this._getRealPlayer(true);
@@ -373,6 +395,30 @@ function jsMediaPlayer(FlashSrc) {
373
  return Html;
374
  }
375
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
376
  this._getQuickTime = function() {
377
 
378
  var contentType = 'video/mpeg';
1
  /**
2
+ * jsMediaPlayer 1.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.1 - 12/22/20008 - Minor change to support Windows Media in Firefox. Includes link to preferred Firefox Windows Media Player plugin.
12
  * 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.
13
  * version 1.0.3 - 11/02/2008 - Added option for playing quicktime files in an intermediate fashion with an image to click to play.
14
  * version 1.0.2 - 07/26/2008 - Fixed pop up player bug caused by v 1.0.1
159
  case 'wma':
160
  case 'wmv':
161
  case 'asf': {
162
+
163
+ if( navigator.userAgent.indexOf("Firefox") !=-1 && this.m_play_image && auto_play == false )
164
+ {
165
+ 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>';
166
+ this.m_player_div = false; // Let this player be used again on the page
167
+ return false;
168
+ }
169
+
170
+ if( navigator.userAgent.indexOf("Firefox") !=-1 ) // Firefox:
171
+ document.getElementById( this.m_player_div ).innerHTML = this._getWinPlayerFirefox(auto_play);
172
+ else
173
+ document.getElementById( this.m_player_div ).innerHTML = this._getWinPlayer(auto_play);
174
  }; break;
175
  case 'rm': {
176
  document.getElementById( this.m_player_div ).innerHTML = this._getRealPlayer(auto_play);
207
  // Get the media file and extension
208
  this.m_media_url = this.PlayNewWindow.arguments[0];
209
  var ext = this._getExt(this.m_media_url);
210
+
211
  // Calculate the window height
212
  height = this.m_height;
213
  if( ext == 'mp3' )
234
  }
235
  Html += '</head>';
236
  Html += '<body>';
237
+
238
  Html += '<div id="player" style="margin-top: 20px; margin-left: 10px;">';
239
  if( ext != 'mp3' && ext != 'flv' && ext != 'mp4' )
240
  {
263
  case 'wma':
264
  case 'wmv':
265
  case 'asf': {
266
+
267
+ if( navigator.userAgent.indexOf("Firefox") !=-1 ) // Firefox:
268
+ {
269
+ Html += '<style>body { font-family: Arial, Helvetica, Sans-Serif; font-size: 90%;}</style>';
270
+ Html += this._getWinPlayerFirefox(true);
271
+ }
272
+ else
273
+ {
274
+ Html += this._getWinPlayer(true);
275
+ }
276
  }; break;
277
  case 'rm': {
278
  Html += this._getRealPlayer(true);
395
  return Html;
396
  }
397
 
398
+ this._getWinPlayerFirefox = function() {
399
+ var auto_play = false;
400
+ if( this._getWinPlayerFirefox.arguments.length > 0 )
401
+ auto_play = this._getWinPlayerFirefox.arguments[0];
402
+
403
+ var Html = '';
404
+ Html += '<object id="winplayer" data="' + this.m_media_url +'" width="'+ this.m_width +'" height="'+ this.m_height +'" type="application/x-ms-wmp">\n';
405
+ Html += ' <param name="url" value="'+ this.m_media_url +'" />\n';
406
+ Html += ' <param name="AutoStart" value="'+ (auto_play?'true':'false') +'" />\n';
407
+ Html += ' <param name="AutoSize" value="true" />\n';
408
+ Html += ' <param name="AllowChangeDisplaySize" value="true" />\n';
409
+ Html += ' <param name="standby" value="Media is loading..." />\n';
410
+ Html += ' <param name="AnimationAtStart" value="true" />\n';
411
+ Html += ' <param name="scale" value="aspect" />\n';
412
+ Html += ' <param name="ShowControls" value="true" />\n';
413
+ Html += ' <param name="ShowCaptioning" value="false" />\n';
414
+ Html += ' <param name="ShowDisplay" value="false" />\n';
415
+ Html += ' <param name="ShowStatusBar" value="false" />\n';
416
+ Html += '</object>\n';
417
+ 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">';
418
+ Html += 'Windows Media Player plugin for Firefox</a></p>\n';
419
+ return Html;
420
+ }
421
+
422
  this._getQuickTime = function() {
423
 
424
  var contentType = 'video/mpeg';
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.6.0
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
 
10
  2008-12-17 - v0.6.0: Fixed bug with podcast feed in Wordpress 2.7, added defaults for file size and duration and added iTunes New Feed URL option.
11
  2008-12-14 - v0.5.2: Fixed bug with the feed channel itunes:summary being limited to 255 characters, the limit is now set to 4,000.
12
  2008-12-10 - v0.5.1: Added podcast to pages option (Thanks @Frumph), added code to make sure the itunes:subtitle, keywords and summary feed tags never exceed their size limits.
@@ -24,8 +25,9 @@ Change Log:
24
  2008-08-04 - v0.1.0: Tentative initial release of Blubrry Powerpress plugin.
25
 
26
  Contributors:
27
- Angelo Mandato, CIO RawVoice - Plugin founder and architect, mp3info class and javascript media player
28
- Pat McSweeny, Developer for RawVoice - powerpress.php and powperpressoptions.php
 
29
 
30
  Credits:
31
  getID3(), License: GPL 2.0+ by James Heinrich <info [at] getid3.org> http://www.getid3.org
@@ -34,7 +36,7 @@ Credits:
34
  flashembed(), License: MIT by Tero Piirainen (tipiirai [at] gmail.com)
35
  Note: code found at bottom of player.js
36
 
37
- Copyright 2008 RawVoice Inc. (http://www.rawvoice.com)
38
 
39
  License: Apache License version 2.0 (http://www.apache.org/licenses/)
40
 
@@ -42,7 +44,7 @@ License: Apache License version 2.0 (http://www.apache.org/licenses/)
42
  is interpreted as GPL version 3.0 for compatibility with Apache 2.0 license.
43
  */
44
 
45
- define('POWERPRESS_VERSION', '0.6.0' );
46
 
47
  // Display Powerpress player only for previously created Podpress episodes.
48
  // define('POWERPRESS_USE_PLAYER_FOR_PODPRESS_EPISODES', true);
@@ -64,6 +66,19 @@ function powerpress_content($content)
64
 
65
  if( is_feed() )
66
  return $content; // We don't want to do anything to the feed
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
  // Powerpress settings:
69
  $Powerpress = get_option('powerpress_general');
@@ -126,12 +141,12 @@ function powerpress_content($content)
126
  switch( $Powerpress['player_function'] )
127
  {
128
  case 1: { // On page and new window
129
- $player_links .= "<a href=\"$EnclosureURL\" title=\"Play in new window\" onclick=\"return powerpress_play_window(this.href);\">Play in new window</a>".PHP_EOL;
130
  }; break;
131
  case 2: { // Play in page only
132
  }; break;
133
  case 3: { //Play in new window only
134
- $player_links .= "<a href=\"$EnclosureURL\" title=\"Play in new window\" onclick=\"return powerpress_play_window(this.href);\">Play in new window</a>".PHP_EOL;
135
  }; break;
136
  case 4: { // Play on page link only
137
  $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;
@@ -139,7 +154,7 @@ function powerpress_content($content)
139
  case 5: { //Play on page link and new window
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
  $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
142
- $player_links .= "<a href=\"$EnclosureURL\" title=\"Play in new window\" onclick=\"return powerpress_play_window(this.href);\">Play in new window</a>".PHP_EOL;
143
  }; break;
144
  }//end switch
145
 
@@ -195,7 +210,9 @@ function powerpress_content($content)
195
  }
196
  }//end function
197
 
 
198
  add_action('the_content', 'powerpress_content');
 
199
 
200
  function powerpress_header()
201
  {
@@ -279,9 +296,9 @@ function powerpress_rss2_head()
279
  $powerpress_feed = true; // Okay, lets continue...
280
  if( $Feed )
281
  {
282
- while( list($key,$value) = each($Feed) )
283
- $Feed[$key] = htmlentities($value, ENT_NOQUOTES, 'UTF-8');
284
- reset($Feed);
285
  }
286
 
287
  echo '<!-- podcast_generator="Blubrry Powerpress/'. POWERPRESS_VERSION .'" -->'.PHP_EOL;
@@ -301,48 +318,60 @@ function powerpress_rss2_head()
301
  $explicit = array("no", "yes", "clean");
302
 
303
  $powerpress_itunes_explicit = $explicit[$Feed['itunes_explicit']];
304
- $powerpress_itunes_talent_name = $Feed['itunes_talent_name'];
305
- if( $powerpress_itunes_talent_name )
306
- echo "\t\t<itunes:author>" . $powerpress_itunes_talent_name . '</itunes:author>'.PHP_EOL;
 
 
307
 
308
  if( $powerpress_itunes_explicit )
309
  echo "\t".'<itunes:explicit>' . $powerpress_itunes_explicit . '</itunes:explicit>'.PHP_EOL;
 
310
  if( $Feed['itunes_image'] )
311
  {
312
- echo "\t".'<itunes:image href="' . $Feed['itunes_image'] . '" />'.PHP_EOL;
313
  }
314
  else
315
  {
316
  echo "\t".'<itunes:image href="' . powerpress_get_root_url() . 'itunes_default.jpg" />'.PHP_EOL;
317
  }
318
 
319
- if( $Feed['itunes_talent_name'] && $Feed['email'] )
320
  {
321
  echo "\t".'<itunes:owner>'.PHP_EOL;
322
- echo "\t\t".'<itunes:name>' . $Feed['itunes_talent_name'] . '</itunes:name>'.PHP_EOL;
323
- echo "\t\t".'<itunes:email>' . $Feed['email'] . '</itunes:email>'.PHP_EOL;
324
  echo "\t".'</itunes:owner>'.PHP_EOL;
 
325
  }
 
326
  if( $Feed['copyright'] )
327
- echo "\t".'<copyright>'. str_replace( array('&copy;', '(c)', '(C)'), '&#xA9;', htmlentities($Feed['copyright'], ENT_NOQUOTES, 'UTF-8')) . '</copyright>'.PHP_EOL;
 
 
 
 
 
328
  if( trim($Feed['itunes_subtitle']) )
329
  echo "\t".'<itunes:subtitle>' . powerpress_format_itunes_value($Feed['itunes_subtitle']) . '</itunes:subtitle>'.PHP_EOL;
 
 
 
330
  if( trim($Feed['itunes_keywords']) )
331
  echo "\t".'<itunes:keywords>' . powerpress_format_itunes_value($Feed['itunes_keywords']) . '</itunes:keywords>'.PHP_EOL;
332
- if( $Feed['itunes_talent_name'] && $Feed['email'] )
333
- echo "\t".'<managingEditor>'. $Feed['email'] .' ('. htmlentities($Feed['itunes_talent_name'], ENT_NOQUOTES, 'UTF-8') .')</managingEditor>'.PHP_EOL;
334
  if( $Feed['rss2_image'] )
335
  {
336
  echo"\t". '<image>' .PHP_EOL;
337
- echo "\t\t".'<title>' . htmlentities(get_bloginfo('name'), ENT_NOQUOTES, 'UTF-8') . '</title>'.PHP_EOL;
338
- echo "\t\t".'<url>' . $Feed['rss2_image'] . '</url>'.PHP_EOL;
339
  echo "\t\t".'<link>'. get_bloginfo('url') . '</link>' . PHP_EOL;
340
  echo "\t".'</image>' . PHP_EOL;
341
  }
342
  else // Use the default image
343
  {
344
  echo"\t". '<image>' .PHP_EOL;
345
- echo "\t\t".'<title>' . htmlentities(get_bloginfo('name'), ENT_NOQUOTES, 'UTF-8') . '</title>'.PHP_EOL;
346
  echo "\t\t".'<url>' . powerpress_get_root_url() . 'rss_default.jpg</url>'.PHP_EOL;
347
  echo "\t\t".'<link>'. get_bloginfo('url') . '</link>' . PHP_EOL;
348
  echo "\t".'</image>' . PHP_EOL;
@@ -363,13 +392,13 @@ function powerpress_rss2_head()
363
  $SubCatDesc = $Categories[$Cat1.'-'.$SubCat1];
364
  if( $Cat1 != $Cat2 && $SubCat1 == '00' )
365
  {
366
- echo "\t".'<itunes:category text="'. htmlspecialchars($CatDesc) .'" />'.PHP_EOL;
367
  }
368
  else
369
  {
370
- echo "\t".'<itunes:category text="'. htmlspecialchars($CatDesc) .'">'.PHP_EOL;
371
  if( $SubCat1 != '00' )
372
- echo "\t\t".'<itunes:category text="'. htmlspecialchars($SubCatDesc) .'" />'.PHP_EOL;
373
 
374
  // End this category set
375
  if( $Cat1 != $Cat2 )
@@ -386,7 +415,7 @@ function powerpress_rss2_head()
386
  if( $Cat1 == $Cat2 )
387
  {
388
  if( $SubCat2 != '00' )
389
- echo "\t\t".'<itunes:category text="'. htmlspecialchars($SubCatDesc) .'" />'.PHP_EOL;
390
 
391
  // End this category set
392
  if( $Cat2 != $Cat3 )
@@ -396,14 +425,14 @@ function powerpress_rss2_head()
396
  {
397
  if( $Cat2 != $Cat3 && $SubCat2 == '00' )
398
  {
399
- echo "\t".'<itunes:category text="'. htmlspecialchars($CatDesc) .'" />'.PHP_EOL;
400
  }
401
  else // We have nested values
402
  {
403
  if( $Cat1 != $Cat2 ) // Start a new category set
404
- echo "\t".'<itunes:category text="'. htmlspecialchars($CatDesc) .'">'.PHP_EOL;
405
  if( $SubCat2 != '00' )
406
- echo "\t\t".'<itunes:category text="'. htmlspecialchars($SubCatDesc) .'" />'.PHP_EOL;
407
  if( $Cat2 != $Cat3 ) // End this category set
408
  echo "\t".'</itunes:category>'.PHP_EOL;
409
  }
@@ -419,7 +448,7 @@ function powerpress_rss2_head()
419
  if( $Cat2 == $Cat3 )
420
  {
421
  if( $SubCat3 != '00' )
422
- echo "\t\t".'<itunes:category text="'. htmlspecialchars($SubCatDesc) .'" />'.PHP_EOL;
423
 
424
  // End this category set
425
  echo "\t".'</itunes:category>'.PHP_EOL;
@@ -428,14 +457,14 @@ function powerpress_rss2_head()
428
  {
429
  if( $Cat2 != $Cat3 && $SubCat3 == '00' )
430
  {
431
- echo "\t".'<itunes:category text="'. htmlspecialchars($CatDesc) .'" />'.PHP_EOL;
432
  }
433
  else // We have nested values
434
  {
435
  if( $Cat2 != $Cat3 ) // Start a new category set
436
- echo "\t".'<itunes:category text="'. htmlspecialchars($CatDesc) .'">'.PHP_EOL;
437
  if( $SubCat3 != '00' )
438
- echo "\t\t".'<itunes:category text="'. htmlspecialchars($SubCatDesc) .'" />'.PHP_EOL;
439
  // End this category set
440
  echo "\t".'</itunes:category>'.PHP_EOL;
441
  }
@@ -522,7 +551,7 @@ function powerpress_rss2_item()
522
  echo "\t\t<itunes:summary>". powerpress_format_itunes_value(powerpress_smart_trim($content_no_html, 4000), 4000) .'</itunes:summary>'.PHP_EOL;
523
 
524
  if( $powerpress_itunes_talent_name )
525
- echo "\t\t<itunes:author>" . $powerpress_itunes_talent_name . '</itunes:author>'.PHP_EOL;
526
 
527
  if( $powerpress_itunes_explicit )
528
  echo "\t\t<itunes:explicit>" . $powerpress_itunes_explicit . '</itunes:explicit>'.PHP_EOL;
@@ -716,18 +745,11 @@ function powerpress_get_root_url()
716
  return WP_PLUGIN_URL . '/'. $powerpress_dirname .'/';
717
  }
718
 
719
- function powerpress_format_itunes_value($value, $char_limit = 255)
720
  {
721
- $value = htmlentities($value, ENT_NOQUOTES, 'UTF-8');
722
- //$value = str_replace('&quot;', '', $value);
723
- $value = str_replace('&amp;', '', $value);
724
- $value = str_replace('&lt;', '', $value);
725
- $value = str_replace('&gt;', '', $value);
726
- //$value = str_replace('&nbsp;', '', $value);
727
- $value = str_replace('&', '', $value); // Last attempt to fix, just remove the &
728
  if( strlen($value) > $char_limit )
729
- return substr($value, 0, $char_limit);
730
- return $value;
731
  }
732
 
733
  function powerpress_smart_trim($value, $char_limit = 250, $remove_new_lines = false)
@@ -755,7 +777,7 @@ function powerpress_smart_trim($value, $char_limit = 250, $remove_new_lines = fa
755
  }
756
 
757
  if( $remove_new_lines )
758
- $return = str_replace( array("\n", "\r", "\t"), array(' ', '', ' '), $return );
759
  return $return;
760
  }
761
 
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.6.1
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
10
+ 2009-01-20 - v0.6.1: Player now handles Windows Media (wmv) in Firefox, offering link to preferred Firefox plugin, now using the wp_specialchars() function for adding entities to feed values, fix problem with themes using excerpts not displaying the player correctly (Thanks @wayofthegeek for your help), and a number of other syntactical changes.
11
  2008-12-17 - v0.6.0: Fixed bug with podcast feed in Wordpress 2.7, added defaults for file size and duration and added iTunes New Feed URL option.
12
  2008-12-14 - v0.5.2: Fixed bug with the feed channel itunes:summary being limited to 255 characters, the limit is now set to 4,000.
13
  2008-12-10 - v0.5.1: Added podcast to pages option (Thanks @Frumph), added code to make sure the itunes:subtitle, keywords and summary feed tags never exceed their size limits.
25
  2008-08-04 - v0.1.0: Tentative initial release of Blubrry Powerpress plugin.
26
 
27
  Contributors:
28
+ Angelo Mandato, CIO RawVoice - Plugin founder, architect and lead developer
29
+ Pat McSweeny, Developer for RawVoice - Developed initial version (v0.1.0) of plugin
30
+ Jerry Stephens, Way of the Geek (http://wayofthegeek.org/) - Contributed initial code fix for excerpt bug resolved in v0.6.1
31
 
32
  Credits:
33
  getID3(), License: GPL 2.0+ by James Heinrich <info [at] getid3.org> http://www.getid3.org
36
  flashembed(), License: MIT by Tero Piirainen (tipiirai [at] gmail.com)
37
  Note: code found at bottom of player.js
38
 
39
+ Copyright 2008-2009 RawVoice Inc. (http://www.rawvoice.com)
40
 
41
  License: Apache License version 2.0 (http://www.apache.org/licenses/)
42
 
44
  is interpreted as GPL version 3.0 for compatibility with Apache 2.0 license.
45
  */
46
 
47
+ define('POWERPRESS_VERSION', '0.6.1' );
48
 
49
  // Display Powerpress player only for previously created Podpress episodes.
50
  // define('POWERPRESS_USE_PLAYER_FOR_PODPRESS_EPISODES', true);
66
 
67
  if( is_feed() )
68
  return $content; // We don't want to do anything to the feed
69
+
70
+ // Problem: If the_excerpt is used instead of the_content, both the_exerpt and the_content will be called here.
71
+ // Important to note, get_the_excerpt will be called before the_content is called, so we add a simple little hack
72
+ global $g_powerpress_excerpt_post_id;
73
+ if( current_filter() == 'get_the_excerpt' )
74
+ {
75
+ $g_powerpress_excerpt_post_id = $post->ID;
76
+ return $content; // We don't want to do anything to this content yet...
77
+ }
78
+ else if( current_filter() == 'the_content' && $g_powerpress_excerpt_post_id == $post->ID )
79
+ {
80
+ return $content; // We don't want to do anything to this excerpt content in this call either...
81
+ }
82
 
83
  // Powerpress settings:
84
  $Powerpress = get_option('powerpress_general');
141
  switch( $Powerpress['player_function'] )
142
  {
143
  case 1: { // On page and new window
144
+ $player_links .= "<a href=\"$EnclosureURL\" target=\"_blank\" title=\"Play in new window\" onclick=\"return powerpress_play_window(this.href);\">Play in new window</a>".PHP_EOL;
145
  }; break;
146
  case 2: { // Play in page only
147
  }; break;
148
  case 3: { //Play in new window only
149
+ $player_links .= "<a href=\"$EnclosureURL\" target=\"_blank\" title=\"Play in new window\" onclick=\"return powerpress_play_window(this.href);\">Play in new window</a>".PHP_EOL;
150
  }; break;
151
  case 4: { // Play on page link only
152
  $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;
154
  case 5: { //Play on page link and new window
155
  $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;
156
  $player_links .= ' '. POWERPRESS_LINK_SEPARATOR .' ';
157
+ $player_links .= "<a href=\"$EnclosureURL\" target=\"_blank\" title=\"Play in new window\" onclick=\"return powerpress_play_window(this.href);\">Play in new window</a>".PHP_EOL;
158
  }; break;
159
  }//end switch
160
 
210
  }
211
  }//end function
212
 
213
+ add_action('get_the_excerpt', 'powerpress_content', 1);
214
  add_action('the_content', 'powerpress_content');
215
+ add_action('the_excerpt', 'powerpress_content');
216
 
217
  function powerpress_header()
218
  {
296
  $powerpress_feed = true; // Okay, lets continue...
297
  if( $Feed )
298
  {
299
+ // while( list($key,$value) = each($Feed) )
300
+ // $Feed[$key] = htmlentities($value, ENT_NOQUOTES, 'UTF-8');
301
+ // reset($Feed);
302
  }
303
 
304
  echo '<!-- podcast_generator="Blubrry Powerpress/'. POWERPRESS_VERSION .'" -->'.PHP_EOL;
318
  $explicit = array("no", "yes", "clean");
319
 
320
  $powerpress_itunes_explicit = $explicit[$Feed['itunes_explicit']];
321
+ $powerpress_itunes_talent_name = get_bloginfo('name');
322
+ if( $Feed['itunes_talent_name'] )
323
+ $powerpress_itunes_talent_name = $Feed['itunes_talent_name'];
324
+
325
+ echo "\t\t<itunes:author>" . wp_specialchars($powerpress_itunes_talent_name) . '</itunes:author>'.PHP_EOL;
326
 
327
  if( $powerpress_itunes_explicit )
328
  echo "\t".'<itunes:explicit>' . $powerpress_itunes_explicit . '</itunes:explicit>'.PHP_EOL;
329
+
330
  if( $Feed['itunes_image'] )
331
  {
332
+ echo "\t".'<itunes:image href="' . wp_specialchars($Feed['itunes_image'], 'double') . '" />'.PHP_EOL;
333
  }
334
  else
335
  {
336
  echo "\t".'<itunes:image href="' . powerpress_get_root_url() . 'itunes_default.jpg" />'.PHP_EOL;
337
  }
338
 
339
+ if( $Feed['email'] )
340
  {
341
  echo "\t".'<itunes:owner>'.PHP_EOL;
342
+ echo "\t\t".'<itunes:name>' . wp_specialchars($powerpress_itunes_talent_name) . '</itunes:name>'.PHP_EOL;
343
+ echo "\t\t".'<itunes:email>' . wp_specialchars($Feed['email']) . '</itunes:email>'.PHP_EOL;
344
  echo "\t".'</itunes:owner>'.PHP_EOL;
345
+ echo "\t".'<managingEditor>'. wp_specialchars($Feed['email'] .' ('. $powerpress_itunes_talent_name .')') .'</managingEditor>'.PHP_EOL;
346
  }
347
+
348
  if( $Feed['copyright'] )
349
+ {
350
+ // In case the user entered the copyright html version or the copyright UTF-8 or ASCII symbol or just (c)
351
+ $Feed['copyright'] = str_replace(array('&copy;', '(c)', '(C)', chr(194) . chr(169), chr(169) ), '&#xA9;', $Feed['copyright']);
352
+ echo "\t".'<copyright>'. wp_specialchars($Feed['copyright']) . '</copyright>'.PHP_EOL;
353
+ }
354
+
355
  if( trim($Feed['itunes_subtitle']) )
356
  echo "\t".'<itunes:subtitle>' . powerpress_format_itunes_value($Feed['itunes_subtitle']) . '</itunes:subtitle>'.PHP_EOL;
357
+ else
358
+ echo "\t".'<itunes:subtitle>'. powerpress_format_itunes_value( get_bloginfo('description') ) .'</itunes:subtitle>'.PHP_EOL;
359
+
360
  if( trim($Feed['itunes_keywords']) )
361
  echo "\t".'<itunes:keywords>' . powerpress_format_itunes_value($Feed['itunes_keywords']) . '</itunes:keywords>'.PHP_EOL;
362
+
 
363
  if( $Feed['rss2_image'] )
364
  {
365
  echo"\t". '<image>' .PHP_EOL;
366
+ echo "\t\t".'<title>' . wp_specialchars(get_bloginfo('name')) . '</title>'.PHP_EOL;
367
+ echo "\t\t".'<url>' . wp_specialchars($Feed['rss2_image']) . '</url>'.PHP_EOL;
368
  echo "\t\t".'<link>'. get_bloginfo('url') . '</link>' . PHP_EOL;
369
  echo "\t".'</image>' . PHP_EOL;
370
  }
371
  else // Use the default image
372
  {
373
  echo"\t". '<image>' .PHP_EOL;
374
+ echo "\t\t".'<title>' . wp_specialchars(get_bloginfo('name')) . '</title>'.PHP_EOL;
375
  echo "\t\t".'<url>' . powerpress_get_root_url() . 'rss_default.jpg</url>'.PHP_EOL;
376
  echo "\t\t".'<link>'. get_bloginfo('url') . '</link>' . PHP_EOL;
377
  echo "\t".'</image>' . PHP_EOL;
392
  $SubCatDesc = $Categories[$Cat1.'-'.$SubCat1];
393
  if( $Cat1 != $Cat2 && $SubCat1 == '00' )
394
  {
395
+ echo "\t".'<itunes:category text="'. wp_specialchars($CatDesc) .'" />'.PHP_EOL;
396
  }
397
  else
398
  {
399
+ echo "\t".'<itunes:category text="'. wp_specialchars($CatDesc) .'">'.PHP_EOL;
400
  if( $SubCat1 != '00' )
401
+ echo "\t\t".'<itunes:category text="'. wp_specialchars($SubCatDesc) .'" />'.PHP_EOL;
402
 
403
  // End this category set
404
  if( $Cat1 != $Cat2 )
415
  if( $Cat1 == $Cat2 )
416
  {
417
  if( $SubCat2 != '00' )
418
+ echo "\t\t".'<itunes:category text="'. wp_specialchars($SubCatDesc) .'" />'.PHP_EOL;
419
 
420
  // End this category set
421
  if( $Cat2 != $Cat3 )
425
  {
426
  if( $Cat2 != $Cat3 && $SubCat2 == '00' )
427
  {
428
+ echo "\t".'<itunes:category text="'. wp_specialchars($CatDesc) .'" />'.PHP_EOL;
429
  }
430
  else // We have nested values
431
  {
432
  if( $Cat1 != $Cat2 ) // Start a new category set
433
+ echo "\t".'<itunes:category text="'. wp_specialchars($CatDesc) .'">'.PHP_EOL;
434
  if( $SubCat2 != '00' )
435
+ echo "\t\t".'<itunes:category text="'. wp_specialchars($SubCatDesc) .'" />'.PHP_EOL;
436
  if( $Cat2 != $Cat3 ) // End this category set
437
  echo "\t".'</itunes:category>'.PHP_EOL;
438
  }
448
  if( $Cat2 == $Cat3 )
449
  {
450
  if( $SubCat3 != '00' )
451
+ echo "\t\t".'<itunes:category text="'. wp_specialchars($SubCatDesc) .'" />'.PHP_EOL;
452
 
453
  // End this category set
454
  echo "\t".'</itunes:category>'.PHP_EOL;
457
  {
458
  if( $Cat2 != $Cat3 && $SubCat3 == '00' )
459
  {
460
+ echo "\t".'<itunes:category text="'. wp_specialchars($CatDesc) .'" />'.PHP_EOL;
461
  }
462
  else // We have nested values
463
  {
464
  if( $Cat2 != $Cat3 ) // Start a new category set
465
+ echo "\t".'<itunes:category text="'. wp_specialchars($CatDesc) .'">'.PHP_EOL;
466
  if( $SubCat3 != '00' )
467
+ echo "\t\t".'<itunes:category text="'. wp_specialchars($SubCatDesc) .'" />'.PHP_EOL;
468
  // End this category set
469
  echo "\t".'</itunes:category>'.PHP_EOL;
470
  }
551
  echo "\t\t<itunes:summary>". powerpress_format_itunes_value(powerpress_smart_trim($content_no_html, 4000), 4000) .'</itunes:summary>'.PHP_EOL;
552
 
553
  if( $powerpress_itunes_talent_name )
554
+ echo "\t\t<itunes:author>" . wp_specialchars($powerpress_itunes_talent_name) . '</itunes:author>'.PHP_EOL;
555
 
556
  if( $powerpress_itunes_explicit )
557
  echo "\t\t<itunes:explicit>" . $powerpress_itunes_explicit . '</itunes:explicit>'.PHP_EOL;
745
  return WP_PLUGIN_URL . '/'. $powerpress_dirname .'/';
746
  }
747
 
748
+ function powerpress_format_itunes_value($value, $char_limit = 255, $specialchars = true)
749
  {
 
 
 
 
 
 
 
750
  if( strlen($value) > $char_limit )
751
+ return wp_specialchars(substr($value, 0, $char_limit));
752
+ return wp_specialchars($value);
753
  }
754
 
755
  function powerpress_smart_trim($value, $char_limit = 250, $remove_new_lines = false)
777
  }
778
 
779
  if( $remove_new_lines )
780
+ $return = str_replace( array("\r\n\r\n", "\n", "\r", "\t"), array(' - ',' ', '', ' '), $return );
781
  return $return;
782
  }
783
 
powerpressadmin.php CHANGED
@@ -1018,7 +1018,7 @@ while( list($value,$desc) = each($explicit) )
1018
  <input type="text" id="itunes_image" name="Feed[itunes_image]" style="width: 60%;" value="<?php echo $FeedSettings['itunes_image']; ?>" maxlength="250" />
1019
  <a href="#" onclick="javascript: window.open( document.getElementById('itunes_image').value ); return false;">preview</a>
1020
 
1021
- <p>Put the URL to the iTunes image above. e.g. http://mysite.com/images/itunes.jpg<br /><br />iTunes prefers square .jpg or .png images that are at 600 x 600 pixels (prevously 300 x 300), which is different than what is specified for the standard RSS image.</p>
1022
 
1023
  <?php if( $SupportUploads ) { ?>
1024
  <p><input name="itunes_image_checkbox" type="checkbox" onchange="powerpress_show_field('itunes_image_upload', this.checked)" value="1" /> Upload new image: </p>
@@ -1037,7 +1037,7 @@ while( list($value,$desc) = each($explicit) )
1037
  <input type="text" id="rss2_image" name="Feed[rss2_image]" style="width: 60%;" value="<?php echo $FeedSettings['rss2_image']; ?>" maxlength="250" />
1038
  <a href="#" onclick="javascript: window.open( document.getElementById('rss2_image').value ); return false;">preview</a>
1039
 
1040
- <p>Put the URL to the RSS image above. e.g. http://mysite.com/images/rss.jpg</p>
1041
  <p>RSS image should be at least 88 and at most 144 pixels wide and at least 31 and at most 400 pixels high in either .gif, .jpg and .png format. A square 144 x 144 pixel image is recommended.</p>
1042
 
1043
  <?php if( $SupportUploads ) { ?>
@@ -1078,7 +1078,7 @@ while( list($value,$desc) = each($explicit) )
1078
  </table>
1079
  <p style="font-size: 85%; text-align: center;">
1080
  <a href="http://www.blubrry.com/powerpress/" title="Blubrry Powerpress" target="_blank">Blubrry Powerpress</a> <?php echo POWERPRESS_VERSION; ?>
1081
- &#8212; <a href="http://help.blubrry.com/blubrry-powerpress/" target="_blank" title="Blubrry Powerpress Documentation">Documentation</a> | <a href="http://twitter.com/blubrry" target="_blank" title="Blubrry on Twitter">Twitter</a>
1082
  </p>
1083
  <p class="submit">
1084
  <input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes' ) ?>" />
1018
  <input type="text" id="itunes_image" name="Feed[itunes_image]" style="width: 60%;" value="<?php echo $FeedSettings['itunes_image']; ?>" maxlength="250" />
1019
  <a href="#" onclick="javascript: window.open( document.getElementById('itunes_image').value ); return false;">preview</a>
1020
 
1021
+ <p>Place the URL to the iTunes image above. e.g. http://mysite.com/images/itunes.jpg<br /><br />iTunes prefers square .jpg or .png images that are at 600 x 600 pixels (prevously 300 x 300), which is different than what is specified for the standard RSS image.</p>
1022
 
1023
  <?php if( $SupportUploads ) { ?>
1024
  <p><input name="itunes_image_checkbox" type="checkbox" onchange="powerpress_show_field('itunes_image_upload', this.checked)" value="1" /> Upload new image: </p>
1037
  <input type="text" id="rss2_image" name="Feed[rss2_image]" style="width: 60%;" value="<?php echo $FeedSettings['rss2_image']; ?>" maxlength="250" />
1038
  <a href="#" onclick="javascript: window.open( document.getElementById('rss2_image').value ); return false;">preview</a>
1039
 
1040
+ <p>Place the URL to the RSS image above. e.g. http://mysite.com/images/rss.jpg</p>
1041
  <p>RSS image should be at least 88 and at most 144 pixels wide and at least 31 and at most 400 pixels high in either .gif, .jpg and .png format. A square 144 x 144 pixel image is recommended.</p>
1042
 
1043
  <?php if( $SupportUploads ) { ?>
1078
  </table>
1079
  <p style="font-size: 85%; text-align: center;">
1080
  <a href="http://www.blubrry.com/powerpress/" title="Blubrry Powerpress" target="_blank">Blubrry Powerpress</a> <?php echo POWERPRESS_VERSION; ?>
1081
+ &#8212; <a href="http://help.blubrry.com/blubrry-powerpress/" target="_blank" title="Blubrry Powerpress Documentation">Documentation</a> | <a href="http://twitter.com/blubrry" target="_blank" title="Follow Blubrry on Twitter">Follow Blubrry on Twitter</a>
1082
  </p>
1083
  <p class="submit">
1084
  <input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes' ) ?>" />
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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.7
6
- Stable tag: 0.6.0
7
 
8
  Add podcasting support to your blog.
9
 
@@ -35,7 +35,7 @@ http://help.blubrry.com/blubrry-powerpress/
35
  == Frequently Asked Questions ==
36
 
37
  = Why doesn't Blubrry Powerpress support multiple enclosures? =
38
- Blubrry Powerpress does not support multiple enclosures in one blog post. This is because each podcatcher handles multiple enclosures differently. iTunes will download the first enclosure that it sees in the feed ignoring the rest. Other podcatchers and podcasting directories either pick up the first enclosure or the last in each post item. This inconsistancy and combined with the fact that [Dave Winer does not recommend multiple enclosures](http://www.reallysimplesyndication.com/2004/12/21) is why the Blubrry Powerpress does not support them.
39
 
40
  = Why doesn't Blubrry Powerpress include media statistics? =
41
  Blubrry Powerpress does not include media statistics. This is not because Blubrry has its own statistics service, although that's a good reason by itself. Maintaining and calculating statistics is a resource and server intensive task that would add bloat to an otherwise lightweight Wordpress podcasting plugin. We recommend you use your media hosting's statistics and you're more than welcome to use the [Blubrry Statistics service](http://www.blubrry.com/podcast_statistics/) as well.
@@ -90,11 +90,21 @@ Fixed bug with the feed channel itunes:summary being limited to 255 characters,
90
  0.6.0 released on 12/17/2008
91
  Fixed bug with podcast feed in Wordpress 2.7, added defaults for file size and duration, and added iTunes New Feed URL option.
92
 
 
 
 
 
 
 
 
 
 
 
93
  == Feedback ==
94
- http://www.blubrry.com/powerpress/
95
 
96
  == Support ==
97
- http://help.blubrry.com/blubrry-powerpress/
98
 
99
  == Twitter ==
100
- http://twitter.com/blubrry
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.7
6
+ Stable tag: 0.6.1
7
 
8
  Add podcasting support to your blog.
9
 
35
  == Frequently Asked Questions ==
36
 
37
  = Why doesn't Blubrry Powerpress support multiple enclosures? =
38
+ Blubrry Powerpress does not support multiple enclosures in one blog post. This is because each podcatching application handles multiple enclosures differently. iTunes will download the first enclosure that it sees in the feed ignoring the rest. Other podcatchers and podcasting directories either pick up the first enclosure or the last in each post item. This inconsistency combined with the fact that [Dave Winer does not recommend multiple enclosures](http://www.reallysimplesyndication.com/2004/12/21) and the [FeedValidator.org recommendation against it](http://www.feedvalidator.org/docs/warning/DuplicateEnclosure.html) is why the Blubrry Powerpress does not support them.
39
 
40
  = Why doesn't Blubrry Powerpress include media statistics? =
41
  Blubrry Powerpress does not include media statistics. This is not because Blubrry has its own statistics service, although that's a good reason by itself. Maintaining and calculating statistics is a resource and server intensive task that would add bloat to an otherwise lightweight Wordpress podcasting plugin. We recommend you use your media hosting's statistics and you're more than welcome to use the [Blubrry Statistics service](http://www.blubrry.com/podcast_statistics/) as well.
90
  0.6.0 released on 12/17/2008
91
  Fixed bug with podcast feed in Wordpress 2.7, added defaults for file size and duration, and added iTunes New Feed URL option.
92
 
93
+ 0.6.1 released on 01/20/2009
94
+ Player now handles Windows Media (wmv) in Firefox, offering link to preferred Firefox plugin, now using the wp_specialchars() function for adding entities to feed values, fix problem with themes using excerpts not displaying the player correctly (Thanks @wayofthegeek for your help), and a number of other syntactical changes.
95
+
96
+
97
+ == Contributors ==
98
+ Angelo Mandato, CIO RawVoice - Plugin founder, architect and lead developer
99
+ Pat McSweeny, Developer for RawVoice - Developed initial version (v0.1.0) of plugin
100
+ Jerry Stephens, Way of the Geek (http://wayofthegeek.org/) - Contributed initial code fix for excerpt bug resolved in v0.6.1
101
+
102
+
103
  == Feedback ==
104
+ http://www.blubrry.com/powerpress/
105
 
106
  == Support ==
107
+ http://help.blubrry.com/blubrry-powerpress/
108
 
109
  == Twitter ==
110
+ http://twitter.com/blubrry