PowerPress Podcasting plugin by Blubrry - Version 0.2.1

Version Description

Download this release

Release Info

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

Code changes from version 0.2.0 to 0.2.1

Files changed (3) hide show
  1. powerpress.php +22 -8
  2. powerpressadmin.php +7 -3
  3. readme.txt +8 -2
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.2.0
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
 
10
  2008-08-05 - v0.2.0: First beta release of Blubrry Powerpress plugin.
11
  2008-08-05 - v0.1.2: Fixed minor bugs, trimming empty hour values in duration.
12
  2008-08-04 - v0.1.1: Fixed minor bugs, PHP_EOL define, check if function exists for older versions of wordpress and more.
@@ -31,7 +32,9 @@ License: Apache License version 2.0 (http://www.apache.org/licenses/)
31
  is interpreted as GPL version 3.0 for compatibility with Apache 2.0 license.
32
  */
33
 
34
- define('POWERPRESS_VERSION', '0.1.1' );
 
 
35
 
36
  // Define variables, advanced users could define these in their own wp-config.php so lets not try to re-define
37
  if( !defined('POWERPRESS_PLUGIN_PATH') )
@@ -66,7 +69,7 @@ function powerpress_content($content)
66
  if( !$EnclosureURL )
67
  return $content;
68
  if( strpos($EnclosureURL, 'http://' ) !== 0 )
69
- $EnclosureURL = $Powerpress['default_url'] . $EnclosureURL;
70
  }
71
  }
72
  else
@@ -189,7 +192,7 @@ function powerpress_rss2_head()
189
  return; // This is definitely not our kind of feed
190
 
191
  $GeneralSettings = get_option('powerpress_general');
192
- $powerpress_default_url = $GeneralSettings['default_url'];
193
  $powerpress_process_podpress = $GeneralSettings['process_podpress'];
194
 
195
  $Feed = get_option('powerpress_feed');
@@ -436,9 +439,18 @@ function powerpress_rss2_item()
436
  echo "\t\t<itunes:keywords>" . implode(",", $tags) . '</itunes:keywords>'.PHP_EOL;
437
  }
438
 
439
- $content_no_html = strip_tags($post->post_content);
 
 
 
440
 
441
- echo "\t\t<itunes:subtitle>". powerpress_smart_trim($content_no_html, 250, true) .'</itunes:subtitle>'.PHP_EOL;
 
 
 
 
 
 
442
  if( defined('POWERPRESS_ITEM_SUMMARY') )
443
  echo "\t\t<itunes:summary>". powerpress_smart_trim($content_no_html, 4000) .'</itunes:summary>'.PHP_EOL;
444
  if( $powerpress_itunes_talent_name )
@@ -611,10 +623,11 @@ function powerpress_smart_trim($value, $char_limit = 250, $remove_new_lines = fa
611
  {
612
  if( strlen($value) > $char_limit )
613
  {
614
- $new_value = substr($new_value, 0, $char_limit);
615
  // Look back at most 50 characters...
616
  $eos = strrpos($new_value, '.');
617
  $eol = strrpos($new_value, "\n");
 
618
  // If the end of line is longer than the end of sentence and we're not loosing too much of our string...
619
  if( $eol > $eos && $eol > (strlen($new_value)-50) )
620
  $return = substr($new_value, 0, $eol);
@@ -622,7 +635,8 @@ function powerpress_smart_trim($value, $char_limit = 250, $remove_new_lines = fa
622
  else if( $eos > $eol && $eos > (strlen($new_value)-50) )
623
  $return = substr($new_value, 0, $eos);
624
  else // Otherwise, just add some dots to the end
625
- $return = substr($new_value, 0, -3).'...';
 
626
  }
627
  else
628
  {
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.2.1
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
10
+ 2008-09-17 - v0.2.1: Fixed itunes:subtitle bug, itunes:summary is now enabled by default, add ending trailing slash to media url if missing, and copy blubrry keyword from podpress fix.
11
  2008-08-05 - v0.2.0: First beta release of Blubrry Powerpress plugin.
12
  2008-08-05 - v0.1.2: Fixed minor bugs, trimming empty hour values in duration.
13
  2008-08-04 - v0.1.1: Fixed minor bugs, PHP_EOL define, check if function exists for older versions of wordpress and more.
32
  is interpreted as GPL version 3.0 for compatibility with Apache 2.0 license.
33
  */
34
 
35
+ define('POWERPRESS_VERSION', '0.2.1' );
36
+ //define('POWERPRESS_ITEM_SUMMARY', true); // Uncomment to include itunes:summary within feed items.
37
+ // Please place define above in your wp-config.php.
38
 
39
  // Define variables, advanced users could define these in their own wp-config.php so lets not try to re-define
40
  if( !defined('POWERPRESS_PLUGIN_PATH') )
69
  if( !$EnclosureURL )
70
  return $content;
71
  if( strpos($EnclosureURL, 'http://' ) !== 0 )
72
+ $EnclosureURL = rtrim($Powerpress['default_url'], '/') .'/'. $EnclosureURL;
73
  }
74
  }
75
  else
192
  return; // This is definitely not our kind of feed
193
 
194
  $GeneralSettings = get_option('powerpress_general');
195
+ $powerpress_default_url = rtrim($GeneralSettings['default_url'], '/') .'/';
196
  $powerpress_process_podpress = $GeneralSettings['process_podpress'];
197
 
198
  $Feed = get_option('powerpress_feed');
439
  echo "\t\t<itunes:keywords>" . implode(",", $tags) . '</itunes:keywords>'.PHP_EOL;
440
  }
441
 
442
+ // Strip and format the wordpress way, but don't apply any other filters for these itunes tags
443
+ $content_no_html = strip_shortcodes( $post->post_content );
444
+ $content_no_html = str_replace(']]>', ']]&gt;', $content_no_html);
445
+ $content_no_html = strip_tags($content_no_html);
446
 
447
+ $excerpt_no_html = strip_tags($post->post_excerpt);
448
+
449
+ if( $excerpt_no_html )
450
+ echo "\t\t<itunes:subtitle>". powerpress_smart_trim($excerpt_no_html, 250, true) .'</itunes:subtitle>'.PHP_EOL;
451
+ else
452
+ echo "\t\t<itunes:subtitle>". powerpress_smart_trim($content_no_html, 250, true) .'</itunes:subtitle>'.PHP_EOL;
453
+
454
  if( defined('POWERPRESS_ITEM_SUMMARY') )
455
  echo "\t\t<itunes:summary>". powerpress_smart_trim($content_no_html, 4000) .'</itunes:summary>'.PHP_EOL;
456
  if( $powerpress_itunes_talent_name )
623
  {
624
  if( strlen($value) > $char_limit )
625
  {
626
+ $new_value = substr($value, 0, $char_limit);
627
  // Look back at most 50 characters...
628
  $eos = strrpos($new_value, '.');
629
  $eol = strrpos($new_value, "\n");
630
+
631
  // If the end of line is longer than the end of sentence and we're not loosing too much of our string...
632
  if( $eol > $eos && $eol > (strlen($new_value)-50) )
633
  $return = substr($new_value, 0, $eol);
635
  else if( $eos > $eol && $eos > (strlen($new_value)-50) )
636
  $return = substr($new_value, 0, $eos);
637
  else // Otherwise, just add some dots to the end
638
+ $return = substr($new_value, 0, $char_limit).'...';
639
+ // $return = $new_value;
640
  }
641
  else
642
  {
powerpressadmin.php CHANGED
@@ -136,7 +136,7 @@ function powerpress_edit_post($post_ID) {
136
  if( strpos($MediaURL, 'http://') !== 0 ) // If the url entered does not start with a http://
137
  {
138
  $Settings = get_option('powerpress_general');
139
- $MediaURL = @$Settings['default_url'] . $MediaURL;
140
  }
141
 
142
  $FileSize = '';
@@ -438,7 +438,7 @@ function powerpress_admin_page()
438
  $General['default_url'] .= '/'; // Add the trailing slash, donno it's not there...
439
 
440
  // Insert the blubrry redirect
441
- if( isset($PodpressData['statBluBrryProgramKeyword']) )
442
  {
443
  $General['redirect1'] = 'http://media.blubrry.com/'.$PodpressData['statBluBrryProgramKeyword'].'/';
444
  }
@@ -673,7 +673,11 @@ while( list($value,$desc) = each($linkoptions) )
673
  </td>
674
  </tr>
675
  </table>
676
-
 
 
 
 
677
  <br />
678
  <h2><?php _e("Media Statistics"); ?></h2>
679
  <p style="margin-bottom: 0;">Configure 3rd party statistics services to measure your media. (optional)</p>
136
  if( strpos($MediaURL, 'http://') !== 0 ) // If the url entered does not start with a http://
137
  {
138
  $Settings = get_option('powerpress_general');
139
+ $MediaURL = rtrim(@$Settings['default_url'], '/') .'/'. $MediaURL;
140
  }
141
 
142
  $FileSize = '';
438
  $General['default_url'] .= '/'; // Add the trailing slash, donno it's not there...
439
 
440
  // Insert the blubrry redirect
441
+ if( isset($PodpressData['statBluBrryProgramKeyword']) && strlen($PodpressData['statBluBrryProgramKeyword']) > 2 )
442
  {
443
  $General['redirect1'] = 'http://media.blubrry.com/'.$PodpressData['statBluBrryProgramKeyword'].'/';
444
  }
673
  </td>
674
  </tr>
675
  </table>
676
+ <p>
677
+ Looking for a better Audio Player? Check out the <a href="http://wpaudioplayer.com" target="_blank" title="WP Audio Player 2.0">WP Audio Player 2.0</a>.
678
+ The WP Audio Player 2.0 options include
679
+ theme colors, initial volume, player width and more.
680
+ </p>
681
  <br />
682
  <h2><?php _e("Media Statistics"); ?></h2>
683
  <p style="margin-bottom: 0;">Configure 3rd party statistics services to measure your media. (optional)</p>
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.0
6
- Stable tag: 0.2
7
 
8
  Add podcasting support to your blog.
9
 
@@ -36,6 +36,9 @@ http://www.blubrry.com/powerpress/
36
  = Why doesn't Blubrry Powerpress include media statistics? =
37
  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.
38
 
 
 
 
39
  == Installation ==
40
  1. Copy the entire directory from the downloaded zip file into the /wp-content/plugins/ folder.
41
  2. Activate the "Blubrry Powerpress" plugin in the Plugin Management page.
@@ -50,5 +53,8 @@ http://www.blubrry.com/powerpress/
50
  0.2 released on 08/11/2008
51
  Initial release of Blubrry Powerpress
52
 
 
 
 
53
  == Feedback ==
54
  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.2
6
+ Stable tag: 0.2.1
7
 
8
  Add podcasting support to your blog.
9
 
36
  = Why doesn't Blubrry Powerpress include media statistics? =
37
  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.
38
 
39
+ = Looking for a better Audio Player? =
40
+ Check out the <a href="http://wpaudioplayer.com" target="_blank" title="WP Audio Player 2.0">WP Audio Player 2.0</a>. The WP Audio Player 2.0 options include theme colors, initial volume, player width and more.
41
+
42
  == Installation ==
43
  1. Copy the entire directory from the downloaded zip file into the /wp-content/plugins/ folder.
44
  2. Activate the "Blubrry Powerpress" plugin in the Plugin Management page.
53
  0.2 released on 08/11/2008
54
  Initial release of Blubrry Powerpress
55
 
56
+ 0.2.1 released on 09/17/2008
57
+ Fixed bugs: itunes:subtitle bug, itunes:summary is now enabled by default, add ending trailing slash to media url if missing, and copy blubrry keyword from podpress fix.
58
+
59
  == Feedback ==
60
  http://www.blubrry.com/powerpress/