PowerPress Podcasting plugin by Blubrry - Version 1.0.5

Version Description

  • Released on 1/30/2010
  • Added new 'Podcast Permalinks' option in Basic Settings so users can map example.com/podcast/ to a static page or category.
  • Renamed jquery.cookie.js to jquery.c.js to prevent Apache mod_security from detecting the word 'cookie' as a possible threat.
  • Additional code added for some cases where previous PodPress data was stored serialized twice over. PowerPress now un-serializes the PodPress data twice if necessary.
  • Added option to Disable Media Player for known mobile devices such as iPhone, Android, Palm Pre and Blackberry phones. (Thanks Michael H!)
  • Fixed bug with play in new window only using the default player. (Thanks lvaro!)
  • Fixed bug with AudioPlay flash player not linking to media file.
  • Fixed bug with iTunes ping results for podcast categories and channels displaying the default feed results.
  • Fixed bug with iTunes duration not displaying in edit screen after saving. (entered values are now saved if auto detect fails)
  • Displaying default podcast category feed title below feed title field for reference.
  • Displaying default podcast category landing page URL below Landing Page field for reference.
  • Added note in the iTunes New Feed URL setting which feed the setting is applied to.
  • Added option to allow manually setting the iTunes author name on a per episode basis.
  • Updated Flash players to support URLs with spaces by urlencoding the URL values.
  • Added better error reporting for AJAX 'Verify' button failures.
  • Relabeled "Import Movable Type/Blogger/Joomla/TypePad Episodes" to "Import from other Blogging Platform".
  • PodPress Import screen now includes a media file extension filter.
  • PodPress Import now includes the m4v video cover images.
  • PodPress Import "Select Only" specific columns feature.
  • Other Blogging Platform Import "Select Only" specific columns feature.
  • PowerPress shortcode [powerpress] now documented within the Appearance Settings tab.
  • Warning added to "Auto Add Media" setting that the Duration (total play time) will not be detected.
  • Added link to PodcastFAQ.com to footer and "Tools" page.
  • All Podcast Channels must be deleted before disabling the Advanced Option.
  • Fixed bug where Custom Channels with blank titles did not appear in list.
  • Fixed bug where WordPress 2.6 PowerPress users have a disabled WordPress dashboard caused by missing wp_add_dashboard_widget() function.
  • Diagnostics now tests that the temporary directory exists and is writable.
  • Diagnostics Email results are now printed in the page after sending.
  • Diagnostics now includes the title, version and URL of active plugins.
Download this release

Release Info

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

Code changes from version 1.0.4 to 1.0.5

3rdparty/{jquery.cookie.js → jquery.c.js} RENAMED
File without changes
powerpress-player.php CHANGED
@@ -18,6 +18,9 @@ function powerpressplayer_get_root_url()
18
  function powerpressplayer_filter($content, $media_url, $ExtraData = array())
19
  {
20
  $Settings = get_option('powerpress_general');
 
 
 
21
  // Check if we are using a custom flash player...
22
  if( !isset($Settings['player']) || $Settings['player'] == 'default' ) // Either the default player is selected or the user never selected a player
23
  return $content;
@@ -110,8 +113,8 @@ function powerpressplayer_build($media_url, $Settings, $ExtraData = array())
110
  $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">';
111
  //$content .= '<script language="JavaScript" src="'.powerpressplayer_get_root_url().'audio-player.js"></script>'.PHP_EOL;
112
  $content .= '<object type="application/x-shockwave-flash" data="'.powerpressplayer_get_root_url().'audio-player.swf" id="'.$g_powerpress_player_id.'" height="24" width="'. $PlayerSettings['width'] .'">'.PHP_EOL;
113
- $content .= '<param name="movie" value="'.powerpressplayer_get_root_url().'/audio-player.swf" />'.PHP_EOL;
114
- $content .= '<param name="FlashVars" value="playerID='.$g_powerpress_player_id.'&amp;soundFile='.$media_url.$flashvars.'" />'.PHP_EOL;
115
  $content .= '<param name="quality" value="high" />'.PHP_EOL;
116
  $content .= '<param name="menu" value="false" />'.PHP_EOL;
117
  $content .= '<param name="wmode" value="transparent" />'.PHP_EOL;
@@ -154,7 +157,7 @@ function powerpressplayer_build($media_url, $Settings, $ExtraData = array())
154
  }
155
 
156
  $flashvars = '';
157
- $flashvars .= "mp3=" . $media_url;
158
  if( $autoplay )
159
  $flashvars .= '&amp;autoplay=1';
160
 
@@ -244,7 +247,7 @@ $content .= '</div>'.PHP_EOL;
244
  $width = $height = (strstr($PlayerSettings['buttondir'], 'small')===false?30:15);
245
 
246
  // Set standard variables for player
247
- $flashvars = 'file=http://';
248
  $flashvars .= '&amp;repeat=1';
249
  if( $autoplay )
250
  $flashvars .= '&amp;auto=yes';
@@ -287,9 +290,9 @@ $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpre
287
  $content .= '<object type="application/x-shockwave-flash" data="'. powerpressplayer_get_root_url() .'simple_mp3.swf" id="'.$g_powerpress_player_id.'" width="150" height="50">';
288
  $content .= '<param name="movie" value="'. powerpressplayer_get_root_url().'simple_mp3.swf" />';
289
  $content .= '<param name="wmode" value="transparent" />';
290
- $content .= '<param name="FlashVars" value="'. get_bloginfo('home') .'?url='. $media_url.'&amp;autostart='. ($autostart?'true':'false') .'" />';
291
  $content .= '<param name="quality" value="high" />';
292
- $content .= '<embed wmode="transparent" src="'. get_bloginfo('home') .'?url='.$media_url.'&amp;autostart='. ($autostart?'true':'false') .'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="150" height="50"></embed>';
293
  $content .= '</object>';
294
  $content .= "</div>\n";
295
  }; break;
18
  function powerpressplayer_filter($content, $media_url, $ExtraData = array())
19
  {
20
  $Settings = get_option('powerpress_general');
21
+ if( !empty($Settings['display_player_disable_mobile']) && powerpress_is_mobile_client() )
22
+ return $content; // lets not add a player for this situation
23
+
24
  // Check if we are using a custom flash player...
25
  if( !isset($Settings['player']) || $Settings['player'] == 'default' ) // Either the default player is selected or the user never selected a player
26
  return $content;
113
  $content .= '<div class="powerpress_player" id="powerpress_player_'. $g_powerpress_player_id .'">';
114
  //$content .= '<script language="JavaScript" src="'.powerpressplayer_get_root_url().'audio-player.js"></script>'.PHP_EOL;
115
  $content .= '<object type="application/x-shockwave-flash" data="'.powerpressplayer_get_root_url().'audio-player.swf" id="'.$g_powerpress_player_id.'" height="24" width="'. $PlayerSettings['width'] .'">'.PHP_EOL;
116
+ $content .= '<param name="movie" value="'.powerpressplayer_get_root_url().'audio-player.swf" />'.PHP_EOL;
117
+ $content .= '<param name="FlashVars" value="playerID='.$g_powerpress_player_id.'&amp;soundFile='.urlencode($media_url).$flashvars.'" />'.PHP_EOL;
118
  $content .= '<param name="quality" value="high" />'.PHP_EOL;
119
  $content .= '<param name="menu" value="false" />'.PHP_EOL;
120
  $content .= '<param name="wmode" value="transparent" />'.PHP_EOL;
157
  }
158
 
159
  $flashvars = '';
160
+ $flashvars .= "mp3=" . urlencode($media_url);
161
  if( $autoplay )
162
  $flashvars .= '&amp;autoplay=1';
163
 
247
  $width = $height = (strstr($PlayerSettings['buttondir'], 'small')===false?30:15);
248
 
249
  // Set standard variables for player
250
+ $flashvars = 'file='.urlencode($media_url) ;
251
  $flashvars .= '&amp;repeat=1';
252
  if( $autoplay )
253
  $flashvars .= '&amp;auto=yes';
290
  $content .= '<object type="application/x-shockwave-flash" data="'. powerpressplayer_get_root_url() .'simple_mp3.swf" id="'.$g_powerpress_player_id.'" width="150" height="50">';
291
  $content .= '<param name="movie" value="'. powerpressplayer_get_root_url().'simple_mp3.swf" />';
292
  $content .= '<param name="wmode" value="transparent" />';
293
+ $content .= '<param name="FlashVars" value="'. get_bloginfo('home') .'?url='. urlencode($media_url).'&amp;autostart='. ($autostart?'true':'false') .'" />';
294
  $content .= '<param name="quality" value="high" />';
295
+ $content .= '<embed wmode="transparent" src="'. get_bloginfo('home') .'?url='.urlencode($media_url).'&amp;autostart='. ($autostart?'true':'false') .'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="150" height="50"></embed>';
296
  $content .= '</object>';
297
  $content .= "</div>\n";
298
  }; break;
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, iTunes integration, Blubrry Services (Media Statistics and Hosting) integration and a lot more.
6
- Version: 1.0.4
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
@@ -33,7 +33,7 @@ if( !function_exists('add_action') )
33
  die("access denied.");
34
 
35
  // WP_PLUGIN_DIR (REMEMBER TO USE THIS DEFINE IF NEEDED)
36
- define('POWERPRESS_VERSION', '1.0.4' );
37
 
38
  /////////////////////////////////////////////////////
39
  // The following define options should be placed in your
@@ -43,15 +43,15 @@ define('POWERPRESS_VERSION', '1.0.4' );
43
 
44
  // Set specific play and download labels for your installation of PowerPress
45
  if( !defined('POWERPRESS_LINKS_TEXT') )
46
- define('POWERPRESS_LINKS_TEXT', __('Podcast') );
47
  if( !defined('POWERPRESS_DURATION_TEXT') )
48
- define('POWERPRESS_DURATION_TEXT', __('Duration') );
49
  if( !defined('POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT') )
50
- define('POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT', __('Play in new window') );
51
  if( !defined('POWERPRESS_DOWNLOAD_TEXT') )
52
- define('POWERPRESS_DOWNLOAD_TEXT', __('Download') );
53
  if( !defined('POWERPRESS_PLAY_TEXT') )
54
- define('POWERPRESS_PLAY_TEXT', __('Play') );
55
 
56
  if( !defined('POWERPRESS_BLUBRRY_API_URL') )
57
  define('POWERPRESS_BLUBRRY_API_URL', 'http://api.blubrry.com/');
@@ -71,6 +71,10 @@ if( !defined('POWERPRESS_PLAY_IMAGE') )
71
  define('POWERPRESS_PLAY_IMAGE', 'play_video_default.jpg');
72
  if( !defined('PHP_EOL') )
73
  define('PHP_EOL', "\n"); // We need this variable defined for new lines.
 
 
 
 
74
 
75
  $powerpress_feed = NULL; // DO NOT CHANGE
76
 
@@ -372,7 +376,7 @@ function powerpress_rss2_head()
372
 
373
  if( !empty($Feed['itunes_image']) )
374
  {
375
- echo "\t".'<itunes:image href="' . wp_specialchars($Feed['itunes_image'], 'double') . '" />'.PHP_EOL;
376
  }
377
  else
378
  {
@@ -405,19 +409,19 @@ function powerpress_rss2_head()
405
 
406
  if( !empty($Feed['rss2_image']) )
407
  {
408
- echo"\t". '<image>' .PHP_EOL;
409
- if( is_category() )
410
  echo "\t\t".'<title>' . wp_specialchars( get_bloginfo_rss('name') ) . '</title>'.PHP_EOL;
411
  else
412
  echo "\t\t".'<title>' . wp_specialchars( get_bloginfo_rss('name') . get_wp_title_rss() ) . '</title>'.PHP_EOL;
413
- echo "\t\t".'<url>' . wp_specialchars($Feed['rss2_image']) . '</url>'.PHP_EOL;
414
  echo "\t\t".'<link>'. $Feed['url'] . '</link>' . PHP_EOL;
415
  echo "\t".'</image>' . PHP_EOL;
416
  }
417
  else // Use the default image
418
  {
419
- echo"\t". '<image>' .PHP_EOL;
420
- if( is_category() )
421
  echo "\t\t".'<title>' . wp_specialchars( get_bloginfo_rss('name') ) . '</title>'.PHP_EOL;
422
  else
423
  echo "\t\t".'<title>' . wp_specialchars( get_bloginfo_rss('name') . get_wp_title_rss() ) . '</title>'.PHP_EOL;
@@ -825,7 +829,7 @@ function powerpress_template_redirect()
825
  {
826
  if( is_feed() && powerpress_is_custom_podcast_feed() )
827
  {
828
- remove_action('template_redirect', 'ol_feed_redirect'); // Remove this action
829
  global $powerpress_feed;
830
 
831
  if( is_array($powerpress_feed) && trim(@$powerpress_feed['feed_redirect_url']) != '' && !preg_match("/feedburner|feedsqueezer|feedvalidator/i", $_SERVER['HTTP_USER_AGENT'] ) && @$_GET['redirect'] != 'no' )
@@ -841,6 +845,71 @@ function powerpress_template_redirect()
841
 
842
  add_action('template_redirect', 'powerpress_template_redirect', 0);
843
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
844
  function powerpress_pre_transient_rewrite_rules($return_rules)
845
  {
846
  global $wp_rewrite;
@@ -850,10 +919,10 @@ function powerpress_pre_transient_rewrite_rules($return_rules)
850
 
851
  if( $GeneralSettings && isset($GeneralSettings['custom_feeds']) && is_array($GeneralSettings['custom_feeds']) )
852
  {
853
- while( list($feedname,$null) = each($GeneralSettings['custom_feeds']) )
854
  {
855
- if( !in_array($feedname, $wp_rewrite->feeds) )
856
- $wp_rewrite->feeds[] = $feedname;
857
  }
858
  }
859
 
@@ -866,11 +935,11 @@ function powerpress_init()
866
  {
867
  $GeneralSettings = get_option('powerpress_general');
868
 
869
- if( isset($_GET['powerpress_pinw']) )
870
- powerpress_do_pinw($_GET['powerpress_pinw'], !empty($GeneralSettings['process_podpress']) );
871
-
872
  if( !empty($GeneralSettings['player_options']) )
873
  require_once( dirname(__FILE__).'/powerpress-player.php');
 
 
 
874
 
875
  if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) || defined('PODCASTING_VERSION') )
876
  return false; // Another podcasting plugin is enabled...
@@ -891,28 +960,40 @@ function powerpress_init()
891
  if( $feed_slug != 'podcast' )
892
  add_feed($feed_slug, 'powerpress_do_podcast_feed');
893
  }
894
-
895
- // FeedSmith support...
896
- if( isset($_GET['feed']) )
 
 
 
 
 
897
  {
898
- switch($_GET['feed'])
899
- {
900
- case '':
901
- case 'feed':
902
- case 'atom':
903
- case 'rss':
904
- case 'comments-rss2':
905
- case 'rss2': break; // Let FeedSmith redirect these feeds if it wants
906
- default: { // Otherwise lets remove FeedSmith
907
- if( has_action('init', 'ol_check_url') !== false )
908
- remove_action('init', 'ol_check_url');
909
- }
910
  }
911
  }
912
  }
 
913
  }
914
 
915
- add_action('init', 'powerpress_init', 9);
 
 
 
 
 
 
 
 
 
916
 
917
  // Load the general feed settings for feeds handled by powerpress
918
  function powerpress_load_general_feed_settings()
@@ -1213,6 +1294,9 @@ function powerpress_player_filter($content, $media_url, $ExtraData = array() )
1213
 
1214
  // Based on $ExtraData, we can determine which type of player to handle here...
1215
  $Settings = get_option('powerpress_general');
 
 
 
1216
  if( !isset($Settings['player_function']) )
1217
  $Settings['player_function'] = 1;
1218
  $player_width = 320;
@@ -1350,9 +1434,9 @@ function powerpress_player_filter($content, $media_url, $ExtraData = array() )
1350
 
1351
  if( $firefox )
1352
  {
1353
- $content .= '<p style="font-size: 85%;margin-top:0;">'. __('Best viewed with');
1354
  $content .= ' <a href="http://support.mozilla.com/en-US/kb/Using+the+Windows+Media+Player+plugin+with+Firefox#Installing_the_plugin" target="_blank">';
1355
- $content .= __('Windows Media Player plugin for Firefox') .'</a></p>';
1356
  }
1357
 
1358
  $content .= "</div>\n";
@@ -2160,6 +2244,13 @@ function powerpress_get_enclosure_data_podpress($post_id, $mediaNum = 0, $includ
2160
  $podPressMedia = @unserialize($podPressMedia);
2161
  }
2162
 
 
 
 
 
 
 
 
2163
 
2164
  if( is_array($podPressMedia) && isset($podPressMedia[$mediaNum]) && isset($podPressMedia[$mediaNum]['URI']) )
2165
  {
@@ -2177,7 +2268,8 @@ function powerpress_get_enclosure_data_podpress($post_id, $mediaNum = 0, $includ
2177
  $Data['size'] = $podPressMedia[$mediaNum]['size'];
2178
  if( isset($PodPressSettings[$mediaNum]['duration']) )
2179
  $Data['duration'] = $podPressMedia[$mediaNum]['duration'];
2180
-
 
2181
 
2182
  if( strpos($Data['url'], 'http://' ) !== 0 && strpos($Data['url'], 'https://' ) !== 0 )
2183
  {
@@ -2224,7 +2316,7 @@ function powerpress_get_player_links($post_id, $feed_slug = 'podcast', $EpisodeD
2224
  case 3: // Play in new window only
2225
  case 5: { // Play in page and new window
2226
  if( $is_pdf )
2227
- $player_links .= "<a href=\"{$EpisodeData['url']}\" class=\"powerpress_link_pinw\" target=\"_blank\" title=\"". __('Open in New Window') ."\">". __('Open in New Window') ."</a>".PHP_EOL;
2228
  else if( $post_id )
2229
  $player_links .= "<a href=\"{$EpisodeData['url']}\" class=\"powerpress_link_pinw\" target=\"_blank\" title=\"". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."\" onclick=\"return powerpress_pinw('{$post_id}-{$feed_slug}');\">". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."</a>".PHP_EOL;
2230
  else
@@ -2265,7 +2357,7 @@ function powerpress_get_player_links($post_id, $feed_slug = 'podcast', $EpisodeD
2265
  $extension = strtolower($parts['extension']);
2266
 
2267
  if( $is_pdf )
2268
- return '<p class="powerpress_links powerpress_links_'. $extension .'">'. __('E-Book PDF') . ( $feed_slug=='pdf'||$feed_slug=='podcast'?'':" ($feed_slug)") .': '. $player_links . '</p>'.PHP_EOL;
2269
  else if( $feed_slug != 'podcast' )
2270
  return '<p class="powerpress_links powerpress_links_'. $extension .'">'. htmlspecialchars(POWERPRESS_LINKS_TEXT) .' ('. htmlspecialchars($feed_slug) .'): '. $player_links . '</p>'.PHP_EOL;
2271
  else
@@ -2304,6 +2396,11 @@ function powerpress_premium_content_message($post_id, $feed_slug, $EpisodeData =
2304
 
2305
  return '<p class="powerpress_links powerpress_links_'. $extension .'">'. htmlspecialchars($FeedSettings['title']) .': <a href="'. get_bloginfo('home') .'/wp-login.php" title="Protected Content">(Protected Content)</a></p>'.PHP_EOL;
2306
  }
 
 
 
 
 
2307
  /*
2308
  End Helper Functions
2309
  */
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, iTunes integration, Blubrry Services (Media Statistics and Hosting) integration and a lot more.
6
+ Version: 1.0.5
7
  Author: Blubrry
8
  Author URI: http://www.blubrry.com/
9
  Change Log:
33
  die("access denied.");
34
 
35
  // WP_PLUGIN_DIR (REMEMBER TO USE THIS DEFINE IF NEEDED)
36
+ define('POWERPRESS_VERSION', '1.0.5' );
37
 
38
  /////////////////////////////////////////////////////
39
  // The following define options should be placed in your
43
 
44
  // Set specific play and download labels for your installation of PowerPress
45
  if( !defined('POWERPRESS_LINKS_TEXT') )
46
+ define('POWERPRESS_LINKS_TEXT', __('Podcast', 'powerpress') );
47
  if( !defined('POWERPRESS_DURATION_TEXT') )
48
+ define('POWERPRESS_DURATION_TEXT', __('Duration', 'powerpress') );
49
  if( !defined('POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT') )
50
+ define('POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT', __('Play in new window', 'powerpress') );
51
  if( !defined('POWERPRESS_DOWNLOAD_TEXT') )
52
+ define('POWERPRESS_DOWNLOAD_TEXT', __('Download', 'powerpress') );
53
  if( !defined('POWERPRESS_PLAY_TEXT') )
54
+ define('POWERPRESS_PLAY_TEXT', __('Play', 'powerpress') );
55
 
56
  if( !defined('POWERPRESS_BLUBRRY_API_URL') )
57
  define('POWERPRESS_BLUBRRY_API_URL', 'http://api.blubrry.com/');
71
  define('POWERPRESS_PLAY_IMAGE', 'play_video_default.jpg');
72
  if( !defined('PHP_EOL') )
73
  define('PHP_EOL', "\n"); // We need this variable defined for new lines.
74
+
75
+ // Set regular expression values for determining mobile devices
76
+ if( !defined('POWERPRESS_MOBILE_REGEX') )
77
+ define('POWERPRESS_MOBILE_REGEX', 'iphone|ipod|aspen|android|blackberry|opera mini|webos|incognito|webmate');
78
 
79
  $powerpress_feed = NULL; // DO NOT CHANGE
80
 
376
 
377
  if( !empty($Feed['itunes_image']) )
378
  {
379
+ echo "\t".'<itunes:image href="' . wp_specialchars( str_replace(' ', '+', $Feed['itunes_image']), 'double') . '" />'.PHP_EOL;
380
  }
381
  else
382
  {
409
 
410
  if( !empty($Feed['rss2_image']) )
411
  {
412
+ echo "\t". '<image>' .PHP_EOL;
413
+ if( is_category() && !empty($Feed['title']) )
414
  echo "\t\t".'<title>' . wp_specialchars( get_bloginfo_rss('name') ) . '</title>'.PHP_EOL;
415
  else
416
  echo "\t\t".'<title>' . wp_specialchars( get_bloginfo_rss('name') . get_wp_title_rss() ) . '</title>'.PHP_EOL;
417
+ echo "\t\t".'<url>' . wp_specialchars( str_replace(' ', '+', $Feed['rss2_image'])) . '</url>'.PHP_EOL;
418
  echo "\t\t".'<link>'. $Feed['url'] . '</link>' . PHP_EOL;
419
  echo "\t".'</image>' . PHP_EOL;
420
  }
421
  else // Use the default image
422
  {
423
+ echo "\t". '<image>' .PHP_EOL;
424
+ if( is_category() && !empty($Feed['title']) )
425
  echo "\t\t".'<title>' . wp_specialchars( get_bloginfo_rss('name') ) . '</title>'.PHP_EOL;
426
  else
427
  echo "\t\t".'<title>' . wp_specialchars( get_bloginfo_rss('name') . get_wp_title_rss() ) . '</title>'.PHP_EOL;
829
  {
830
  if( is_feed() && powerpress_is_custom_podcast_feed() )
831
  {
832
+ remove_action('template_redirect', 'ol_feed_redirect'); // Remove this action so feedsmith doesn't redirect
833
  global $powerpress_feed;
834
 
835
  if( is_array($powerpress_feed) && trim(@$powerpress_feed['feed_redirect_url']) != '' && !preg_match("/feedburner|feedsqueezer|feedvalidator/i", $_SERVER['HTTP_USER_AGENT'] ) && @$_GET['redirect'] != 'no' )
845
 
846
  add_action('template_redirect', 'powerpress_template_redirect', 0);
847
 
848
+
849
+ function powerpress_rewrite_rules_array($array)
850
+ {
851
+ global $wp_rewrite;
852
+ $settings = get_option('powerpress_general');
853
+
854
+ $podcast_feeds = array('podcast'=>true);
855
+ if( isset($settings['custom_feeds']) && is_array($settings['custom_feeds']) )
856
+ $podcast_feeds = array_merge($settings['custom_feeds'], $podcast_feeds );
857
+
858
+ $merged_slugs = '';
859
+ while( list($feed_slug, $feed_title) = each($podcast_feeds) )
860
+ {
861
+ if( $merged_slugs != '' )
862
+ $merged_slugs .= '|';
863
+ $merged_slugs .= $feed_slug;
864
+ }
865
+
866
+ // $wp_rewrite->index most likely index.php
867
+ $new_array[ 'feed/('.$merged_slugs.')/?$' ] = $wp_rewrite->index. '?feed='. $wp_rewrite->preg_index(1);
868
+
869
+ // If feature is not enabled, use the default permalinks
870
+ if( empty($settings['permalink_feeds_only']) )
871
+ return array_merge($new_array, $array);
872
+
873
+ global $wpdb;
874
+ reset($podcast_feeds);
875
+ while( list($feed_slug, $feed_title) = each($podcast_feeds) )
876
+ {
877
+ $page_name_id = $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE post_name = '".$feed_slug."'");
878
+ if( $page_name_id )
879
+ {
880
+ $new_array[ $feed_slug.'/?$' ] = $wp_rewrite->index. '?pagename='. $feed_slug.'&page_id='.$page_name_id;
881
+ unset($podcast_feeds[ $feed_slug ]);
882
+ continue;
883
+ }
884
+
885
+ $category = get_category_by_slug($feed_slug);
886
+ if( $category )
887
+ {
888
+ $new_array[ $feed_slug.'/?$' ] = $wp_rewrite->index. '?cat='. $category->term_id; // category_name='. $feed_slug .'&
889
+ unset($podcast_feeds[ $feed_slug ]);
890
+ }
891
+ }
892
+
893
+ if( count($podcast_feeds) > 0 )
894
+ {
895
+ reset($podcast_feeds);
896
+ $remaining_slugs = '';
897
+ while( list($feed_slug, $feed_title) = each($podcast_feeds) )
898
+ {
899
+ if( $remaining_slugs != '' )
900
+ $remaining_slugs .= '|';
901
+ $remaining_slugs .= $feed_slug;
902
+ }
903
+
904
+ $new_array[ '('.$remaining_slugs.')/?$' ] = $wp_rewrite->index. '?pagename='. $wp_rewrite->preg_index(1);
905
+ }
906
+
907
+ return array_merge($new_array, $array);
908
+ }
909
+
910
+ add_filter('rewrite_rules_array', 'powerpress_rewrite_rules_array');
911
+
912
+
913
  function powerpress_pre_transient_rewrite_rules($return_rules)
914
  {
915
  global $wp_rewrite;
919
 
920
  if( $GeneralSettings && isset($GeneralSettings['custom_feeds']) && is_array($GeneralSettings['custom_feeds']) )
921
  {
922
+ while( list($feed_slug,$null) = each($GeneralSettings['custom_feeds']) )
923
  {
924
+ if( !in_array($feed_slug, $wp_rewrite->feeds) )
925
+ $wp_rewrite->feeds[] = $feed_slug;
926
  }
927
  }
928
 
935
  {
936
  $GeneralSettings = get_option('powerpress_general');
937
 
 
 
 
938
  if( !empty($GeneralSettings['player_options']) )
939
  require_once( dirname(__FILE__).'/powerpress-player.php');
940
+
941
+ if( isset($_GET['powerpress_pinw']) )
942
+ powerpress_do_pinw($_GET['powerpress_pinw'], !empty($GeneralSettings['process_podpress']) );
943
 
944
  if( defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) || defined('PODCASTING_VERSION') )
945
  return false; // Another podcasting plugin is enabled...
960
  if( $feed_slug != 'podcast' )
961
  add_feed($feed_slug, 'powerpress_do_podcast_feed');
962
  }
963
+ }
964
+
965
+ // FeedSmith support...
966
+ /*
967
+ // This logic need not apply anymore
968
+ if( isset($_GET['feed']) )
969
+ {
970
+ switch($_GET['feed'])
971
  {
972
+ case '':
973
+ case 'feed':
974
+ case 'atom':
975
+ case 'rss':
976
+ case 'comments-rss2':
977
+ case 'rss2': break; // Let FeedSmith redirect these feeds if it wants
978
+ default: { // Otherwise lets remove FeedSmith
979
+ if( has_action('init', 'ol_check_url') !== false )
980
+ remove_action('init', 'ol_check_url');
 
 
 
981
  }
982
  }
983
  }
984
+ */
985
  }
986
 
987
+ add_action('init', 'powerpress_init', -100); // We need to add the feeds before other plugins start screwing with them
988
+
989
+ // May be used for future use
990
+ /*
991
+ function powerpress_plugins_loaded()
992
+ {
993
+
994
+ }
995
+ add_action('plugins_loaded', 'powerpress_plugins_loaded');
996
+ */
997
 
998
  // Load the general feed settings for feeds handled by powerpress
999
  function powerpress_load_general_feed_settings()
1294
 
1295
  // Based on $ExtraData, we can determine which type of player to handle here...
1296
  $Settings = get_option('powerpress_general');
1297
+ if( !empty($Settings['display_player_disable_mobile']) && powerpress_is_mobile_client() )
1298
+ return $content; // lets not add a player for this situation
1299
+
1300
  if( !isset($Settings['player_function']) )
1301
  $Settings['player_function'] = 1;
1302
  $player_width = 320;
1434
 
1435
  if( $firefox )
1436
  {
1437
+ $content .= '<p style="font-size: 85%;margin-top:0;">'. __('Best viewed with', 'powerpress');
1438
  $content .= ' <a href="http://support.mozilla.com/en-US/kb/Using+the+Windows+Media+Player+plugin+with+Firefox#Installing_the_plugin" target="_blank">';
1439
+ $content .= __('Windows Media Player plugin for Firefox', 'powerpress') .'</a></p>';
1440
  }
1441
 
1442
  $content .= "</div>\n";
2244
  $podPressMedia = @unserialize($podPressMedia);
2245
  }
2246
 
2247
+ // Do it a second time in case it is double serialized
2248
+ if( !is_array($podPressMedia) )
2249
+ {
2250
+ // Sometimes the stored data gets messed up, we can fix it here:
2251
+ $podPressMedia = powerpress_repair_serialize($podPressMedia);
2252
+ $podPressMedia = @unserialize($podPressMedia);
2253
+ }
2254
 
2255
  if( is_array($podPressMedia) && isset($podPressMedia[$mediaNum]) && isset($podPressMedia[$mediaNum]['URI']) )
2256
  {
2268
  $Data['size'] = $podPressMedia[$mediaNum]['size'];
2269
  if( isset($PodPressSettings[$mediaNum]['duration']) )
2270
  $Data['duration'] = $podPressMedia[$mediaNum]['duration'];
2271
+ if( isset($PodPressSettings[$mediaNum]['previewImage']) )
2272
+ $Data['image'] = $podPressMedia[$mediaNum]['previewImage'];
2273
 
2274
  if( strpos($Data['url'], 'http://' ) !== 0 && strpos($Data['url'], 'https://' ) !== 0 )
2275
  {
2316
  case 3: // Play in new window only
2317
  case 5: { // Play in page and new window
2318
  if( $is_pdf )
2319
+ $player_links .= "<a href=\"{$EpisodeData['url']}\" class=\"powerpress_link_pinw\" target=\"_blank\" title=\"". __('Open in New Window', 'powerpress') ."\">". __('Open in New Window', 'powerpress') ."</a>".PHP_EOL;
2320
  else if( $post_id )
2321
  $player_links .= "<a href=\"{$EpisodeData['url']}\" class=\"powerpress_link_pinw\" target=\"_blank\" title=\"". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."\" onclick=\"return powerpress_pinw('{$post_id}-{$feed_slug}');\">". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."</a>".PHP_EOL;
2322
  else
2357
  $extension = strtolower($parts['extension']);
2358
 
2359
  if( $is_pdf )
2360
+ return '<p class="powerpress_links powerpress_links_'. $extension .'">'. __('E-Book PDF', 'powerpress') . ( $feed_slug=='pdf'||$feed_slug=='podcast'?'':" ($feed_slug)") .': '. $player_links . '</p>'.PHP_EOL;
2361
  else if( $feed_slug != 'podcast' )
2362
  return '<p class="powerpress_links powerpress_links_'. $extension .'">'. htmlspecialchars(POWERPRESS_LINKS_TEXT) .' ('. htmlspecialchars($feed_slug) .'): '. $player_links . '</p>'.PHP_EOL;
2363
  else
2396
 
2397
  return '<p class="powerpress_links powerpress_links_'. $extension .'">'. htmlspecialchars($FeedSettings['title']) .': <a href="'. get_bloginfo('home') .'/wp-login.php" title="Protected Content">(Protected Content)</a></p>'.PHP_EOL;
2398
  }
2399
+
2400
+ function powerpress_is_mobile_client()
2401
+ {
2402
+ return preg_match('/'.POWERPRESS_MOBILE_REGEX.'/i', $_SERVER['HTTP_USER_AGENT']);
2403
+ }
2404
  /*
2405
  End Helper Functions
2406
  */
powerpressadmin-basic.php CHANGED
@@ -135,28 +135,36 @@ jQuery(document).ready(function($) {
135
  </div>
136
  <div class="clear"></div>
137
 
 
 
 
 
 
 
 
 
138
  <div style="margin-left: 10px;">
139
  <h3>Advanced Options</h3>
140
  <div style="margin-left: 50px;">
141
  <div>
142
- <input type="checkbox" name="General[advanced_mode]" value="1" <?php echo ($General['advanced_mode']==1?' checked':''); ?>/>
143
  <strong><?php echo __('Advanced Mode'); ?></strong> -
144
  <?php echo __('Uncheck to display only the essential settings for podcasting.'); ?>
145
  </div>
146
  <div>
147
- <input type="checkbox" name="General[player_options]" value="1" <?php echo ($General['player_options']?' checked':''); ?>/>
148
  <strong><?php echo __('Audio Player Options'); ?></strong> -
149
  <?php echo __('Select from 5 different web based audio flash players.'); ?>
150
  <span style="font-size: 85%;">(<?php echo __('feature will appear in left menu when enabled'); ?>)</span>
151
  </div>
152
  <div>
153
- <input type="checkbox" name="General[channels]" value="1" <?php echo ($General['channels']?' checked':''); ?>/>
154
  <strong><?php echo __('Custom Podcast Channels'); ?></strong> -
155
  <?php echo __('Manage multiple media files and/or formats to one blog post.'); ?>
156
  <span style="font-size: 85%;">(<?php echo __('feature will appear in left menu when enabled'); ?>)</span>
157
  </div>
158
  <div>
159
- <input type="checkbox" name="General[cat_casting]" value="1" <?php echo ($General['cat_casting']?' checked':''); ?>/>
160
  <strong><?php echo __('Category Podcasting'); ?></strong> -
161
  <?php echo __('Manage category podcast feeds.'); ?>
162
  <span style="font-size: 85%;">(<?php echo __('feature will appear in left menu when enabled'); ?>)</span>
@@ -281,6 +289,8 @@ function powerpressadmin_edit_entry_options($General)
281
  (<?php echo __('Leave unchecked to use the first 250 characters of your blog post'); ?>)</p>
282
  <p style="margin-top: 15px;"><input id="episode_box_summary" class="episode_box_option" name="General[episode_box_summary]" type="checkbox" value="1"<?php if( !empty($General['episode_box_summary']) ) echo ' checked'; ?> /> <?php echo __('iTunes Summary Field'); ?>
283
  (<?php echo __('Leave unchecked to use your blog post'); ?>)</p>
 
 
284
  <p style="margin-top: 15px;"><input id="episode_box_explicit" class="episode_box_option" name="General[episode_box_explicit]" type="checkbox" value="1"<?php if( !empty($General['episode_box_explicit']) ) echo ' checked'; ?> /> <?php echo __('iTunes Explicit Field'); ?>
285
  (<?php echo __('Leave unchecked to use your feed\'s explicit setting'); ?>)</p>
286
 
@@ -357,8 +367,33 @@ while( list($value,$desc) = each($options) )
357
  </select>
358
  <p><?php echo __('When enabled, the first or last media link found in the post content is automatically added as your podcast episode.'); ?></p>
359
  <p style="margin-bottom: 0;"><em><?php echo __('NOTE: Use this feature with caution. Links to media files could unintentionally become podcast episodes.'); ?></em></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
  </td>
361
  </tr>
 
 
 
362
 
363
  </table>
364
  <?php
@@ -504,8 +539,10 @@ while( list($value,$desc) = each($options) )
504
  ?>
505
  </select> <?php echo __('Notify (ping) iTunes when you publish a new episode.'); ?>
506
  <p><input name="TestiTunesPing" type="checkbox" value="1"<?php if( $OpenSSLSupport == false ) echo ' disabled'; ?> /> <?php echo __('Test Update iTunes Listing (recommended)'); ?></p>
507
- <?php if( $General['itunes_url'] ) {
508
-
 
 
509
  $ping_url = str_replace(
510
  array( 'https://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=',
511
  'http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=',
@@ -513,12 +550,12 @@ while( list($value,$desc) = each($options) )
513
  'http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=',
514
  'https://www.itunes.com/podcast?id=',
515
  'http://www.itunes.com/podcast?id='),
516
- 'https://phobos.apple.com/WebObjects/MZFinance.woa/wa/pingPodcast?id=', $General['itunes_url']);
517
  ?>
518
  <p><?php echo __('You may also update your iTunes listing by using the following link:'); ?> <a href="#" onclick="javascript: window.open('<?php echo $ping_url; ?>'); return false;" title="<?php echo __('Ping iTunes in New Window'); ?>"><?php echo __('Ping iTunes in New Window'); ?></a></p>
519
 
520
  <?php
521
- if( preg_match('/id=(\d+)/', $General['itunes_url'], $matches) )
522
  {
523
  $FEEDID = $matches[1];
524
  $Logging = get_option('powerpress_log');
@@ -751,7 +788,6 @@ function powerpressadmin_appearance($General=false)
751
  }
752
  }
753
 
754
- // <input type="hidden" name="action" value="powerpress-save-appearance" />
755
  ?>
756
 
757
  <h3><?php echo __('Appearance Settings'); ?></h3>
@@ -772,8 +808,25 @@ while( list($value,$desc) = each($displayoptions) )
772
  echo "\t<option value=\"$value\"". ($General['display_player']==$value?' selected':''). ">$desc</option>\n";
773
 
774
  ?>
775
- </select> (<?php echo __('where player and/or links will be displayed'); ?>)
776
- <p><input name="General[display_player_excerpt]" type="checkbox" value="1" <?php if($General['display_player_excerpt']) echo 'checked '; ?>/> <?php echo __('Display player / links in:'); ?> <a href="http://codex.wordpress.org/Template_Tags/the_excerpt" title="<?php echo __('WordPress Excerpts'); ?>" target="_blank"><?php echo __('WordPress Excerpts'); ?></a> (<?php echo __('e.g. search results'); ?>)</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
777
  </td>
778
  </tr>
779
 
@@ -789,6 +842,8 @@ while( list($value,$desc) = each($playeroptions) )
789
 
790
  ?>
791
  </select>
 
 
792
  </td>
793
  </tr>
794
  </table>
135
  </div>
136
  <div class="clear"></div>
137
 
138
+ <?php
139
+ $ChannelsCheckbox = '';
140
+ if( !empty($General['custom_feeds']) )
141
+ $ChannelsCheckbox = ' onclick="alert(\'You must delete all of the Podcast Channels to disable this option.\');return false;"';
142
+ $CategoryCheckbox = '';
143
+ //if( !empty($General['custom_cat_feeds']) ) // Decided ont to include this warning because it may imply that you have to delete the actual category, which is not true.
144
+ // $CategoryCheckbox = ' onclick="alert(\'You must remove podcasting from the categories to disable this option.\');return false;"';
145
+ ?>
146
  <div style="margin-left: 10px;">
147
  <h3>Advanced Options</h3>
148
  <div style="margin-left: 50px;">
149
  <div>
150
+ <input type="checkbox" name="General[advanced_mode]" value="1" <?php echo ($General['advanced_mode']==1?' checked':''); ?> />
151
  <strong><?php echo __('Advanced Mode'); ?></strong> -
152
  <?php echo __('Uncheck to display only the essential settings for podcasting.'); ?>
153
  </div>
154
  <div>
155
+ <input type="checkbox" name="General[player_options]" value="1" <?php echo ($General['player_options']?' checked':''); ?> />
156
  <strong><?php echo __('Audio Player Options'); ?></strong> -
157
  <?php echo __('Select from 5 different web based audio flash players.'); ?>
158
  <span style="font-size: 85%;">(<?php echo __('feature will appear in left menu when enabled'); ?>)</span>
159
  </div>
160
  <div>
161
+ <input type="checkbox" name="General[channels]" value="1" <?php echo ($General['channels']?' checked':''); echo $ChannelsCheckbox; ?> />
162
  <strong><?php echo __('Custom Podcast Channels'); ?></strong> -
163
  <?php echo __('Manage multiple media files and/or formats to one blog post.'); ?>
164
  <span style="font-size: 85%;">(<?php echo __('feature will appear in left menu when enabled'); ?>)</span>
165
  </div>
166
  <div>
167
+ <input type="checkbox" name="General[cat_casting]" value="1" <?php echo ($General['cat_casting']?' checked':''); echo $CategoryCheckbox; ?> />
168
  <strong><?php echo __('Category Podcasting'); ?></strong> -
169
  <?php echo __('Manage category podcast feeds.'); ?>
170
  <span style="font-size: 85%;">(<?php echo __('feature will appear in left menu when enabled'); ?>)</span>
289
  (<?php echo __('Leave unchecked to use the first 250 characters of your blog post'); ?>)</p>
290
  <p style="margin-top: 15px;"><input id="episode_box_summary" class="episode_box_option" name="General[episode_box_summary]" type="checkbox" value="1"<?php if( !empty($General['episode_box_summary']) ) echo ' checked'; ?> /> <?php echo __('iTunes Summary Field'); ?>
291
  (<?php echo __('Leave unchecked to use your blog post'); ?>)</p>
292
+ <p style="margin-top: 15px;"><input id="episode_box_author" class="episode_box_option" name="General[episode_box_author]" type="checkbox" value="1"<?php if( !empty($General['episode_box_author']) ) echo ' checked'; ?> /> <?php echo __('iTunes Author Field'); ?>
293
+ (<?php echo __('Leave unchecked to the post author name'); ?>)</p>
294
  <p style="margin-top: 15px;"><input id="episode_box_explicit" class="episode_box_option" name="General[episode_box_explicit]" type="checkbox" value="1"<?php if( !empty($General['episode_box_explicit']) ) echo ' checked'; ?> /> <?php echo __('iTunes Explicit Field'); ?>
295
  (<?php echo __('Leave unchecked to use your feed\'s explicit setting'); ?>)</p>
296
 
367
  </select>
368
  <p><?php echo __('When enabled, the first or last media link found in the post content is automatically added as your podcast episode.'); ?></p>
369
  <p style="margin-bottom: 0;"><em><?php echo __('NOTE: Use this feature with caution. Links to media files could unintentionally become podcast episodes.'); ?></em></p>
370
+ <p><em><?php echo __('WARNING: Episodes created with this feature will <u>not</u> include Duration (total play time) information.'); ?></em></p>
371
+ </td>
372
+ </tr>
373
+ <?php
374
+ global $wp_rewrite;
375
+ if( $wp_rewrite->permalink_structure ) // Only display if permalinks is enabled in WordPress
376
+ {
377
+ ?>
378
+ <tr valign="top">
379
+ <th scope="row">
380
+ <?php echo __("Podcast Permalinks"); ?></th>
381
+ <td>
382
+ <select name="General[permalink_feeds_only]" class="bpp_input_med">
383
+ <?php
384
+ $options = array(0=>__('Default WordPress Behavior'), 1=>__('Match Feed Name to Page/Category') );
385
+
386
+ while( list($value,$desc) = each($options) )
387
+ echo "\t<option value=\"$value\"". ($General['permalink_feeds_only']==$value?' selected':''). ">$desc</option>\n";
388
+
389
+ ?>
390
+ </select>
391
+ <p><?php echo sprintf(__('When configured, %s/podcast/ is matched to page/category named \'podcast\'.'), get_bloginfo('home') ); ?></p>
392
  </td>
393
  </tr>
394
+ <?php
395
+ }
396
+ ?>
397
 
398
  </table>
399
  <?php
539
  ?>
540
  </select> <?php echo __('Notify (ping) iTunes when you publish a new episode.'); ?>
541
  <p><input name="TestiTunesPing" type="checkbox" value="1"<?php if( $OpenSSLSupport == false ) echo ' disabled'; ?> /> <?php echo __('Test Update iTunes Listing (recommended)'); ?></p>
542
+ <?php
543
+ $itunes_subscribe_url = ($FeedSettings?$FeedSettings['itunes_url']:$General['itunes_url']);
544
+ if( !empty($itunes_subscribe_url) )
545
+ {
546
  $ping_url = str_replace(
547
  array( 'https://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=',
548
  'http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=',
550
  'http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=',
551
  'https://www.itunes.com/podcast?id=',
552
  'http://www.itunes.com/podcast?id='),
553
+ 'https://phobos.apple.com/WebObjects/MZFinance.woa/wa/pingPodcast?id=', $itunes_subscribe_url);
554
  ?>
555
  <p><?php echo __('You may also update your iTunes listing by using the following link:'); ?> <a href="#" onclick="javascript: window.open('<?php echo $ping_url; ?>'); return false;" title="<?php echo __('Ping iTunes in New Window'); ?>"><?php echo __('Ping iTunes in New Window'); ?></a></p>
556
 
557
  <?php
558
+ if( preg_match('/id=(\d+)/', $itunes_subscribe_url, $matches) )
559
  {
560
  $FEEDID = $matches[1];
561
  $Logging = get_option('powerpress_log');
788
  }
789
  }
790
 
 
791
  ?>
792
 
793
  <h3><?php echo __('Appearance Settings'); ?></h3>
808
  echo "\t<option value=\"$value\"". ($General['display_player']==$value?' selected':''). ">$desc</option>\n";
809
 
810
  ?>
811
+ </select> (<?php echo __('where media player and download links will be displayed'); ?>)
812
+ <p><input name="General[display_player_excerpt]" type="checkbox" value="1" <?php if( !empty($General['display_player_excerpt']) ) echo 'checked '; ?>/> <?php echo __('Display media / links in:'); ?> <a href="http://codex.wordpress.org/Template_Tags/the_excerpt" title="<?php echo __('WordPress Excerpts'); ?>" target="_blank"><?php echo __('WordPress Excerpts'); ?></a> (<?php echo __('e.g. search results'); ?>)</p>
813
+ </td>
814
+ </tr>
815
+
816
+ <tr valign="top">
817
+ <th scope="row">
818
+ <?php echo __('PowerPress Shortcode'); ?></th>
819
+ <td>
820
+ <p>
821
+ <?php echo sprintf(__('The %s shortcode is used to position your media presentation (player and download links) exactly where you want within your Post or Page.'), '<code>[powerpress]</code>'); ?>
822
+ <?php echo __('Simply insert the code on a new line in your content like this:'); ?>
823
+ </p>
824
+ <div style="margin-left: 30px;">
825
+ <code>[powerpress]</code>
826
+ </div>
827
+ <p>
828
+ <?php echo sprintf(__('Please visit the %s page for additional options.'), '<a href="http://help.blubrry.com/blubrry-powerpress/shortcode/" target="_blank">'. __('PowerPress Shortcode') .'</a>' ); ?>
829
+ </p>
830
  </td>
831
  </tr>
832
 
842
 
843
  ?>
844
  </select>
845
+ (<?php echo __('select where to display media flash player or embed code'); ?>)
846
+ <p><input type="checkbox" name="General[display_player_disable_mobile]" value="1" <?php if( !empty($General['display_player_disable_mobile']) ) echo 'checked '; ?>/> <?php echo __('Disable Media Player for known mobile devices.'); ?></p>
847
  </td>
848
  </tr>
849
  </table>
powerpressadmin-customfeeds.php CHANGED
@@ -91,7 +91,7 @@ function powerpress_admin_customfeeds()
91
  <?php
92
 
93
 
94
- $Feeds = array('podcast'=>__('Podcast Feed') );
95
  if( isset($General['custom_feeds']['podcast']) )
96
  $Feeds = $General['custom_feeds'];
97
  else if( is_array($General['custom_feeds']) )
@@ -106,7 +106,7 @@ function powerpress_admin_customfeeds()
106
  $columns = powerpress_admin_customfeeds_columns();
107
  $hidden = array();
108
  if( $feed_slug == 'podcast' )
109
- $feed_title = __('Podcast Feed');
110
  $feed_title = wp_specialchars($feed_title);
111
  if( $count % 2 == 0 )
112
  echo '<tr valign="middle" class="alternate">';
@@ -141,6 +141,10 @@ function powerpress_admin_customfeeds()
141
  $actions = array();
142
  $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
143
  $actions['delete'] = "<a class='submitdelete' href='". admin_url() . wp_nonce_url("admin.php?page=powerpress/powerpressadmin_customfeeds.php&amp;action=powerpress-delete-feed&amp;feed_slug=$feed_slug", 'powerpress-delete-feed-' . $feed_slug) . "' onclick=\"if ( confirm('" . js_escape(sprintf( __("You are about to delete feed '%s'\n 'Cancel' to stop, 'OK' to delete."), $feed_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
 
 
 
 
144
  $action_count = count($actions);
145
  $i = 0;
146
  echo '<div class="row-actions">';
@@ -181,6 +185,10 @@ function powerpress_admin_customfeeds()
181
  ?>
182
  </tbody>
183
  </table>
 
 
 
 
184
  </div> <!-- col-right -->
185
 
186
  <div id="col-left">
91
  <?php
92
 
93
 
94
+ $Feeds = array('podcast'=>__('Podcast') );
95
  if( isset($General['custom_feeds']['podcast']) )
96
  $Feeds = $General['custom_feeds'];
97
  else if( is_array($General['custom_feeds']) )
106
  $columns = powerpress_admin_customfeeds_columns();
107
  $hidden = array();
108
  if( $feed_slug == 'podcast' )
109
+ $feed_title = __('Podcast');
110
  $feed_title = wp_specialchars($feed_title);
111
  if( $count % 2 == 0 )
112
  echo '<tr valign="middle" class="alternate">';
141
  $actions = array();
142
  $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
143
  $actions['delete'] = "<a class='submitdelete' href='". admin_url() . wp_nonce_url("admin.php?page=powerpress/powerpressadmin_customfeeds.php&amp;action=powerpress-delete-feed&amp;feed_slug=$feed_slug", 'powerpress-delete-feed-' . $feed_slug) . "' onclick=\"if ( confirm('" . js_escape(sprintf( __("You are about to delete feed '%s'\n 'Cancel' to stop, 'OK' to delete."), $feed_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
144
+ if( !isset($General['custom_feeds'][ $feed_slug ]) )
145
+ {
146
+ unset($actions['delete']);
147
+ }
148
  $action_count = count($actions);
149
  $i = 0;
150
  echo '<div class="row-actions">';
185
  ?>
186
  </tbody>
187
  </table>
188
+ <?php if( !isset($General['custom_feeds'][ $feed_slug ]) ) { ?>
189
+ <p><?php echo sprintf( __('Note: The default channel "Podcast" is currently using global PowerPress settings. Click %s to customize the default "Podcast" channel.'),
190
+ '<a href="'. admin_url('admin.php?page=powerpress/powerpressadmin_customfeeds.php&amp;action=powerpress-editfeed&amp;feed_slug=podcast') .'">'. __('Edit') .'</a>'); ?></p>
191
+ <?php } ?>
192
  </div> <!-- col-right -->
193
 
194
  <div id="col-left">
powerpressadmin-dashboard.php CHANGED
@@ -109,6 +109,9 @@ function powerpress_dashboard_stats_content()
109
 
110
  function powerpress_dashboard_setup()
111
  {
 
 
 
112
  $Settings = get_option('powerpress_general');
113
 
114
  if( isset($Settings['disable_dashboard_widget']) && $Settings['disable_dashboard_widget'] == 1 )
109
 
110
  function powerpress_dashboard_setup()
111
  {
112
+ if( !function_exists('wp_add_dashboard_widget') )
113
+ return;
114
+
115
  $Settings = get_option('powerpress_general');
116
 
117
  if( isset($Settings['disable_dashboard_widget']) && $Settings['disable_dashboard_widget'] == 1 )
powerpressadmin-diagnostics.php CHANGED
@@ -143,6 +143,7 @@
143
  $powerpress_diags['system_info']['success'] = true;
144
  $powerpress_diags['system_info']['php_version'] = phpversion();
145
  $powerpress_diags['system_info']['memory_limit'] = (int) ini_get('memory_limit');
 
146
 
147
  // testing:
148
  //$powerpress_diags['system_info']['memory_limit'] = -1;
@@ -210,6 +211,21 @@
210
  $powerpress_diags['system_info']['message2'] .= sprintf(__('We recommend that you have at least %dM (4M more that what is currently used) or more memory to accomodate all of your installed plugins.'), ceil($used)+4 );
211
  }
212
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  if( isset($_GET['Email']) && strlen($_GET['Email']) > 4 )
214
  {
215
  check_admin_referer('powerpress-diagnostics');
@@ -221,7 +237,7 @@
221
 
222
  function powerpressadmin_diagnostics_email($email)
223
  {
224
- global $powerpress_diags, $wpmu_version, $wp_version;
225
  $SettingsGeneral = get_option('powerpress_general');
226
 
227
  // First we need some basic information about the blog...
@@ -276,8 +292,10 @@
276
  $message .= " &nbsp; \t &nbsp; ". __('php_version:') .' '. $powerpress_diags['system_info']['php_version'] ."<br />\n";
277
  $message .= " &nbsp; \t &nbsp; ". __('memory_limit:') .' '. $powerpress_diags['system_info']['memory_limit'] ."M\n";
278
  $message .= " &nbsp; \t &nbsp; ". __('memory_used:') .' '. sprintf('%.01fM',$powerpress_diags['system_info']['memory_used']) ."<br />\n";
 
279
  $message .= " &nbsp; \t &nbsp; ". __('message:') .' '. $powerpress_diags['system_info']['message'] ."<br />\n";
280
  $message .= " &nbsp; \t &nbsp; ". __('message 2:') .' '. $powerpress_diags['system_info']['message2'] ."<br />\n";
 
281
 
282
  if( isset($_GET['ap']) && $_GET['ap'] )
283
  {
@@ -286,7 +304,7 @@
286
  $message .= '<strong>'.__('Active Plugins') ."</strong><br />\n";
287
  while( list($null,$plugin_path) = each($current_plugins) )
288
  {
289
- $plugin_data = get_plugin_data( rtrim(WP_PLUGIN_DIR, '/'). '\\/'. rtrim($plugin_path, '\\/'), false, false ); //Do not apply markup/translate as it'll be cached.
290
 
291
  $message .= " &nbsp; \t &nbsp; " . __('Title:') .' '. $plugin_data['Title']. "<br />\n";
292
  $message .= " &nbsp; \t &nbsp; " . __('Relative Path:') .' '. $plugin_path. "<br />\n";
@@ -313,6 +331,7 @@
313
  $headers .= "Content-Type: text/html\n";
314
 
315
  @wp_mail($email, sprintf(__('Blubrry PowerPress diagnostic results for %s'), get_bloginfo('name')), $message, $headers);
 
316
  }
317
 
318
  function powerpressadmin_diagnostics_is_writable($dir)
@@ -350,7 +369,7 @@
350
 
351
  function powerpressadmin_diagnostics()
352
  {
353
- global $powerpress_diags;
354
  $GeneralSettings = get_option('powerpress_general');
355
 
356
  if( empty($powerpress_diags) )
@@ -365,6 +384,16 @@
365
  <?php echo __('The Diagnostics page checks to see if your server is configured to support all of the available features in Blubrry PowerPress.'); ?>
366
  </p>
367
 
 
 
 
 
 
 
 
 
 
 
368
  <h3 style="margin-bottom: 0;"><?php echo __('Detecting Media Information'); ?></h3>
369
  <p style="margin: 0;">
370
  <?php echo __('The following test checks to see if your web server can make connections with other web servers to obtain file size and media duration information. The test checks to see if either the PHP cURL library is installed or the php.ini setting \'allow_url_fopen\' enabled.'); ?>
@@ -417,7 +446,7 @@
417
  </table>
418
 
419
  <h3 style="margin-bottom: 0;"><?php echo __('System Information'); ?></h3>
420
- <p style="margin: 0;"><?php echo __('The following test checks your version of PHP and memory usage.'); ?></p>
421
  <table class="form-table">
422
  <tr valign="top">
423
  <th scope="row">
@@ -426,6 +455,7 @@
426
  <td>
427
  <p><?php echo htmlspecialchars($powerpress_diags['system_info']['message']); ?></p>
428
  <p><?php echo htmlspecialchars($powerpress_diags['system_info']['message2']); ?></p>
 
429
  <?php if( $powerpress_diags['system_info']['warning'] ) { ?>
430
  <p><?php echo __('Contact your web hosting provider to inquire how to increase the PHP memory limit on your web server.'); ?></p>
431
  <?php } ?>
143
  $powerpress_diags['system_info']['success'] = true;
144
  $powerpress_diags['system_info']['php_version'] = phpversion();
145
  $powerpress_diags['system_info']['memory_limit'] = (int) ini_get('memory_limit');
146
+ $powerpress_diags['system_info']['temp_directory'] = get_temp_dir(); // Function available since WP2.5+
147
 
148
  // testing:
149
  //$powerpress_diags['system_info']['memory_limit'] = -1;
211
  $powerpress_diags['system_info']['message2'] .= sprintf(__('We recommend that you have at least %dM (4M more that what is currently used) or more memory to accomodate all of your installed plugins.'), ceil($used)+4 );
212
  }
213
 
214
+ if( empty($powerpress_diags['system_info']['temp_directory']) )
215
+ {
216
+ $powerpress_diags['system_info']['success'] = false;
217
+ $powerpress_diags['system_info']['message3'] = __('Error:') .' '. __('No temporary directory available.');
218
+ }
219
+ else if( is_dir($powerpress_diags['system_info']['temp_directory']) && is_writable($powerpress_diags['system_info']['temp_directory']) )
220
+ {
221
+ $powerpress_diags['system_info']['message3'] = sprintf(__('Temporary directory %s is writable.'), $powerpress_diags['system_info']['temp_directory']);
222
+ }
223
+ else
224
+ {
225
+ $powerpress_diags['system_info']['success'] = false;
226
+ $powerpress_diags['system_info']['message3'] = __('Error:') .' '. sprintf(__('Temporary directory %s is not writable.'), $powerpress_diags['system_info']['temp_directory']);
227
+ }
228
+
229
  if( isset($_GET['Email']) && strlen($_GET['Email']) > 4 )
230
  {
231
  check_admin_referer('powerpress-diagnostics');
237
 
238
  function powerpressadmin_diagnostics_email($email)
239
  {
240
+ global $powerpress_diags, $wpmu_version, $wp_version, $powerpress_diag_message;
241
  $SettingsGeneral = get_option('powerpress_general');
242
 
243
  // First we need some basic information about the blog...
292
  $message .= " &nbsp; \t &nbsp; ". __('php_version:') .' '. $powerpress_diags['system_info']['php_version'] ."<br />\n";
293
  $message .= " &nbsp; \t &nbsp; ". __('memory_limit:') .' '. $powerpress_diags['system_info']['memory_limit'] ."M\n";
294
  $message .= " &nbsp; \t &nbsp; ". __('memory_used:') .' '. sprintf('%.01fM',$powerpress_diags['system_info']['memory_used']) ."<br />\n";
295
+ $message .= " &nbsp; \t &nbsp; ". __('temp directory:') .' '. $powerpress_diags['system_info']['temp_directory'] ."<br />\n";
296
  $message .= " &nbsp; \t &nbsp; ". __('message:') .' '. $powerpress_diags['system_info']['message'] ."<br />\n";
297
  $message .= " &nbsp; \t &nbsp; ". __('message 2:') .' '. $powerpress_diags['system_info']['message2'] ."<br />\n";
298
+ $message .= " &nbsp; \t &nbsp; ". __('message 3:') .' '. $powerpress_diags['system_info']['message3'] ."<br />\n";
299
 
300
  if( isset($_GET['ap']) && $_GET['ap'] )
301
  {
304
  $message .= '<strong>'.__('Active Plugins') ."</strong><br />\n";
305
  while( list($null,$plugin_path) = each($current_plugins) )
306
  {
307
+ $plugin_data = get_plugin_data( rtrim(WP_PLUGIN_DIR, '/'). '/'. rtrim($plugin_path, '\\/'), false, false ); //Do not apply markup/translate as it'll be cached.
308
 
309
  $message .= " &nbsp; \t &nbsp; " . __('Title:') .' '. $plugin_data['Title']. "<br />\n";
310
  $message .= " &nbsp; \t &nbsp; " . __('Relative Path:') .' '. $plugin_path. "<br />\n";
331
  $headers .= "Content-Type: text/html\n";
332
 
333
  @wp_mail($email, sprintf(__('Blubrry PowerPress diagnostic results for %s'), get_bloginfo('name')), $message, $headers);
334
+ $powerpress_diag_message = $message;
335
  }
336
 
337
  function powerpressadmin_diagnostics_is_writable($dir)
369
 
370
  function powerpressadmin_diagnostics()
371
  {
372
+ global $powerpress_diags, $powerpress_diag_message;
373
  $GeneralSettings = get_option('powerpress_general');
374
 
375
  if( empty($powerpress_diags) )
384
  <?php echo __('The Diagnostics page checks to see if your server is configured to support all of the available features in Blubrry PowerPress.'); ?>
385
  </p>
386
 
387
+ <?php
388
+ if( !empty($powerpress_diag_message) )
389
+ {
390
+ ?>
391
+ <h3 style="margin-bottom: 2px;"><?php echo __('Diagnostics Email Message'); ?></h3>
392
+ <div style="border: 2px inset #000000; padding: 10px; margin-right: 20px; font-size: 85%;">
393
+ <?php echo $powerpress_diag_message; ?>
394
+ </div>
395
+ <?php } ?>
396
+
397
  <h3 style="margin-bottom: 0;"><?php echo __('Detecting Media Information'); ?></h3>
398
  <p style="margin: 0;">
399
  <?php echo __('The following test checks to see if your web server can make connections with other web servers to obtain file size and media duration information. The test checks to see if either the PHP cURL library is installed or the php.ini setting \'allow_url_fopen\' enabled.'); ?>
446
  </table>
447
 
448
  <h3 style="margin-bottom: 0;"><?php echo __('System Information'); ?></h3>
449
+ <p style="margin: 0;"><?php echo __('The following test checks your version of PHP, memory usage and temporary directory access.'); ?></p>
450
  <table class="form-table">
451
  <tr valign="top">
452
  <th scope="row">
455
  <td>
456
  <p><?php echo htmlspecialchars($powerpress_diags['system_info']['message']); ?></p>
457
  <p><?php echo htmlspecialchars($powerpress_diags['system_info']['message2']); ?></p>
458
+ <p><?php echo htmlspecialchars($powerpress_diags['system_info']['message3']); ?></p>
459
  <?php if( $powerpress_diags['system_info']['warning'] ) { ?>
460
  <p><?php echo __('Contact your web hosting provider to inquire how to increase the PHP memory limit on your web server.'); ?></p>
461
  <?php } ?>
powerpressadmin-editfeed.php CHANGED
@@ -186,7 +186,7 @@ function powerpress_admin_editfeed($feed_slug=false, $cat_ID =false)
186
  else if( $cat_ID )
187
  {
188
  $category = get_category_to_edit($cat_ID);
189
- $FeedTitle = sprintf( 'Edit Category Feed: %s', $FeedTitle, $category->name);
190
  echo sprintf('<input type="hidden" name="cat" value="%s" />', $cat_ID);
191
  }
192
 
@@ -222,7 +222,7 @@ function powerpress_admin_editfeed($feed_slug=false, $cat_ID =false)
222
  //powerpressadmin_edit_itunes_general($General);
223
  if( $feed_slug != 'podcast' )
224
  powerpressadmin_edit_itunes_general($General, $FeedSettings, $feed_slug, $cat_ID);
225
- powerpressadmin_edit_itunes_feed($FeedSettings, $General);
226
  ?>
227
  </div>
228
 
@@ -403,12 +403,20 @@ if( $feed_slug || $cat_ID )
403
  <?php _e("Feed Title"); ?>
404
  </th>
405
  <td>
406
- <input type="text" name="Feed[title]"style="width: 60%;" value="<?php echo $FeedSettings['title']; ?>" maxlength="250" />
407
  <?php if( $cat_ID ) { ?>
408
- (leave blank to use category title)
409
  <?php } else { ?>
410
  (leave blank to use blog title)
411
  <?php } ?>
 
 
 
 
 
 
 
 
412
  </td>
413
  </tr>
414
  <tr valign="top">
@@ -427,12 +435,17 @@ if( $feed_slug || $cat_ID )
427
 
428
  <tr valign="top">
429
  <th scope="row">
430
- <?php _e("Feed Landing Page"); ?> <br />
431
  </th>
432
  <td>
433
- <input type="text" name="Feed[url]"style="width: 60%;" value="<?php echo $FeedSettings['url']; ?>" maxlength="250" /> (optional)
 
 
 
 
 
434
  <?php if( $cat_ID ) { ?>
435
- <p>Leave blank to use category page: <?php echo get_category_link($cat_ID); ?></p>
436
  <?php } else { ?>
437
  <p>e.g. <?php echo get_bloginfo('home'); ?>/custom-page/</p>
438
  <?php } ?>
@@ -758,7 +771,7 @@ function powerpressadmin_edit_appearance_feed($General, $FeedSettings, $feed_sl
758
 
759
  }
760
 
761
- function powerpressadmin_edit_itunes_feed($FeedSettings, $General)
762
  {
763
  $SupportUploads = powerpressadmin_support_uploads();
764
  if( !isset($FeedSettings['itunes_subtitle']) )
@@ -979,7 +992,7 @@ while( list($value,$desc) = each($explicit) )
979
  </th>
980
  <td>
981
  <input type="text" name="Feed[email]" style="width: 60%;" value="<?php echo $FeedSettings['email']; ?>" maxlength="250" />
982
- <div>(iTunes will email this address when your podcast is accepted into the iTunes Directory.)</div>
983
  </td>
984
  </tr>
985
 
@@ -993,23 +1006,55 @@ while( list($value,$desc) = each($explicit) )
993
  <?php _e("iTunes New Feed URL"); ?></th>
994
  <td>
995
  <div id="new_feed_url_step_1" style="display: <?php echo ( !empty($FeedSettings['itunes_new_feed_url']) || !empty($FeedSettings['itunes_new_feed_url_podcast']) ?'none':'block'); ?>;">
996
- <p style="margin-top: 5px;"><a href="#" onclick="return powerpress_new_feed_url_prompt();">Click here</a> if you need to change the Feed URL for iTunes subscribers.</p>
997
  </div>
998
  <div id="new_feed_url_step_2" style="display: <?php echo ( !empty($FeedSettings['itunes_new_feed_url']) || !empty($FeedSettings['itunes_new_feed_url_podcast']) ?'block':'none'); ?>;">
999
- <p style="margin-top: 5px;"><strong>WARNING: Changes made here are permanent. If the New Feed URL entered is incorrect, you will lose subscribers and will no longer be able to update your listing in the iTunes Store.</strong></p>
1000
- <p><strong>DO NOT MODIFY THIS SETTING UNLESS YOU ABSOLUTELY KNOW WHAT YOU ARE DOING.</strong></p>
1001
  <p>
1002
- Apple recommends you maintain the &lt;itunes:new-feed-url&gt; tag in your feed for at least two weeks to ensure that most subscribers will receive the new New Feed URL.
1003
  </p>
1004
  <p>
1005
- Example URL: <?php echo get_feed_link( ( empty($feed_slug)?'podcast':$feed_slug) ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1006
  </p>
1007
  <p style="margin-bottom: 0;">
1008
  <label style="width: 25%; float:left; display:block; font-weight: bold;">New Feed URL</label>
1009
  <input type="text" name="Feed[itunes_new_feed_url]"style="width: 55%;" value="<?php echo $FeedSettings['itunes_new_feed_url']; ?>" maxlength="250" />
1010
  </p>
1011
  <p style="margin-left: 25%;margin-top: 0;font-size: 90%;">(Leave blank for no New Feed URL)</p>
 
1012
  <p>More information regarding the iTunes New Feed URL is available <a href="http://www.apple.com/itunes/whatson/podcasts/specs.html#changing" target="_blank" title="Apple iTunes Podcasting Specificiations">here</a>.</p>
 
 
 
 
 
 
 
 
 
 
 
1013
  </div>
1014
  </td>
1015
  </tr>
186
  else if( $cat_ID )
187
  {
188
  $category = get_category_to_edit($cat_ID);
189
+ $FeedTitle = sprintf( 'Edit Category Feed: %s', $category->name);
190
  echo sprintf('<input type="hidden" name="cat" value="%s" />', $cat_ID);
191
  }
192
 
222
  //powerpressadmin_edit_itunes_general($General);
223
  if( $feed_slug != 'podcast' )
224
  powerpressadmin_edit_itunes_general($General, $FeedSettings, $feed_slug, $cat_ID);
225
+ powerpressadmin_edit_itunes_feed($FeedSettings, $General, $feed_slug, $cat_ID);
226
  ?>
227
  </div>
228
 
403
  <?php _e("Feed Title"); ?>
404
  </th>
405
  <td>
406
+ <input type="text" name="Feed[title]"style="width: 60%;" value="<?php echo $FeedSettings['title']; ?>" maxlength="250" />
407
  <?php if( $cat_ID ) { ?>
408
+ (leave blank to use default category title)
409
  <?php } else { ?>
410
  (leave blank to use blog title)
411
  <?php } ?>
412
+ <?php if( $cat_ID ) {
413
+ $category = get_category_to_edit($cat_ID);
414
+ $CategoryName = htmlspecialchars($category->name);
415
+ ?>
416
+ <p><?php echo __('Default Category title:') .' '. get_bloginfo_rss('name') . ' &#187; '. $CategoryName; ?></p>
417
+ <?php } else { ?>
418
+ <p><?php echo __('Blog title:') .' '. get_bloginfo_rss('name'); ?></p>
419
+ <?php } ?>
420
  </td>
421
  </tr>
422
  <tr valign="top">
435
 
436
  <tr valign="top">
437
  <th scope="row">
438
+ <?php _e("Feed Landing Page URL"); ?> <br />
439
  </th>
440
  <td>
441
+ <input type="text" name="Feed[url]"style="width: 60%;" value="<?php echo $FeedSettings['url']; ?>" maxlength="250" />
442
+ <?php if( $cat_ID ) { ?>
443
+ (leave blank to use category page)
444
+ <?php } else { ?>
445
+ (leave blank to use home page)
446
+ <?php } ?>
447
  <?php if( $cat_ID ) { ?>
448
+ <p>Category page URL: <?php echo get_category_link($cat_ID); ?></p>
449
  <?php } else { ?>
450
  <p>e.g. <?php echo get_bloginfo('home'); ?>/custom-page/</p>
451
  <?php } ?>
771
 
772
  }
773
 
774
+ function powerpressadmin_edit_itunes_feed($FeedSettings, $General, $feed_slug=false, $cat_ID=false)
775
  {
776
  $SupportUploads = powerpressadmin_support_uploads();
777
  if( !isset($FeedSettings['itunes_subtitle']) )
992
  </th>
993
  <td>
994
  <input type="text" name="Feed[email]" style="width: 60%;" value="<?php echo $FeedSettings['email']; ?>" maxlength="250" />
995
+ <div>(<?php echo __('iTunes will email this address when your podcast is accepted into the iTunes Directory.'); ?>)</div>
996
  </td>
997
  </tr>
998
 
1006
  <?php _e("iTunes New Feed URL"); ?></th>
1007
  <td>
1008
  <div id="new_feed_url_step_1" style="display: <?php echo ( !empty($FeedSettings['itunes_new_feed_url']) || !empty($FeedSettings['itunes_new_feed_url_podcast']) ?'none':'block'); ?>;">
1009
+ <p style="margin-top: 5px;"><strong><a href="#" onclick="return powerpress_new_feed_url_prompt();"><?php echo __('Set iTunes New Feed URL'); ?></a></strong></p>
1010
  </div>
1011
  <div id="new_feed_url_step_2" style="display: <?php echo ( !empty($FeedSettings['itunes_new_feed_url']) || !empty($FeedSettings['itunes_new_feed_url_podcast']) ?'block':'none'); ?>;">
1012
+ <p style="margin-top: 5px;"><strong><?php echo __('WARNING: Changes made here are permanent. If the New Feed URL entered is incorrect, you will lose subscribers and will no longer be able to update your listing in the iTunes Store.'); ?></strong></p>
1013
+ <p><strong><?php echo __('DO NOT MODIFY THIS SETTING UNLESS YOU ABSOLUTELY KNOW WHAT YOU ARE DOING.'); ?></strong></p>
1014
  <p>
1015
+ <?php echo htmlspecialchars( __('Apple recommends you maintain the <itunes:new-feed-url> tag in your feed for at least two weeks to ensure that most subscribers will receive the new New Feed URL.') ); ?>
1016
  </p>
1017
  <p>
1018
+ <?php
1019
+ $FeedName = 'Main RSS2 feed';
1020
+ $FeedURL = get_feed_link('rss2');
1021
+ if( $cat_ID )
1022
+ {
1023
+ $category = get_category_to_edit($cat_ID);
1024
+ $FeedName = sprintf( __('%s category feed'), htmlspecialchars($category->name) );
1025
+ $FeedURL = get_category_feed_link($cat_ID);
1026
+ }
1027
+ else if( $feed_slug )
1028
+ {
1029
+ if( !empty($General['custom_feeds'][ $feed_slug ]) )
1030
+ $FeedName = $General['custom_feeds'][ $feed_slug ];
1031
+ else
1032
+ $FeedName = __('Podcast');
1033
+ $FeedName = trim($FeedName).' '.__('feed');
1034
+ $FeedURL = get_feed_link($feed_slug);
1035
+ }
1036
+
1037
+ echo sprintf(__('The New Feed URL value below will be applied to the %s (%s).'), $FeedName, $FeedURL);
1038
+ ?>
1039
  </p>
1040
  <p style="margin-bottom: 0;">
1041
  <label style="width: 25%; float:left; display:block; font-weight: bold;">New Feed URL</label>
1042
  <input type="text" name="Feed[itunes_new_feed_url]"style="width: 55%;" value="<?php echo $FeedSettings['itunes_new_feed_url']; ?>" maxlength="250" />
1043
  </p>
1044
  <p style="margin-left: 25%;margin-top: 0;font-size: 90%;">(Leave blank for no New Feed URL)</p>
1045
+
1046
  <p>More information regarding the iTunes New Feed URL is available <a href="http://www.apple.com/itunes/whatson/podcasts/specs.html#changing" target="_blank" title="Apple iTunes Podcasting Specificiations">here</a>.</p>
1047
+ <p>
1048
+ <?php
1049
+ if( !$cat_ID && !$feed_slug )
1050
+ {
1051
+ if( empty($General['channels']) )
1052
+ echo sprintf(__('Please activate the \'Custom Podcast Channels\' Advanced Option to set the new-feed-url for your podcast only feed (%s)'), get_feed_link('podcast') );
1053
+ else
1054
+ echo sprintf(__('Please navigate to the \'Custom Podcast Channels\' section to set the new-feed-url for your podcast only feed (%s)'), get_feed_link('podcast') );
1055
+ }
1056
+ ?>
1057
+ </p>
1058
  </div>
1059
  </td>
1060
  </tr>
powerpressadmin-metabox.php CHANGED
@@ -13,9 +13,11 @@ function powerpress_meta_box($object, $box)
13
  $EnclosureLength = '';
14
  $Embed = '';
15
  $CoverImage = '';
 
16
  $iTunesKeywords = '';
17
  $iTunesSubtitle = '';
18
  $iTunesSummary = '';
 
19
  $iTunesExplicit = '';
20
  $NoPlayer = false;
21
  $NoLinks = false;
@@ -63,6 +65,8 @@ function powerpress_meta_box($object, $box)
63
  $iTunesSubtitle = $ExtraData['subtitle'];
64
  if( isset($ExtraData['summary']) )
65
  $iTunesSummary = $ExtraData['summary'];
 
 
66
  if( isset($ExtraData['no_player']) )
67
  $NoPlayer = $ExtraData['no_player'];
68
  if( isset($ExtraData['no_links']) )
@@ -74,8 +78,7 @@ function powerpress_meta_box($object, $box)
74
  }
75
  }
76
 
77
- $iTunesDuration = false;
78
- if( $FeedSlug == 'podcast' && !$iTunesDuration )
79
  $iTunesDuration = get_post_meta($object->ID, 'itunes:duration', true);
80
 
81
  if( $iTunesDuration )
@@ -273,7 +276,7 @@ function powerpress_meta_box($object, $box)
273
  <?php
274
  }
275
 
276
- if( $GeneralSettings['episode_box_summary'] )
277
  {
278
  ?>
279
  <div class="powerpress_row">
@@ -288,6 +291,21 @@ function powerpress_meta_box($object, $box)
288
  <?php
289
  }
290
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
291
  if( $GeneralSettings['episode_box_explicit'] )
292
  {
293
  ?>
13
  $EnclosureLength = '';
14
  $Embed = '';
15
  $CoverImage = '';
16
+ $iTunesDuration = false;
17
  $iTunesKeywords = '';
18
  $iTunesSubtitle = '';
19
  $iTunesSummary = '';
20
+ $iTunesAuthor = '';
21
  $iTunesExplicit = '';
22
  $NoPlayer = false;
23
  $NoLinks = false;
65
  $iTunesSubtitle = $ExtraData['subtitle'];
66
  if( isset($ExtraData['summary']) )
67
  $iTunesSummary = $ExtraData['summary'];
68
+ if( isset($ExtraData['author']) )
69
+ $iTunesAuthor = $ExtraData['author'];
70
  if( isset($ExtraData['no_player']) )
71
  $NoPlayer = $ExtraData['no_player'];
72
  if( isset($ExtraData['no_links']) )
78
  }
79
  }
80
 
81
+ if( $FeedSlug == 'podcast' && !$iTunesDuration ) // Get the iTunes duration the old way (very old way)
 
82
  $iTunesDuration = get_post_meta($object->ID, 'itunes:duration', true);
83
 
84
  if( $iTunesDuration )
276
  <?php
277
  }
278
 
279
+ if( !empty($GeneralSettings['episode_box_summary']) )
280
  {
281
  ?>
282
  <div class="powerpress_row">
291
  <?php
292
  }
293
 
294
+ if( !empty($GeneralSettings['episode_box_author']) )
295
+ {
296
+ ?>
297
+ <div class="powerpress_row">
298
+ <label for "Powerpress[<?php echo $FeedSlug; ?>][author]"><?php echo __('iTunes Author'); ?></label>
299
+ <div class="powerpress_row_content">
300
+ <input id="powerpress_author_<?php echo $FeedSlug; ?>" name="Powerpress[<?php echo $FeedSlug; ?>][author]" value="<?php echo htmlspecialchars($iTunesAuthor); ?>" style="width: 60%; font-size: 90%;" size="250" />
301
+ </div>
302
+ <div class="powerpress_row_content">
303
+ <em><?php echo __('Leave blank to use post author name.'); ?></em>
304
+ </div>
305
+ </div>
306
+ <?php
307
+ }
308
+
309
  if( $GeneralSettings['episode_box_explicit'] )
310
  {
311
  ?>
powerpressadmin-mt.php CHANGED
@@ -299,7 +299,7 @@ if( !function_exists('add_action') )
299
  $results = powerpress_get_mt_episodes();
300
  $Settings = powerpress_get_settings('powerpress_general', false);
301
  if( !isset($Settings['custom_feeds']['podcast']) )
302
- $Settings['custom_feeds']['podcast'] = 'Podcast Feed (default)';
303
 
304
  if( $results )
305
  {
@@ -389,6 +389,36 @@ function no_import_all()
389
  }
390
  }
391
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
  </script>
393
  <h2><?php echo __("Import Episodes"); ?></h2>
394
  <?php
@@ -439,6 +469,7 @@ else
439
 
440
  $StrandedEpisodes = 0;
441
  $ImportableEpisodes = 0;
 
442
 
443
  $count = 0;
444
  while( list($post_id, $import_data) = each($results ) )
@@ -532,6 +563,8 @@ else
532
  $index = 1;
533
  while( list($episode_index,$episode_data) = each($import_data['enclosures']) )
534
  {
 
 
535
  $Parts = parse_url($episode_data['url']);
536
  $filename = substr($Parts['path'], strrpos($Parts['path'], '/')+1 );
537
  if( $filename == '' )
@@ -660,7 +693,28 @@ else
660
  </table>
661
 
662
  <p>Importable episodes highlighted in <span style="color: #CC0000; font-weight: bold;">red</span> with asterisks *.</p>
663
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
664
  <p>Types of media found:
665
  <?php
666
  $comma = false;
299
  $results = powerpress_get_mt_episodes();
300
  $Settings = powerpress_get_settings('powerpress_general', false);
301
  if( !isset($Settings['custom_feeds']['podcast']) )
302
+ $Settings['custom_feeds'] = array_merge( array('podcast'=> 'Podcast Feed (default)'), $Settings['custom_feeds'] );
303
 
304
  if( $results )
305
  {
389
  }
390
  }
391
 
392
+ function select_all(index,value)
393
+ {
394
+ var NoImport = [];
395
+ var Inputs = document.getElementsByTagName('input');
396
+ for (var i = 0; i < Inputs.length; i++)
397
+ {
398
+ var Elem = Inputs[i];
399
+ if( Elem.type == 'radio' && Elem.value == value )
400
+ {
401
+ ElemIndex = Elem.id.substring( Elem.id.lastIndexOf('_')+1);
402
+ if( ElemIndex == index )
403
+ Elem.checked = true;
404
+ else if( Elem.checked && Elem.value != '' )
405
+ NoImport.push( Elem.id );
406
+ }
407
+ }
408
+ for (var i = 0; i < Inputs.length; i++)
409
+ {
410
+ var Elem = Inputs[i];
411
+ if( Elem.type == 'radio' && Elem.value == '' )
412
+ {
413
+ for (var j = 0; j < NoImport.length; j++)
414
+ {
415
+ if( NoImport[j] == Elem.id )
416
+ Elem.checked = true;
417
+ }
418
+ }
419
+ }
420
+ }
421
+
422
  </script>
423
  <h2><?php echo __("Import Episodes"); ?></h2>
424
  <?php
469
 
470
  $StrandedEpisodes = 0;
471
  $ImportableEpisodes = 0;
472
+ $MaxFileIndex = 1;
473
 
474
  $count = 0;
475
  while( list($post_id, $import_data) = each($results ) )
563
  $index = 1;
564
  while( list($episode_index,$episode_data) = each($import_data['enclosures']) )
565
  {
566
+ if( $index > $MaxFileIndex )
567
+ $MaxFileIndex = $index;
568
  $Parts = parse_url($episode_data['url']);
569
  $filename = substr($Parts['path'], strrpos($Parts['path'], '/')+1 );
570
  if( $filename == '' )
693
  </table>
694
 
695
  <p>Importable episodes highlighted in <span style="color: #CC0000; font-weight: bold;">red</span> with asterisks *.</p>
696
+ <p style="margin-bottom: 0; padding-bottom: 0;">Select Only:</p>
697
+ <?php
698
+ if( $results['feeds_required'] < 1 )
699
+ $results['feeds_required'] = 1;
700
+
701
+ for( $number = 0; $number < $MaxFileIndex; $number++ )
702
+ {
703
+ ?>
704
+ <p style="margin: 0 0 0 40px; padding: 0;">
705
+ File <?php echo ($number+1); ?>:
706
+ <?php
707
+ while( list($feed_slug,$feed_title) = each($Settings['custom_feeds']) )
708
+ {
709
+ echo '<a href="javascript:void()" onclick="select_all('. $number .',\''. $feed_slug .'\');return false;">'. htmlspecialchars($feed_title) .'</a> | ';
710
+ }
711
+ reset($Settings['custom_feeds']);
712
+ ?>
713
+ <a href="javascript:void()" onclick="select_all(<?php echo $number; ?>,'');return false;">No Import</a>
714
+ </p>
715
+ <?php
716
+ }
717
+ ?>
718
  <p>Types of media found:
719
  <?php
720
  $comma = false;
powerpressadmin-player-page.php CHANGED
@@ -461,7 +461,7 @@ function audio_player_defaults()
461
  <td>
462
  <div id="player_preview">
463
  <object type="application/x-shockwave-flash" data="<?php echo powerpressplayer_get_root_url();?>audio-player.swf" id="audioplayer1" height="24" width="<?php echo $PlayerSettings['width']; ?>">
464
- <param name="movie" value="<?php echo powerpressplayer_get_root_url();?>/audio-player.swf" />
465
  <param name="FlashVars" value="playerID=1&amp;soundFile=<?php echo $Audio['audio-player']; ?><?php echo $flashvars;?>" />
466
  <param name="quality" value="high" />
467
  <param name="menu" value="false" />
461
  <td>
462
  <div id="player_preview">
463
  <object type="application/x-shockwave-flash" data="<?php echo powerpressplayer_get_root_url();?>audio-player.swf" id="audioplayer1" height="24" width="<?php echo $PlayerSettings['width']; ?>">
464
+ <param name="movie" value="<?php echo powerpressplayer_get_root_url();?>audio-player.swf" />
465
  <param name="FlashVars" value="playerID=1&amp;soundFile=<?php echo $Audio['audio-player']; ?><?php echo $flashvars;?>" />
466
  <param name="quality" value="high" />
467
  <param name="menu" value="false" />
powerpressadmin-podpress.php CHANGED
@@ -4,15 +4,58 @@
4
  if( !function_exists('add_action') )
5
  die("access denied.");
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  function powerpress_get_podpress_episodes($hide_errors=true)
8
  {
9
  global $wpdb;
10
 
11
  $PodpressSettings = get_option('podPress_config');
12
  if( !$PodpressSettings )
13
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  $media_url = $PodpressSettings['mediaWebPath'];
15
- if( $media_url && substr($media_url, 0, -1) != '/' )
16
  $media_url .= '/'; // Make sure the URL has a trailing slash
17
 
18
 
@@ -33,7 +76,7 @@ if( !function_exists('add_action') )
33
  while( list($null,$row) = each($results_data) )
34
  {
35
  //$return = $row;
36
- $podpress_data = unserialize($row['meta_value']);
37
  if( !$podpress_data )
38
  {
39
  $podpress_data_serialized = powerpress_repair_serialize( $row['meta_value'] );
@@ -51,6 +94,18 @@ if( !function_exists('add_action') )
51
  $podpress_data = $podpress_data_two;
52
  }
53
  }
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
  if( $podpress_data )
56
  {
@@ -67,17 +122,23 @@ if( !function_exists('add_action') )
67
  {
68
  if( trim($episode_data['URI']) != '' )
69
  {
 
 
 
 
 
 
 
70
  $clean_data[ $episode_index ] = array();
71
- if( strtolower(substr($episode_data['URI'], 0, 4)) == 'http' )
72
- $clean_data[ $episode_index ]['url'] = $episode_data['URI'];
73
- else
74
- $clean_data[ $episode_index ]['url'] = $media_url . $episode_data['URI'];
75
  $clean_data[ $episode_index ]['size'] = $episode_data['size'];
76
  if( trim($episode_data['duration']) && $episode_data['duration'] != 'UNKNOWN' )
77
  $clean_data[ $episode_index ]['duration'] = powerpress_readable_duration($episode_data['duration'], true);
78
  $ContentType = powerpress_get_contenttype( $episode_data['URI'] );
79
  if( $ContentType )
80
  $clean_data[ $episode_index ]['type'] = trim($ContentType);
 
 
81
  }
82
  }
83
 
@@ -181,15 +242,21 @@ if( !function_exists('add_action') )
181
  {
182
  $EpisodeData = $PodPressData[ $post_id ]['podpress_data'][ $podpress_index ];
183
 
184
- if( $EpisodeData['size'] == '' || $EpisodeData['size'] == 'UNKNOWN' ) // Get the content length
185
  {
186
  $headers = wp_get_http_headers($EpisodeData['url']);
187
  if( $headers && $headers['content-length'] )
188
  $EpisodeData['size'] = (int) $headers['content-length'];
189
  }
190
- $EnclosureData = trim($EpisodeData['url']) . "\n" . trim($EpisodeData['size']) . "\n". trim($EpisodeData['type']);
191
- if( $EpisodeData['duration'] )
192
- $EnclosureData .= "\n".serialize( array('duration'=>$EpisodeData['duration']) );
 
 
 
 
 
 
193
 
194
  if( $feed_slug == 'podcast' )
195
  add_post_meta($post_id, 'enclosure', $EnclosureData, true);
@@ -252,7 +319,7 @@ if( !function_exists('add_action') )
252
  $data['feed-'.$feed_slug] = 'Feed: ('.$feed_slug.')';
253
  }
254
  }
255
- $data['exclude'] = 'No Import';
256
 
257
  return $data;
258
  }
@@ -305,6 +372,10 @@ if( !function_exists('add_action') )
305
  .column-post-date {
306
  width: 80px;
307
  }
 
 
 
 
308
  </style>
309
  <script language="javascript">
310
 
@@ -344,6 +415,50 @@ function check_radio_selection(obj, PostID, FileIndex)
344
  return true;
345
  }
346
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
347
  </script>
348
  <h2><?php echo __("Import PodPress Episodes"); ?></h2>
349
  <?php
@@ -422,7 +537,7 @@ function check_radio_selection(obj, PostID, FileIndex)
422
  if( !$enclosure_data )
423
  continue;
424
 
425
- list($EnclosureURL, $EnclosureSize, $EnclosureType, $Serialized) = explode("\n", $enclosure_data);
426
  if( $EnclosureURL )
427
  {
428
  $CurrentEnclosures[ $feed_slug ] = array();
@@ -458,9 +573,6 @@ function check_radio_selection(obj, PostID, FileIndex)
458
  reset($Settings['custom_feeds']);
459
  }
460
 
461
- if( $feed_slug == 'podcast' )
462
- $feed_title = 'Podcast Feed (default)';
463
- $feed_title = wp_specialchars($feed_title);
464
  if( $count % 2 == 0 )
465
  echo '<tr valign="middle" class="alternate">';
466
  else
@@ -496,19 +608,19 @@ function check_radio_selection(obj, PostID, FileIndex)
496
  $filename = substr($Parts['path'], strrpos($Parts['path'], '/')+1 );
497
  echo "File&nbsp;$index:&nbsp;";
498
 
499
- if( !$episode_data['not_podpress'] && !$episode_data['imported'] )
500
  {
501
  echo '<span style="color: #CC0000; font-weight: bold; cursor:pointer;" onclick="alert(\'File: '. $filename .'\nURL: '. $episode_data['url'] .'\')">';
502
  $AllowCleanup = false;
503
  $StrandedEpisodes++;
504
  }
505
- else if( !$episode_data['not_podpress'] && $episode_data['imported'] )
506
  echo '<span style="color: green; font-weight: bold; cursor:pointer;" onclick="alert(\'File: '. $filename .'\nURL: '. $episode_data['url'] .'\')">';
507
 
508
- if( !$episode_data['not_podpress'] && !$episode_data['imported'] )
509
  echo '*';
510
  echo $filename;
511
- if( !$episode_data['not_podpress'] )
512
  echo '</span>';
513
 
514
  echo '<br/>';
@@ -551,7 +663,7 @@ function check_radio_selection(obj, PostID, FileIndex)
551
  echo "File $index: ";
552
  if( $CurrentEnclosures[$feed_slug]['url'] == $episode_data['url'] )
553
  {
554
- if( $CurrentEnclosures[$feed_slug]['present'] )
555
  echo '<strong style="color: green;">present</strong>';
556
  else
557
  echo '<strong style="color: green;">imported</strong>';
@@ -610,8 +722,28 @@ function check_radio_selection(obj, PostID, FileIndex)
610
  </tbody>
611
  </table>
612
  <p>Importable PodPress episodes highlighted in <span style="color: #CC0000; font-weight: bold;">red</span> with asterisks *.</p>
613
-
614
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
615
  }
616
 
617
  if( $StrandedEpisodes )
@@ -692,10 +824,24 @@ function check_radio_selection(obj, PostID, FileIndex)
692
  <input type="button" name="Submit" id="powerpress_import_button" class="button-primary" value="Import Episodes" onclick="alert('We found blog posts that have <?php echo $results['feeds_required']; ?> media files.\n\nYou will need to create <?php echo ( $results['feeds_required'] - count($Settings['custom_feeds']) ); ?> more Custom Feed<?php if( ( $results['feeds_required'] - count($Settings['custom_feeds']) ) > 1 ) echo 's'; ?> in order to continue. ');" />
693
  </p>
694
 
 
 
695
  <?php
696
  }
697
  ?>
698
- <!-- start footer -->
 
 
 
 
 
 
 
 
 
 
 
 
699
  <?php
700
  }
701
 
4
  if( !function_exists('add_action') )
5
  die("access denied.");
6
 
7
+ function powerpress_only_include_ext($url)
8
+ {
9
+ if( isset($_GET['include_only_ext']) && trim($_GET['include_only_ext']) != '' )
10
+ {
11
+ global $powerpress_only_include_ext_array;
12
+ if( !isset($powerpress_only_include_ext_array) )
13
+ {
14
+ $extensions = strtolower(preg_replace("/\s/", '', $_GET['include_only_ext']));
15
+ $powerpress_only_include_ext_array = explode(',', trim($extensions, ',') );
16
+ }
17
+
18
+ $partsURL = @parse_url( trim($url) );
19
+ if( !$partsURL )
20
+ return false;
21
+ $filename = substr($partsURL['path'], strrpos($partsURL['path'], '/')+1 );
22
+ $partsFile = pathinfo($filename);
23
+
24
+ if( in_array( strtolower($partsFile['extension']), $powerpress_only_include_ext_array ) )
25
+ {
26
+ return true;
27
+ }
28
+ return false;
29
+ }
30
+
31
+ return true; // we include all extensions otherwise
32
+ }
33
+
34
  function powerpress_get_podpress_episodes($hide_errors=true)
35
  {
36
  global $wpdb;
37
 
38
  $PodpressSettings = get_option('podPress_config');
39
  if( !$PodpressSettings )
40
+ {
41
+ $PodpressSettings = array();
42
+ $PodpressSettings['mediaWebPath'] = '';
43
+ $powerpress_settings = get_option('powerpress_general');
44
+ if( !empty($powerpress_settings['default_url']) )
45
+ {
46
+ $PodpressSettings['mediaWebPath'] = $powerpress_settings['default_url'];
47
+ powerpress_page_message_add_notice( sprintf(__('Unable to detect PodPress media URL setting. Using the PowerPress setting "Default Media URL" (%s) instead.'), $PodpressSettings['mediaWebPath']) );
48
+ }
49
+ else
50
+ {
51
+ // We need to print a warning that they need to configure their podPress settings as the settings are no longer found in the database.
52
+ powerpress_page_message_add_error( __('Unable to detect PodPress media URL setting. Please set the "Default Media URL" setting in PowerPress to properly import podcast episodes.') );
53
+ }
54
+ }
55
+
56
+
57
  $media_url = $PodpressSettings['mediaWebPath'];
58
+ if( substr($media_url, 0, -1) != '/' )
59
  $media_url .= '/'; // Make sure the URL has a trailing slash
60
 
61
 
76
  while( list($null,$row) = each($results_data) )
77
  {
78
  //$return = $row;
79
+ $podpress_data = @unserialize($row['meta_value']);
80
  if( !$podpress_data )
81
  {
82
  $podpress_data_serialized = powerpress_repair_serialize( $row['meta_value'] );
94
  $podpress_data = $podpress_data_two;
95
  }
96
  }
97
+ else if( is_string($podpress_data) )
98
+ {
99
+ // May have been double serialized...
100
+ $podpress_unserialized = @unserialize($podpress_data);
101
+ if( !$podpress_unserialized )
102
+ {
103
+ $podpress_data_serialized = powerpress_repair_serialize( $podpress_data );
104
+ $podpress_unserialized = @unserialize($podpress_data_serialized);
105
+ }
106
+
107
+ $podpress_data = $podpress_unserialized;
108
+ }
109
 
110
  if( $podpress_data )
111
  {
122
  {
123
  if( trim($episode_data['URI']) != '' )
124
  {
125
+ $MediaURL = $episode_data['URI'];
126
+ if( strtolower(substr($MediaURL, 0, 4)) != 'http' )
127
+ $MediaURL = $media_url . rtrim($episode_data['URI'], '/');
128
+
129
+ if( !powerpress_only_include_ext($MediaURL) ) // Skip this media type
130
+ continue;
131
+
132
  $clean_data[ $episode_index ] = array();
133
+ $clean_data[ $episode_index ]['url'] = $MediaURL;
 
 
 
134
  $clean_data[ $episode_index ]['size'] = $episode_data['size'];
135
  if( trim($episode_data['duration']) && $episode_data['duration'] != 'UNKNOWN' )
136
  $clean_data[ $episode_index ]['duration'] = powerpress_readable_duration($episode_data['duration'], true);
137
  $ContentType = powerpress_get_contenttype( $episode_data['URI'] );
138
  if( $ContentType )
139
  $clean_data[ $episode_index ]['type'] = trim($ContentType);
140
+ if( !empty($episode_data['previewImage']) )
141
+ $clean_data[ $episode_index ]['image'] = $episode_data['previewImage'];
142
  }
143
  }
144
 
242
  {
243
  $EpisodeData = $PodPressData[ $post_id ]['podpress_data'][ $podpress_index ];
244
 
245
+ if( $EpisodeData['size'] == '' || !is_int($EpisodeData['size']) ) // Get the content length
246
  {
247
  $headers = wp_get_http_headers($EpisodeData['url']);
248
  if( $headers && $headers['content-length'] )
249
  $EpisodeData['size'] = (int) $headers['content-length'];
250
  }
251
+ $EnclosureData = trim($EpisodeData['url']) . "\n" . trim($EpisodeData['size']) . "\n". trim($EpisodeData['type']);
252
+ $Serialized = array();
253
+ if( !empty($EpisodeData['duration']) )
254
+ $Serialized['duration'] = $EpisodeData['duration'];
255
+ if( !empty($EpisodeData['image']) )
256
+ $Serialized['image'] = $EpisodeData['image'];
257
+
258
+ if( count($Serialized) > 0 )
259
+ $EnclosureData .= "\n".serialize($Serialized);
260
 
261
  if( $feed_slug == 'podcast' )
262
  add_post_meta($post_id, 'enclosure', $EnclosureData, true);
319
  $data['feed-'.$feed_slug] = 'Feed: ('.$feed_slug.')';
320
  }
321
  }
322
+ $data['exclude'] = '<a href="#" onclick="no_import_all();return false;">No Import</a>';
323
 
324
  return $data;
325
  }
372
  .column-post-date {
373
  width: 80px;
374
  }
375
+ label {
376
+ float: left;
377
+ width: 160px;
378
+ }
379
  </style>
380
  <script language="javascript">
381
 
415
  return true;
416
  }
417
 
418
+ function no_import_all()
419
+ {
420
+ if( !confirm('Select "No Import" option for all media files?') )
421
+ return;
422
+
423
+ var Inputs = document.getElementsByTagName('input');
424
+ for (var i = 0; i < Inputs.length; i++)
425
+ {
426
+ var Elem = Inputs[i];
427
+ if( Elem.type == 'radio' && Elem.value == '' )
428
+ Elem.checked = true;
429
+ }
430
+ }
431
+
432
+ function select_all(index,value)
433
+ {
434
+ var NoImport = [];
435
+ var Inputs = document.getElementsByTagName('input');
436
+ for (var i = 0; i < Inputs.length; i++)
437
+ {
438
+ var Elem = Inputs[i];
439
+ if( Elem.type == 'radio' && Elem.value == value )
440
+ {
441
+ ElemIndex = Elem.id.substring( Elem.id.lastIndexOf('_')+1);
442
+ if( ElemIndex == index )
443
+ Elem.checked = true;
444
+ else if( Elem.checked && Elem.value != '' )
445
+ NoImport.push( Elem.id );
446
+ }
447
+ }
448
+ for (var i = 0; i < Inputs.length; i++)
449
+ {
450
+ var Elem = Inputs[i];
451
+ if( Elem.type == 'radio' && Elem.value == '' )
452
+ {
453
+ for (var j = 0; j < NoImport.length; j++)
454
+ {
455
+ if( NoImport[j] == Elem.id )
456
+ Elem.checked = true;
457
+ }
458
+ }
459
+ }
460
+ }
461
+
462
  </script>
463
  <h2><?php echo __("Import PodPress Episodes"); ?></h2>
464
  <?php
537
  if( !$enclosure_data )
538
  continue;
539
 
540
+ @list($EnclosureURL, $EnclosureSize, $EnclosureType, $Serialized) = explode("\n", $enclosure_data);
541
  if( $EnclosureURL )
542
  {
543
  $CurrentEnclosures[ $feed_slug ] = array();
573
  reset($Settings['custom_feeds']);
574
  }
575
 
 
 
 
576
  if( $count % 2 == 0 )
577
  echo '<tr valign="middle" class="alternate">';
578
  else
608
  $filename = substr($Parts['path'], strrpos($Parts['path'], '/')+1 );
609
  echo "File&nbsp;$index:&nbsp;";
610
 
611
+ if( empty($episode_data['not_podpress']) && empty($episode_data['imported']) )
612
  {
613
  echo '<span style="color: #CC0000; font-weight: bold; cursor:pointer;" onclick="alert(\'File: '. $filename .'\nURL: '. $episode_data['url'] .'\')">';
614
  $AllowCleanup = false;
615
  $StrandedEpisodes++;
616
  }
617
+ else if( empty($episode_data['not_podpress']) && $episode_data['imported'] )
618
  echo '<span style="color: green; font-weight: bold; cursor:pointer;" onclick="alert(\'File: '. $filename .'\nURL: '. $episode_data['url'] .'\')">';
619
 
620
+ if( empty($episode_data['not_podpress']) && empty($episode_data['imported']) )
621
  echo '*';
622
  echo $filename;
623
+ if( empty($episode_data['not_podpress']) )
624
  echo '</span>';
625
 
626
  echo '<br/>';
663
  echo "File $index: ";
664
  if( $CurrentEnclosures[$feed_slug]['url'] == $episode_data['url'] )
665
  {
666
+ if( !empty($CurrentEnclosures[$feed_slug]['present']) )
667
  echo '<strong style="color: green;">present</strong>';
668
  else
669
  echo '<strong style="color: green;">imported</strong>';
722
  </tbody>
723
  </table>
724
  <p>Importable PodPress episodes highlighted in <span style="color: #CC0000; font-weight: bold;">red</span> with asterisks *.</p>
725
+ <p style="margin-bottom: 0; padding-bottom: 0;">Select Only:</p>
726
  <?php
727
+ if( $results['feeds_required'] < 1 )
728
+ $results['feeds_required'] = 1;
729
+
730
+ for( $number = 0; $number < $results['feeds_required']; $number++ )
731
+ {
732
+ ?>
733
+ <p style="margin: 0 0 0 40px; padding: 0;">
734
+ File <?php echo ($number+1); ?>:
735
+ <?php
736
+ while( list($feed_slug,$feed_title) = each($Settings['custom_feeds']) )
737
+ {
738
+ echo '<a href="javascript:void()" onclick="select_all('. $number .',\''. $feed_slug .'\');return false;">'. htmlspecialchars($feed_title) .'</a> | ';
739
+ }
740
+ ?>
741
+ <a href="javascript:void()" onclick="select_all(<?php echo $number; ?>,'');return false;">No Import</a>
742
+ </p>
743
+ <?php
744
+ break;
745
+ }
746
+
747
  }
748
 
749
  if( $StrandedEpisodes )
824
  <input type="button" name="Submit" id="powerpress_import_button" class="button-primary" value="Import Episodes" onclick="alert('We found blog posts that have <?php echo $results['feeds_required']; ?> media files.\n\nYou will need to create <?php echo ( $results['feeds_required'] - count($Settings['custom_feeds']) ); ?> more Custom Feed<?php if( ( $results['feeds_required'] - count($Settings['custom_feeds']) ) > 1 ) echo 's'; ?> in order to continue. ');" />
825
  </p>
826
 
827
+
828
+
829
  <?php
830
  }
831
  ?>
832
+ </form>
833
+ <hr />
834
+ <form enctype="enctype" method="get" action="<?php echo admin_url('admin.php') ?>">
835
+ <input type="hidden" name="page" value="powerpress/powerpressadmin_tools.php" />
836
+ <input type="hidden" name="action" value="powerpress-podpress-epiosdes" />
837
+ <h2>Filter Results</h2>
838
+ <p><label>Include Only</label><input type="text" name="include_only_ext" value="<?php if( !empty($_GET['include_only_ext']) ) echo htmlspecialchars($_GET['include_only_ext']); ?>" style="width: 240px;" /> (leave blank for all media) <br />
839
+ <label>&nbsp;</label>specify the file extensions to include separated by commas (e.g. mp3, m4v).
840
+ </p>
841
+ <p class="submit">
842
+ <input type="submit" name="Submit" class="button-primary" value="Filter Episodes" />
843
+ </p>
844
+ <!-- start footer -->
845
  <?php
846
  }
847
 
powerpressadmin-tools.php CHANGED
@@ -7,10 +7,24 @@
7
  ?>
8
  <h2><?php echo __("PowerPress Tools"); ?></h2>
9
 
10
- <p style="margin-bottom: 0;"><?php echo __('Useful utilities and tools for PowerPress.'); ?></p>
11
 
12
 
13
  <table class="form-table">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  <tr valign="top">
15
  <th scope="row"><?php echo __("Import Settings"); ?></th>
16
  <td>
@@ -32,10 +46,10 @@
32
  <td>
33
 
34
  <p style="margin-top: 5px;"><strong><a href="<?php echo admin_url("admin.php?page=powerpress/powerpressadmin_tools.php&amp;action=powerpress-podpress-epiosdes"); ?>"><?php echo __('Import PodPress Episodes'); ?></a></strong> </p>
35
- <p><?php echo __('Import PodPress created episodes to PowerPress specific podcast feed(s).'); ?></p>
36
 
37
- <p style="margin-top: 5px;"><strong><a href="<?php echo admin_url("admin.php?page=powerpress/powerpressadmin_tools.php&amp;action=powerpress-mt-epiosdes"); ?>"><?php echo __('Import Movable Type/Blogger/Joomla/TypePad Episodes'); ?></a></strong> <?php echo __('(media linked in blog posts)'); ?></p>
38
- <p><?php echo __('Import Movable Type/Blogger/Joomla/TypePad (and most other blogging systems) podcast episodes to PowerPress specific podcast feed(s).'); ?></p>
39
 
40
  </td>
41
  </tr>
7
  ?>
8
  <h2><?php echo __("PowerPress Tools"); ?></h2>
9
 
10
+ <p style="margin-bottom: 0;"><?php echo __('Useful utilities and tools.'); ?></p>
11
 
12
 
13
  <table class="form-table">
14
+ <tr valign="top">
15
+ <th scope="row"><?php echo __("Podcasting Resources"); ?></th>
16
+ <td>
17
+ <p style="margin-top: 5px;"><strong><a href="http://www.podcastfaq.com"><?php echo __('PodcastFAQ.com'); ?></a></strong>
18
+ - <?php echo __('everything you need to know about podcasting.'); ?></p>
19
+
20
+ <p style="margin-top: 5px;"><strong><a href="http://help.blubrry.com/blubrry-powerpress/"><?php echo __('PowerPress Documentation'); ?></a></strong>
21
+ - <?php echo __('learn more about PowerPress.'); ?></p>
22
+
23
+ <p style="margin-top: 5px;"><strong><a href="http://forum.blubrry.com/"><?php echo __('Blubrry Forum'); ?></a></strong>
24
+ - <?php echo __('interact with other podcasters.'); ?></p>
25
+ </td>
26
+ </tr>
27
+
28
  <tr valign="top">
29
  <th scope="row"><?php echo __("Import Settings"); ?></th>
30
  <td>
46
  <td>
47
 
48
  <p style="margin-top: 5px;"><strong><a href="<?php echo admin_url("admin.php?page=powerpress/powerpressadmin_tools.php&amp;action=powerpress-podpress-epiosdes"); ?>"><?php echo __('Import PodPress Episodes'); ?></a></strong> </p>
49
+ <p><?php echo __('Import PodPress created episodes to PowerPress.'); ?></p>
50
 
51
+ <p style="margin-top: 5px;"><strong><a href="<?php echo admin_url("admin.php?page=powerpress/powerpressadmin_tools.php&amp;action=powerpress-mt-epiosdes"); ?>"><?php echo __('Import from other Blogging Platform'); ?></a></strong> <?php echo __('(media linked in blog posts)'); ?></p>
52
+ <p><?php echo __('Import from podcast episodes from blogging platforms such as Movable Type/Blogger/Joomla/TypePad (and most other blogging systems) to PowerPress.'); ?></p>
53
 
54
  </td>
55
  </tr>
powerpressadmin.php CHANGED
@@ -60,7 +60,7 @@ function powerpress_admin_init()
60
  //wp_enqueue_script('jquery-ui-selectable');
61
  //wp_enqueue_script('jquery-ui-sortable');
62
 
63
- wp_enqueue_script( 'powerpress', powerpress_get_root_url().'3rdparty/jquery.cookie.js', array('jquery' ) );
64
 
65
 
66
  if( function_exists('powerpress_admin_jquery_init') )
@@ -206,7 +206,7 @@ function powerpress_admin_init()
206
  if( $FeedSlug )
207
  {
208
  $GeneralSettingsTemp = powerpress_get_settings('powerpress_general', false);
209
- if( $GeneralSettingsTemp['custom_feeds'][$FeedSlug] != $Feed['title'] )
210
  {
211
  if( !$General )
212
  $General = array();
@@ -218,17 +218,14 @@ function powerpress_admin_init()
218
  // Update the settings in the database:
219
  if( $General )
220
  {
221
- if( $_POST['action'] == 'powerpress-save-appearance' )
222
- {
223
- if( !isset($General['display_player_excerpt']) ) // If we are modifying appearance settings but this option was not checked...
224
- $General['display_player_excerpt'] = 0; // Set it to zero.
225
- }
226
-
227
  if( $_POST['action'] == 'powerpress-save-settings' )
228
  {
229
  if( !isset($General['display_player_excerpt']) ) // If we are modifying appearance settings but this option was not checked...
230
  $General['display_player_excerpt'] = 0; // Set it to zero.
231
 
 
 
 
232
  $General['disable_dashboard_widget'] = 0;
233
  if( !isset($_POST['StatsInDashboard'] ) )
234
  $General['disable_dashboard_widget'] = 1;
@@ -251,6 +248,8 @@ function powerpress_admin_init()
251
  $General['episode_box_subtitle'] = 0;
252
  if( !isset($General['episode_box_summary'] ) )
253
  $General['episode_box_summary'] = 0;
 
 
254
  if( !isset($General['episode_box_explicit'] ) )
255
  $General['episode_box_explicit'] = 0;
256
 
@@ -356,16 +355,9 @@ function powerpress_admin_init()
356
  case 'powerpress-save-settings': {
357
  powerpress_page_message_add_notice( __('Blubrry PowerPress settings saved successfully.') );
358
  }; break;
359
- case 'powerpress-save-appearance': {
360
- powerpress_page_message_add_notice( __('Blubrry PowerPress Appearance settings saved.') );
361
- }; break;
362
  case 'powerpress-save-customfeed': {
363
  powerpress_page_message_add_notice( __('Blubrry PowerPress Custom Feed settings saved.') );
364
  }; break;
365
-
366
- case 'powerpress-save-feedsettings': {
367
- powerpress_page_message_add_notice( __('Blubrry PowerPress Feed settings saved.') );
368
- }; break;
369
  case 'powerpress-save-categoryfeedsettings': {
370
  powerpress_page_message_add_notice( __('Blubrry PowerPress Category Feed settings saved.') );
371
  }; break;
@@ -382,7 +374,6 @@ function powerpress_admin_init()
382
  else
383
  powerpress_page_message_add_notice( __('You are now in Simple Mode.') );
384
  }; break;
385
- case 'powerpress-save-basic':
386
  default: {
387
  powerpress_page_message_add_notice( __('Blubrry PowerPress settings saved.') );
388
  }; break;
@@ -583,11 +574,11 @@ function powerpress_admin_init()
583
 
584
  $Episodes = powerpress_admin_episodes_per_feed($delete_slug);
585
 
586
- if( $delete_slug == 'podcast' && $force_deletion == false )
587
  {
588
  powerpress_page_message_add_error( __('Cannot delete default podcast feed.') );
589
  }
590
- else if( $Episodes > 0 && $force_deletion == false )
591
  {
592
  powerpress_page_message_add_error( sprintf(__('Cannot delete feed. Feed contains %d episode(s).'), $Episodes) );
593
  }
@@ -968,7 +959,7 @@ function powerpress_edit_post($post_ID, $post)
968
  }
969
 
970
  //Set the duration specified by the user
971
- if( $Powerpress['set_duration'] == 1 ) // specify duration
972
  {
973
  $Duration = sprintf('%02d:%02d:%02d', $Powerpress['duration_hh'], $Powerpress['duration_mm'], $Powerpress['duration_ss'] );
974
  }
@@ -990,7 +981,7 @@ function powerpress_edit_post($post_ID, $post)
990
  {
991
  if( @$Powerpress['set_size'] == 0 )
992
  $FileSize = $MediaInfo['length'];
993
- if( @$Powerpress['set_duration'] == 0 )
994
  $Duration = powerpress_readable_duration($MediaInfo['duration'], true);
995
  }
996
  else
@@ -1011,15 +1002,15 @@ function powerpress_edit_post($post_ID, $post)
1011
  continue;
1012
  }
1013
  else if( empty($MediaInfo['length']) )
1014
- {
1015
  $error = __('Error') ." ({$MediaURL}): ". __('Unable to obtain size of media.');
1016
  powerpress_add_error($error);
1017
  continue;
1018
- }
1019
  else
1020
- {
1021
  // Detect the duration
1022
- if( $Powerpress['set_duration'] == 0 && $MediaInfo['duration'] )
1023
  $Duration = powerpress_readable_duration($MediaInfo['duration'], true); // Fix so it looks better when viewed for editing
1024
 
1025
  // Detect the file size
@@ -1037,21 +1028,21 @@ function powerpress_edit_post($post_ID, $post)
1037
  $ToSerialize['hosting'] = 1;
1038
 
1039
  // iTunes duration
1040
- if( $Duration )
1041
  $ToSerialize['duration'] = $Duration; // regular expression '/^(\d{1,2}\:)?\d{1,2}\:\d\d$/i' (examples: 1:23, 12:34, 1:23:45, 12:34:56)
1042
- // iTunes Subtitle (FUTURE USE)
1043
  if( isset($Powerpress['subtitle']) && trim($Powerpress['subtitle']) != '' )
1044
  $ToSerialize['subtitle'] = stripslashes($Powerpress['subtitle']);
1045
- // iTunes Summary (FUTURE USE)
1046
  if( isset($Powerpress['summary']) && trim($Powerpress['summary']) != '' )
1047
  $ToSerialize['summary'] = stripslashes($Powerpress['summary']);
1048
- // iTunes keywords (FUTURE USE)
1049
  if( isset($Powerpress['keywords']) && trim($Powerpress['keywords']) != '' )
1050
  $ToSerialize['keywords'] = stripslashes($Powerpress['keywords']);
1051
- // iTunes Author (FUTURE USE)
1052
  if( isset($Powerpress['author']) && trim($Powerpress['author']) != '' )
1053
  $ToSerialize['author'] = stripslashes($Powerpress['author']);
1054
- // iTunes Explicit (FUTURE USE)
1055
  if( isset($Powerpress['explicit']) && trim($Powerpress['explicit']) != '' )
1056
  $ToSerialize['explicit'] = $Powerpress['explicit'];
1057
  // iTunes Block (FUTURE USE)
@@ -1194,22 +1185,6 @@ function powerpress_new_feed_url_prompt() {
1194
  }
1195
  return false;
1196
  }
1197
- function powerpress_changemode(Mode)
1198
- {
1199
- if( Mode )
1200
- {
1201
- if( !confirm("<?php echo __('Are you sure you want to switch to Advanced Mode?\n\nAdvanced Mode provides:\n * Advanced Settings\n * Presentation Settings\n * Extensive Feed Settings \n * Custom Feeds \n * Useful Tools'); ?>") )
1202
- return false;
1203
- }
1204
- else
1205
- {
1206
- if( !confirm("<?php echo __('Are you sure you want to switch to Simple Mode?\n\nSimple Mode provides:\n * Only the bare essential settings\n * All settings on one page'); ?>") )
1207
- return false;
1208
- }
1209
- document.getElementById('powerpress_advanced_mode').value = Mode;
1210
- document.forms[0].submit();
1211
- return false;
1212
- }
1213
 
1214
  jQuery(document).ready(function($) {
1215
  jQuery("#powerpress_settings_page").tabs({ cookie: { expires: 30 } });
@@ -1429,7 +1404,7 @@ function powerpress_get_media_info(FeedSlug)
1429
  if( strError == 'timeout' )
1430
  jQuery( '#powerpress_warning_'+FeedSlug ).text( '<?php echo __('Operation timed out.'); ?>' );
1431
  else
1432
- jQuery( '#powerpress_warning_'+FeedSlug ).text( '<?php echo __('Unknown error occurred.'); ?>' );
1433
  jQuery( '#powerpress_warning_'+FeedSlug ).css('display', 'block');
1434
  }
1435
  });
@@ -1611,8 +1586,9 @@ function powerpress_admin_page_footer($SaveButton=true, $form=true)
1611
  </p>
1612
  <?php } ?>
1613
  <p style="font-size: 85%; text-align: center; padding-bottom: 25px;">
1614
- <a href="http://www.blubrry.com/powerpress/" title="Blubrry PowerPress" target="_blank"><?php echo __('Blubrry PowerPress'); ?></a> <?php echo POWERPRESS_VERSION; ?>
1615
- &#8212; <a href="http://help.blubrry.com/blubrry-powerpress/" target="_blank" title="<?php echo __('Blubrry PowerPress Documentation'); ?>"><?php echo __('Documentation'); ?></a> |
 
1616
  <a href="http://forum.blubrry.com/" target="_blank" title="<?php echo __('Blubrry Forum'); ?>"><?php echo __('Forum'); ?></a> |
1617
  <a href="http://twitter.com/blubrry" target="_blank" title="<?php echo __('Follow Blubrry on Twitter'); ?>"><?php echo __('Follow Blubrry on Twitter'); ?></a>
1618
  </p>
@@ -2456,11 +2432,10 @@ function powerpress_default_settings($Settings, $Section='basic')
2456
  }
2457
 
2458
  if( !isset($Settings['channels'] ) )
2459
- {
2460
  $Settings['channels'] = 0;
2461
- if( isset($Settings['custom_feeds']) && count($Settings['custom_feeds']) > 0 )
2462
- $Settings['channels'] = 1;
2463
- }
2464
  }; break;
2465
  case 'editfeed': {
2466
  if( !isset($Settings['apply_to']) )
@@ -2481,6 +2456,9 @@ function powerpress_default_settings($Settings, $Section='basic')
2481
  $Settings['podcast_link'] = 1;
2482
  if( !isset($Settings['display_player_excerpt']) )
2483
  $Settings['display_player_excerpt'] = 0;
 
 
 
2484
  // Play in page obsolete, switching here:
2485
  if( $Settings['player_function'] == 5 )
2486
  $Settings['player_function'] = 1;
60
  //wp_enqueue_script('jquery-ui-selectable');
61
  //wp_enqueue_script('jquery-ui-sortable');
62
 
63
+ wp_enqueue_script( 'powerpress', powerpress_get_root_url().'3rdparty/jquery.c.js', array('jquery' ) );
64
 
65
 
66
  if( function_exists('powerpress_admin_jquery_init') )
206
  if( $FeedSlug )
207
  {
208
  $GeneralSettingsTemp = powerpress_get_settings('powerpress_general', false);
209
+ if( !isset($GeneralSettingsTemp['custom_feeds'][$FeedSlug]) || $GeneralSettingsTemp['custom_feeds'][$FeedSlug] != $Feed['title'] )
210
  {
211
  if( !$General )
212
  $General = array();
218
  // Update the settings in the database:
219
  if( $General )
220
  {
 
 
 
 
 
 
221
  if( $_POST['action'] == 'powerpress-save-settings' )
222
  {
223
  if( !isset($General['display_player_excerpt']) ) // If we are modifying appearance settings but this option was not checked...
224
  $General['display_player_excerpt'] = 0; // Set it to zero.
225
 
226
+ if( !isset($General['display_player_disable_mobile']) )
227
+ $General['display_player_disable_mobile'] = 0;
228
+
229
  $General['disable_dashboard_widget'] = 0;
230
  if( !isset($_POST['StatsInDashboard'] ) )
231
  $General['disable_dashboard_widget'] = 1;
248
  $General['episode_box_subtitle'] = 0;
249
  if( !isset($General['episode_box_summary'] ) )
250
  $General['episode_box_summary'] = 0;
251
+ if( !isset($General['episode_box_author'] ) )
252
+ $General['episode_box_author'] = 0;
253
  if( !isset($General['episode_box_explicit'] ) )
254
  $General['episode_box_explicit'] = 0;
255
 
355
  case 'powerpress-save-settings': {
356
  powerpress_page_message_add_notice( __('Blubrry PowerPress settings saved successfully.') );
357
  }; break;
 
 
 
358
  case 'powerpress-save-customfeed': {
359
  powerpress_page_message_add_notice( __('Blubrry PowerPress Custom Feed settings saved.') );
360
  }; break;
 
 
 
 
361
  case 'powerpress-save-categoryfeedsettings': {
362
  powerpress_page_message_add_notice( __('Blubrry PowerPress Category Feed settings saved.') );
363
  }; break;
374
  else
375
  powerpress_page_message_add_notice( __('You are now in Simple Mode.') );
376
  }; break;
 
377
  default: {
378
  powerpress_page_message_add_notice( __('Blubrry PowerPress settings saved.') );
379
  }; break;
574
 
575
  $Episodes = powerpress_admin_episodes_per_feed($delete_slug);
576
 
577
+ if( false && $delete_slug == 'podcast' && $force_deletion == false ) // Feature disabled, you can now delete podcast specific settings
578
  {
579
  powerpress_page_message_add_error( __('Cannot delete default podcast feed.') );
580
  }
581
+ else if( $delete_slug != 'podcast' && $Episodes > 0 && $force_deletion == false )
582
  {
583
  powerpress_page_message_add_error( sprintf(__('Cannot delete feed. Feed contains %d episode(s).'), $Episodes) );
584
  }
959
  }
960
 
961
  //Set the duration specified by the user
962
+ if( $Powerpress['set_duration'] == 1 || $Powerpress['set_duration'] == 0 ) // specify duration
963
  {
964
  $Duration = sprintf('%02d:%02d:%02d', $Powerpress['duration_hh'], $Powerpress['duration_mm'], $Powerpress['duration_ss'] );
965
  }
981
  {
982
  if( @$Powerpress['set_size'] == 0 )
983
  $FileSize = $MediaInfo['length'];
984
+ if( @$Powerpress['set_duration'] == 0 && !empty($MediaInfo['duration']) )
985
  $Duration = powerpress_readable_duration($MediaInfo['duration'], true);
986
  }
987
  else
1002
  continue;
1003
  }
1004
  else if( empty($MediaInfo['length']) )