PowerPress Podcasting plugin by Blubrry - Version 0.6.4

Version Description

Download this release

Release Info

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

Code changes from version 0.6.3 to 0.6.4

Files changed (2) hide show
  1. powerpress.php +64 -9
  2. readme.txt +7 -2
powerpress.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Blubrry Powerpress
4
  Plugin URI: http://www.blubrry.com/powerpress/
5
  Description: <a href="http://www.blubrry.com/powerpress/" target="_blank">Blubrry Powerpress</a> adds podcasting support to your blog. Features include: media player, 3rd party statistics and iTunes integration.
6
- Version: 0.6.3
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
@@ -44,6 +44,9 @@ define('POWERPRESS_VERSION', '0.6.3' );
44
  // Display Powerpress player only for previously created Podpress episodes.
45
  //define('POWERPRESS_USE_PLAYER_FOR_PODPRESS_EPISODES', true);
46
 
 
 
 
47
  // Display custom play image for quicktime media. Applies to on page player only.
48
  //define('POWERPRESS_PLAY_IMAGE', 'http://www.blubrry.com/themes/blubrry/images/player/PlayerBadge150x50NoBorder.jpg');
49
 
@@ -62,8 +65,11 @@ function powerpress_content($content)
62
  if( is_feed() )
63
  return $content; // We don't want to do anything to the feed
64
 
65
- if( post_password_required($post) )
66
- return $content;
 
 
 
67
 
68
  // Problem: If the_excerpt is used instead of the_content, both the_exerpt and the_content will be called here.
69
  // Important to note, get_the_excerpt will be called before the_content is called, so we add a simple little hack
@@ -500,9 +506,12 @@ function powerpress_rss2_item()
500
  global $powerpress_feed, $powerpress_itunes_explicit, $powerpress_itunes_talent_name, $powerpress_default_url, $powerpress_process_podpress, $post;
501
  $duration = false;
502
 
503
- if( post_password_required($post) )
504
- return $content;
505
-
 
 
 
506
  // are we processing a feed that powerpress should handle
507
  if( $powerpress_feed == false )
508
  return;
@@ -579,8 +588,11 @@ function powerpress_rss2_item()
579
  echo "\t\t<itunes:subtitle>". powerpress_format_itunes_value(powerpress_smart_trim($excerpt_no_html, 250, true)) .'</itunes:subtitle>'.PHP_EOL;
580
  else
581
  echo "\t\t<itunes:subtitle>". powerpress_format_itunes_value(powerpress_smart_trim($content_no_html, 250, true)) .'</itunes:subtitle>'.PHP_EOL;
582
-
583
- echo "\t\t<itunes:summary>". powerpress_format_itunes_value(powerpress_smart_trim($content_no_html, 4000), 4000) .'</itunes:summary>'.PHP_EOL;
 
 
 
584
 
585
  if( $powerpress_itunes_talent_name )
586
  echo "\t\t<itunes:author>" . wp_specialchars($powerpress_itunes_talent_name) . '</itunes:author>'.PHP_EOL;
@@ -738,6 +750,46 @@ if( defined('POWERPRESS_USE_FOOTER') && POWERPRESS_USE_FOOTER ) // $g_powerpress
738
  Helper functions:
739
  */
740
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
741
  function powerpress_itunes_categories($PrefixSubCategories = false)
742
  {
743
  $temp = array();
@@ -851,7 +903,10 @@ function powerpress_format_itunes_value($value, $char_limit = 255, $specialchars
851
  {
852
  // Code added to solve issue with KimiliFlashEmbed plugin
853
  // 99.9% of the time this code will not be necessary
854
- $value = preg_replace("/\[(kml_(flash|swf)embed)\b(.*?)(?:(\/))?\]/s", '', $value);
 
 
 
855
 
856
  if( strlen($value) > $char_limit )
857
  return wp_specialchars(substr($value, 0, $char_limit));
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.4
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
44
  // Display Powerpress player only for previously created Podpress episodes.
45
  //define('POWERPRESS_USE_PLAYER_FOR_PODPRESS_EPISODES', true);
46
 
47
+ // Enhance the itunes:summary for each post by converting web links and imges into direct hotlinks.
48
+ //define('POWERPRESS_SMART_ITUNES_SUMMARY', true);
49
+
50
  // Display custom play image for quicktime media. Applies to on page player only.
51
  //define('POWERPRESS_PLAY_IMAGE', 'http://www.blubrry.com/themes/blubrry/images/player/PlayerBadge150x50NoBorder.jpg');
52
 
65
  if( is_feed() )
66
  return $content; // We don't want to do anything to the feed
67
 
68
+ if( function_exists('post_password_required') )
69
+ {
70
+ if( post_password_required($post) )
71
+ return $content;
72
+ }
73
 
74
  // Problem: If the_excerpt is used instead of the_content, both the_exerpt and the_content will be called here.
75
  // Important to note, get_the_excerpt will be called before the_content is called, so we add a simple little hack
506
  global $powerpress_feed, $powerpress_itunes_explicit, $powerpress_itunes_talent_name, $powerpress_default_url, $powerpress_process_podpress, $post;
507
  $duration = false;
508
 
509
+ if( function_exists('post_password_required') )
510
+ {
511
+ if( post_password_required($post) )
512
+ return $content;
513
+ }
514
+
515
  // are we processing a feed that powerpress should handle
516
  if( $powerpress_feed == false )
517
  return;
588
  echo "\t\t<itunes:subtitle>". powerpress_format_itunes_value(powerpress_smart_trim($excerpt_no_html, 250, true)) .'</itunes:subtitle>'.PHP_EOL;
589
  else
590
  echo "\t\t<itunes:subtitle>". powerpress_format_itunes_value(powerpress_smart_trim($content_no_html, 250, true)) .'</itunes:subtitle>'.PHP_EOL;
591
+
592
+ if( defined('POWERPRESS_SMART_ITUNES_SUMMARY') && POWERPRESS_SMART_ITUNES_SUMMARY )
593
+ echo "\t\t<itunes:summary>". powerpress_itunes_summary($post->post_content) .'</itunes:summary>'.PHP_EOL;
594
+ else
595
+ echo "\t\t<itunes:summary>". powerpress_format_itunes_value(powerpress_smart_trim($content_no_html, 4000), 4000) .'</itunes:summary>'.PHP_EOL;
596
 
597
  if( $powerpress_itunes_talent_name )
598
  echo "\t\t<itunes:author>" . wp_specialchars($powerpress_itunes_talent_name) . '</itunes:author>'.PHP_EOL;
750
  Helper functions:
751
  */
752
 
753
+ function powerpress_itunes_summary($html)
754
+ {
755
+ // Do some smart conversion of the post html to readable text without HTML.
756
+
757
+ // First, convert: <a href="link"...>label</a>
758
+ // to: label (link)
759
+ $html = preg_replace_callback('/(\<a[^\>]*href="([^"]*)"[^\>]*>([^\<]*)<\/a\>)/i',
760
+ create_function(
761
+ '$matches',
762
+ 'return "{$matches[3]} ({$matches[2]})";'
763
+ ),
764
+ $html);
765
+
766
+ // Second, convert: <img src="link" title="title" />
767
+ // to: if no title (image: link) or (image title: link)
768
+ $html = preg_replace_callback('/(\<img[^\>]*src="([^"]*)"[^\>]*[^\>]*\>)/i',
769
+ create_function(
770
+ '$matches',
771
+ 'return "({$matches[2]})";'
772
+ ),
773
+ $html);
774
+
775
+ // Third, convert <ul><li> to <li>*
776
+ // TODO:
777
+
778
+ // Last, and the hardest, convert <ol><li> to numbers, this will be the hardest
779
+ // TODO:
780
+
781
+ // For now make them bullet points...
782
+ $html = str_replace('<li>', '<li>* ', $html);
783
+
784
+ // Now do all the other regular conversions...
785
+ if( function_exists('strip_shortcodes') )
786
+ $html = strip_shortcodes( $html );
787
+ $html = str_replace(']]>', ']]&gt;', $html);
788
+ $content_no_html = strip_tags($html);
789
+
790
+ return powerpress_format_itunes_value(powerpress_smart_trim($content_no_html, 4000), 4000);
791
+ }
792
+
793
  function powerpress_itunes_categories($PrefixSubCategories = false)
794
  {
795
  $temp = array();
903
  {
904
  // Code added to solve issue with KimiliFlashEmbed plugin
905
  // 99.9% of the time this code will not be necessary
906
+ $value = preg_replace("/\[(kml_(flash|swf)embed)\b(.*?)(?:(\/))?(\]|$)/s", '', $value);
907
+ if( DB_CHARSET != 'utf8' ) // Check if the string is UTF-8
908
+ $value = utf8_encode($value); // If it is not, convert to UTF-8 then decode it...
909
+ $value = html_entity_decode($value, ENT_COMPAT, 'UTF-8'); // Remove any additional entities such as &nbsp;
910
 
911
  if( strlen($value) > $char_limit )
912
  return wp_specialchars(substr($value, 0, $char_limit));
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.1
6
- Stable tag: 0.6.3
7
 
8
  Add podcasting support to your blog.
9
 
@@ -50,7 +50,8 @@ http://help.blubrry.com/blubrry-powerpress/
50
 
51
  == Screenshots ==
52
  1. Add podcast episode, found within the edit post screen
53
- 2. Cross section of Blubrry Powerpress settings page.
 
54
 
55
  == Changelog ==
56
 
@@ -99,6 +100,10 @@ Added option to reset rewrite rules when settings saved to fix problem with podc
99
  0.6.3 released on 02/16/2009
100
  Added new options to load all javascript for players in the wp_footer() function. Options are available as defines to add to the wp-config.php and are documented near the top of the powerpress.php. Added option in settings to display player in excerpts. Added code to repair corrupted Podpress data for displaying previously created podpress episodes. Note: Podpress data corruption was originally caused by previous versions of Podpress. Added code to prevent Wordpress from auto adding enclosures created from links to media found in the blog post.
101
 
 
 
 
 
102
  == Contributors ==
103
  Angelo Mandato, CIO [RawVoice](http://www.rawvoice.com) - Plugin founder, architect and lead developer
104
 
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.1
6
+ Stable tag: 0.6.4
7
 
8
  Add podcasting support to your blog.
9
 
50
 
51
  == Screenshots ==
52
  1. Add podcast episode, found within the edit post screen
53
+ 2. Cross section of Blubrry Powerpress settings page (Feed settings).
54
+ 3. Cross section of Blubrry Powerpress settings page (Basic settings).
55
 
56
  == Changelog ==
57
 
100
  0.6.3 released on 02/16/2009
101
  Added new options to load all javascript for players in the wp_footer() function. Options are available as defines to add to the wp-config.php and are documented near the top of the powerpress.php. Added option in settings to display player in excerpts. Added code to repair corrupted Podpress data for displaying previously created podpress episodes. Note: Podpress data corruption was originally caused by previous versions of Podpress. Added code to prevent Wordpress from auto adding enclosures created from links to media found in the blog post.
102
 
103
+ 0.6.4 released on 02/16/2009
104
+ Fixed bug where post_password_required() function does not exist, bug only affects users using Wordpress blogs older than version 2.7.
105
+
106
+
107
  == Contributors ==
108
  Angelo Mandato, CIO [RawVoice](http://www.rawvoice.com) - Plugin founder, architect and lead developer
109