PluginProbe
PowerPress Podcasting plugin by Blubrry / trunk
PowerPress Podcasting plugin by Blubrry vtrunk
11.17.9 11.17.8 11.17.7 11.17.6 11.17.4 11.17.3 11.17.2 11.17.1 11.17 11.16.11 11.16.10 11.16.9 11.16.8 11.16.7 11.16.6 11.16.5 11.16.4 11.16.3 11.16.2 11.16.1 11.9.13 11.9.14 11.9.15 11.9.16 11.9.17 All 383 releases
powerpress / powerpressadmin-editfeed.php

powerpressadmin-editfeed.php in PowerPress Podcasting plugin by Blubrry trunk, at powerpressadmin-editfeed.php

1,739 lines 95.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if( !function_exists('add_action') )
4 die("access denied.");
5
6
7 function powerpress_admin_capabilities()
8 {
9 global $wp_roles;
10
11 $capnames = array();
12 // Get Role List
13 foreach($wp_roles->role_objects as $key => $role) {
14 foreach($role->capabilities as $cap => $grant) {
15 $capnames[$cap] = ucwords( str_replace('_', ' ', $cap) );
16 }
17 }
18
19 $capnames = apply_filters( 'powerpress_admin_capabilities', array_unique($capnames) );
20
21 $remove_keys = array('level_0', 'level_1', 'level_2', 'level_3', 'level_4', 'level_5', 'level_6', 'level_7', 'level_8', 'level_9', 'level_10');
22 foreach( $remove_keys as $null=> $key )
23 unset($capnames[ $key ]);
24 asort($capnames);
25 return $capnames;
26 }
27
28
29 // powerpressadmin_editfeed.php
30 function powerpress_admin_editfeed($type='', $type_value = '', $feed_slug = false)
31 {
32 $SupportUploads = powerpressadmin_support_uploads();
33 $General = powerpress_get_settings('powerpress_general');
34 $FeedAttribs = array('type'=>$type, 'feed_slug'=>'', 'category_id'=>0, 'term_taxonomy_id'=>0, 'term_id'=>0, 'taxonomy_type'=>'', 'post_type'=>'');
35 $cat_ID = false; $term_taxonomy_id = false;
36
37 if (defined('WP_DEBUG')) {
38 if (WP_DEBUG) {
39 wp_register_style('powerpress_settings_style', powerpress_get_root_url() . 'css/settings.css', array(), POWERPRESS_VERSION);
40 } else {
41 wp_register_style('powerpress_settings_style', powerpress_get_root_url() . 'css/settings.min.css', array(), POWERPRESS_VERSION);
42 }
43 } else {
44 wp_register_style('powerpress_settings_style', powerpress_get_root_url() . 'css/settings.min.css', array(), POWERPRESS_VERSION);
45 }
46 wp_enqueue_style("powerpress_settings_style");
47
48 $MultiSiteServiceSettings = false;
49 if( is_multisite() )
50 {
51 $MultiSiteSettings = get_site_option('powerpress_multisite');
52 if( !empty($MultiSiteSettings['services_multisite_only']) )
53 {
54 $MultiSiteServiceSettings = true;
55 }
56 }
57
58 $FeedTitle = __('Feed Settings', 'powerpress');
59 $NewPostQueryString = '';
60 switch( $type )
61 {
62 case 'channel': {
63 $feed_slug = $type_value;
64 $FeedAttribs['feed_slug'] = $type_value;
65 $FeedSettings = powerpress_get_settings('powerpress_feed_'.$feed_slug);
66 if( !$FeedSettings && $type_value == 'podcast' ) // We are editing the default podcast channel
67 {
68 $FeedSettings = powerpress_get_settings('powerpress_feed');
69 }
70
71 if( !$FeedSettings )
72 {
73 $FeedSettings = array();
74 $FeedSettings['title'] = '';
75 if( !empty($General['custom_feeds'][$feed_slug]) )
76 $FeedSettings['title'] = $General['custom_feeds'][$feed_slug];
77 }
78 $FeedSettings = powerpress_default_settings($FeedSettings, 'editfeed_custom');
79
80 if( !isset($General['custom_feeds'][$feed_slug]) )
81 $General['custom_feeds'][$feed_slug] = __('Podcast (default)', 'powerpress');
82
83 $FeedTitle = sprintf( 'Podcast Settings for Channel: %s', htmlspecialchars($General['custom_feeds'][$feed_slug]) );
84 echo sprintf('<input type="hidden" name="feed_slug" value="%s" />', $feed_slug);
85 echo '<input type="hidden" name="action" value="powerpress-save-channel" />';
86
87 }; break;
88 case 'category': {
89 $cat_ID = $type_value;
90 $FeedAttribs['category_id'] = $type_value;
91 $FeedSettings = powerpress_get_settings('powerpress_cat_feed_'.$cat_ID);
92 $FeedSettings = powerpress_default_settings($FeedSettings, 'editfeed_custom');
93
94 $category = get_category_to_edit($cat_ID);
95 $FeedTitle = sprintf( __('Podcast Settings for Category: %s', 'powerpress'), htmlspecialchars($category->name) );
96 echo sprintf('<input type="hidden" name="cat" value="%s" />', $cat_ID);
97 echo '<input type="hidden" name="action" value="powerpress-save-category" />';
98
99 }; break;
100 case 'ttid': {
101 $term_taxonomy_id = intval($type_value); // sanitize for sql
102 $FeedAttribs['term_taxonomy_id'] = $term_taxonomy_id;
103 $FeedSettings = powerpress_get_settings('powerpress_taxonomy_'.$term_taxonomy_id);
104 $FeedSettings = powerpress_default_settings($FeedSettings, 'editfeed_custom');
105
106 global $wpdb;
107 $term_info = $wpdb->get_results("SELECT term_id, taxonomy FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = $term_taxonomy_id", ARRAY_A);
108 if( !empty( $term_info[0]['term_id']) ) {
109 $term_ID = $term_info[0]['term_id'];
110 $taxonomy_type = $term_info[0]['taxonomy'];
111 $FeedAttribs['term_id'] = $term_ID;
112 $FeedAttribs['taxonomy_type'] = $taxonomy_type;
113
114 $term_object = get_term_to_edit($term_ID, $taxonomy_type);
115 $FeedTitle = sprintf( __('Podcast Settings for Taxonomy Term: %s', 'powerpress'), htmlspecialchars($term_object->name));
116 echo sprintf('<input type="hidden" name="term" value="%s" />', $term_ID);
117 }
118 else
119 {
120 $FeedTitle = sprintf( __('Podcast Settings for Taxonomy Term: %s', 'powerpress'), 'Term ID '.htmlspecialchars($term_taxonomy_id));
121 }
122 echo sprintf('<input type="hidden" name="ttid" value="%s" />', $term_taxonomy_id);
123 echo '<input type="hidden" name="action" value="powerpress-save-ttid" />';
124
125 }; break;
126 case 'post_type': {
127
128 $FeedAttribs['post_type'] = $type_value;
129 $FeedAttribs['feed_slug'] = $feed_slug;
130 $FeedSettingsArray = powerpress_get_settings('powerpress_posttype_'.$FeedAttribs['post_type']);
131 if( !is_array($FeedSettingsArray[ $feed_slug ]) )
132 $FeedSettingsArray[ $feed_slug ] = array();
133 $FeedSettings = powerpress_default_settings($FeedSettingsArray[ $feed_slug ], 'editfeed_custom');
134 $NewPostQueryString = '?post_type=' . $type_value;
135 //$category = get_category_to_edit($cat_ID);
136 $PostTypeTitle = $FeedAttribs['post_type']; // TODO: Get readable title of post type
137 $FeedTitle = sprintf( __('Podcast Settings for Post Type %s with slug %s', 'powerpress'), htmlspecialchars($PostTypeTitle) , htmlspecialchars($feed_slug));
138 echo sprintf('<input type="hidden" name="podcast_post_type" value="%s" />', $FeedAttribs['post_type']);
139 echo sprintf('<input type="hidden" name="feed_slug" value="%s" />', $feed_slug);
140 echo '<input type="hidden" name="action" value="powerpress-save-post_type" />';
141
142 }; break;
143 default: {
144 $FeedSettings = powerpress_get_settings('powerpress_feed');
145 $FeedSettings = powerpress_default_settings($FeedSettings, 'editfeed');
146 echo '<input type="hidden" name="action" value="powerpress-save-settings" />';
147 }; break;
148 }
149
150
151 echo '<h2>'. $FeedTitle .'</h2>';
152
153 if( $cat_ID && (isset($_GET['from_categories']) || isset($_POST['from_categories'])) )
154 {
155 echo '<input type="hidden" name="from_categories" value="1" />';
156 }
157
158 powerpress_enqueue_assets([
159 // styles for welcome-tab components
160 'powerpress-program-card-css' => ['path' => 'css/components/program-card'],
161 'powerpress-stats-widget' => ['path' => 'css/components/stats-widget'],
162 'powerpress-news-widget' => ['path' => 'css/components/news-widget'],
163 'powerpress-sidenav' => ['path' => 'css/components/sidenav'],
164
165 // scripts
166 'chartjs' => [
167 'type' => 'script',
168 'path' => '3rdparty/chart.min',
169 'no_suffix' => true,
170 'version' => '4.4.1',
171 ],
172 'powerpress-admin' => [
173 'type' => 'script',
174 'path' => 'js/admin',
175 ],
176 'powerpress-program-card' => [
177 'type' => 'script',
178 'path' => 'js/program-card',
179 'deps' => ['chartjs'],
180 'module' => true,
181 ],
182 'powerpress-post' => [
183 'type' => 'script',
184 'path' => 'js/post',
185 'module' => true,
186 ],
187 ]);
188
189 ?>
190 <div id="powerpress_settings_page" class="powerpress_tabbed_content">
191 <div class="pp-tab">
192 <button id="welcome-tab" class="tablinks active" onclick="powerpress_openTab(event, 'settings-welcome')"><?php echo htmlspecialchars(__('Welcome', 'powerpress')); ?></button>
193 <!-- #tab1 deprecated. was episodes tab -->
194 <button id="feeds-tab" class="tablinks" onclick="powerpress_openTab(event, 'settings-feeds')"><?php echo htmlspecialchars(__('Feeds', 'powerpress')); ?></button>
195 <?php if( in_array($FeedAttribs['type'], array('category', 'ttid', 'post_type', 'channel') ) ) { ?>
196 <button id="website-tab" class="tablinks" onclick="powerpress_openTab(event, 'settings-website')"><?php echo htmlspecialchars(__('Website', 'powerpress')); ?></button>
197 <?php } ?>
198 <button id="destinations-tab" class="tablinks" onclick="powerpress_openTab(event, 'settings-destinations')"><?php echo htmlspecialchars(__('Destinations', 'powerpress')); ?></button>
199 <!-- <button class="tablinks" onclick="openTab(event, 'settings-analytics')"><?php echo htmlspecialchars(__('Analytics', 'powerpress')); ?></button> -->
200 <button id="other-tab" class="tablinks" onclick="powerpress_openTab(event, 'settings-other')"><?php echo htmlspecialchars(__('Other', 'powerpress')); ?></button>
201 <button id="make-money-tab" class="tablinks" onclick="powerpress_openTab(event, 'settings-make-money')"><?php echo htmlspecialchars(__('Make Money', 'powerpress')); ?></button>
202 <button id="live-item-tab" class="tablinks" onclick="powerpress_openTab(event, 'settings-live-item')"><?php echo htmlspecialchars(__('Live Item', 'powerpress')); ?></button>
203 <button id="experimental-tab" class="tablinks" onclick="powerpress_openTab(event, 'settings-experimental')"><?php echo htmlspecialchars(__('Experimental', 'powerpress')); ?></button>
204 </div>
205
206 <div id="settings-welcome" class="pp-tabcontent active">
207 <div class="pp-sidenav-toggle-container">
208 <div id="welcome-toggle-sidenav" class="toggle-sidenav" title="Blubrry Services" onclick="powerpress_displaySideNav(this);">&lt;</div>
209 <div class="pp-sidenav">
210 <?php
211 powerpressadmin_edit_blubrry_services($General);
212 ?>
213 <div class="pp-sidenav-extra"><a href="https://www.blubrry.com/support/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('POWERPRESS DOCUMENTATION', 'powerpress')); ?></a></div>
214 <div class="pp-sidenav-extra"><a href="https://www.blubrry.com/podcast-insider/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('PODCAST INSIDER BLOG', 'powerpress')); ?></a></div>
215 <div class="pp-sidenav-extra"><a href="https://blubrry.com/manual/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('PODCAST MANUAL', 'powerpress')); ?></a></div>
216 <div class="pp-sidenav-extra"><a href="https://blubrry.com/services/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY RESOURCES', 'powerpress')); ?></a></div>
217 <div class="pp-sidenav-extra"><a href="https://blubrry.com/support/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY SUPPORT', 'powerpress')); ?></a></div>
218 <div class="pp-sidenav-extra"><a href="https://wordpress.org/support/plugin/powerpress/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY POWERPRESS FORUM', 'powerpress')); ?></a></div>
219 </div>
220 </div>
221 <button style="display: none;" id="welcome-default-open" class="pp-sidenav-tablinks active" onclick="sideNav(event, 'welcome-all')"><img class="pp-nav-icon" style="width: 22px;" alt="" src="<?php echo powerpress_get_root_url(); ?>images/settings_nav_icons/rss-symbol.svg"><?php echo htmlspecialchars(__('Hidden button', 'powerpress')); ?></button>
222 <div id="welcome-all" class="pp-sidenav-tab active">
223 <?php powerpressadmin_welcome($General, $FeedSettings, $NewPostQueryString); ?>
224 </div>
225 </div>
226
227 <div id="settings-feeds" class="pp-tabcontent has-sidenav">
228 <div class="pp-sidenav-toggle-container">
229 <div id="feeds-toggle-sidenav" class="toggle-sidenav" title="More Feed Settings and Blubrry Services" onclick="powerpress_displaySideNav(this);">&lt;</div>
230 <div class="pp-sidenav">
231 <div class="pp-sidenav-extra"><p class="pp-sidenav-extra-text"><b><?php echo htmlspecialchars(__('FEED SETTINGS', 'powerpress')); ?></b></p></div>
232 <button id="feeds-default-open" class="pp-sidenav-tablinks active" id="feeds-settings-tab" onclick="sideNav(event, 'feeds-settings')"><img class="pp-nav-icon" alt="" src="<?php echo powerpress_get_root_url(); ?>images/settings_nav_icons/option_bar_settings_gray.svg"><?php echo htmlspecialchars(__('Feed Settings', 'powerpress')); ?></button>
233 <button class="pp-sidenav-tablinks" id="feeds-artwork-tab" onclick="sideNav(event, 'feeds-artwork')"><img class="pp-nav-icon" alt="" src="<?php echo powerpress_get_root_url(); ?>images/settings_nav_icons/camera_gray.svg"><?php echo htmlspecialchars(__('Podcast Artwork', 'powerpress')); ?></button>
234 <button class="pp-sidenav-tablinks" id="feeds-basic-tab" onclick="sideNav(event, 'feeds-basic')"><img class="pp-nav-icon" alt="" src="<?php echo powerpress_get_root_url(); ?>images/settings_nav_icons/edit_gray.svg"><?php echo htmlspecialchars(__('Basic Show Information', 'powerpress')); ?></button>
235 <button class="pp-sidenav-tablinks" id="feeds-rating-tab" onclick="sideNav(event, 'feeds-rating')"><img class="pp-nav-icon" alt="" src="<?php echo powerpress_get_root_url(); ?>images/settings_nav_icons/star_favorite_gray.svg"><?php echo htmlspecialchars(__('Rating Settings', 'powerpress')); ?></button>
236 <button class="pp-sidenav-tablinks" id="feeds-apple-tab" onclick="sideNav(event, 'feeds-apple')"><span id="apple-icon-feed" class="destinations-side-icon" style="margin-left: 2px;"></span><span class="destination-side-text" style="margin-left: 6px;"><?php echo htmlspecialchars(__('Apple Settings', 'powerpress')); ?></span></button>
237 <?php
238 powerpressadmin_edit_blubrry_services($General);
239 ?>
240 <div class="pp-sidenav-extra"><a href="https://www.blubrry.com/support/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('POWERPRESS DOCUMENTATION', 'powerpress')); ?></a></div>
241 <div class="pp-sidenav-extra"><a href="https://www.blubrry.com/podcast-insider/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('PODCAST INSIDER BLOG', 'powerpress')); ?></a></div>
242 <div class="pp-sidenav-extra"><a href="https://blubrry.com/manual/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('PODCAST MANUAL', 'powerpress')); ?></a></div>
243 <div class="pp-sidenav-extra"><a href="https://blubrry.com/services/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY RESOURCES', 'powerpress')); ?></a></div>
244 <div class="pp-sidenav-extra"><a href="https://blubrry.com/support/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY SUPPORT', 'powerpress')); ?></a></div>
245 <div class="pp-sidenav-extra"><a href="https://wordpress.org/support/plugin/powerpress/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY POWERPRESS FORUM', 'powerpress')); ?></a></div>
246 </div>
247 </div>
248 <div id="feeds-settings" class="pp-sidenav-tab active">
249 <?php powerpressadmin_edit_feed_settings($FeedSettings, $General, $FeedAttribs);
250 powerpress_settings_tab_footer(); ?>
251 </div>
252 <div id="feeds-artwork" class="pp-sidenav-tab">
253 <?php powerpressadmin_edit_artwork($FeedSettings, $General);
254 powerpress_settings_tab_footer(); ?>
255 </div>
256 <div id="feeds-basic" class="pp-sidenav-tab">
257 <?php powerpressadmin_edit_funding($FeedSettings, $feed_slug);
258 powerpress_settings_tab_footer(); ?>
259 </div>
260 <div id="feeds-rating" class="pp-sidenav-tab">
261 <?php powerpressadmin_edit_tv($FeedSettings, $feed_slug);
262 powerpress_settings_tab_footer(); ?>
263 </div>
264 <div id="feeds-apple" class="pp-sidenav-tab">
265 <?php powerpressadmin_edit_itunes_feed($FeedSettings, $General, $FeedAttribs);
266 powerpress_settings_tab_footer(); ?>
267 </div>
268 </div>
269
270 <div id="settings-website" class="pp-tabcontent">
271 <div class="pp-sidenav-toggle-container">
272 <div id="website-toggle-sidenav" class="toggle-sidenav" title="More Website Settings and Blubrry Services" onclick="powerpress_displaySideNav(this);">&lt;</div>
273 <div class="pp-sidenav">
274 <div class="pp-sidenav-extra"><p class="pp-sidenav-extra-text"><b><?php echo htmlspecialchars(__('WEBSITE SETTINGS', 'powerpress')); ?></b></p></div>
275 <button id="website-default-open" class="pp-sidenav-tablinks active" onclick="sideNav(event, 'website-settings')"><img class="pp-nav-icon" alt="" src="<?php echo powerpress_get_root_url(); ?>images/settings_nav_icons/desktop_gray.svg"><?php echo htmlspecialchars(__('Website Settings', 'powerpress')); ?></button>
276 <button class="pp-sidenav-tablinks" id="website-shortcodes-tab" onclick="sideNav(event, 'website-shortcodes')"><img class="pp-nav-icon" alt="" src="<?php echo powerpress_get_root_url(); ?>images/settings_nav_icons/connection_pattern_gray.svg"><?php echo htmlspecialchars(__('PowerPress Shortcodes', 'powerpress')); ?></button>
277 <?php
278 powerpressadmin_edit_blubrry_services($General);
279 ?>
280 <div class="pp-sidenav-extra" style="margin-top: 10%;"><a href="https://www.blubrry.com/support/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('POWERPRESS DOCUMENTATION', 'powerpress')); ?></a></div>
281 <div class="pp-sidenav-extra"><a href="https://www.blubrry.com/podcast-insider/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('PODCAST INSIDER BLOG', 'powerpress')); ?></a></div>
282 <div class="pp-sidenav-extra"><a href="https://blubrry.com/manual/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('PODCAST MANUAL', 'powerpress')); ?></a></div>
283 <div class="pp-sidenav-extra"><a href="https://blubrry.com/services/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY RESOURCES', 'powerpress')); ?></a></div>
284 <div class="pp-sidenav-extra"><a href="https://blubrry.com/support/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY SUPPORT', 'powerpress')); ?></a></div>
285 <div class="pp-sidenav-extra"><a href="https://wordpress.org/support/plugin/powerpress/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY POWERPRESS FORUM', 'powerpress')); ?></a></div>
286 </div>
287 </div>
288
289 <?php
290 if( $General === false )
291 $General = powerpress_get_settings('powerpress_general');
292 $General = powerpress_default_settings($General, 'appearance');
293 if( !isset($General['player_function']) )
294 $General['player_function'] = 1;
295 if( !isset($General['player_aggressive']) )
296 $General['player_aggressive'] = 0;
297 if( !isset($General['new_window_width']) )
298 $General['new_window_width'] = '';
299 if( !isset($General['new_window_height']) )
300 $General['new_window_height'] = '';
301 if( !isset($General['player_width']) )
302 $General['player_width'] = '';
303 if( !isset($General['player_height']) )
304 $General['player_height'] = '';
305 if( !isset($General['player_width_audio']) )
306 $General['player_width_audio'] = '';
307 if( !isset($General['disable_appearance']) )
308 $General['disable_appearance'] = false;
309 if( !isset($General['subscribe_links']) )
310 $General['subscribe_links'] = true;
311 if( !isset($General['subscribe_label']) )
312 $General['subscribe_label'] = '';
313 require_once( dirname(__FILE__).'/views/settings_tab_appearance.php' );
314
315 ?>
316
317
318 <div id="website-settings" class="pp-sidenav-tab active">
319 <?php powerpressadmin_website_settings_custom_feed($General, $FeedSettings, $FeedAttribs);
320 powerpress_settings_tab_footer(); ?>
321 </div>
322 <div id="website-shortcodes" class="pp-sidenav-tab">
323 <?php powerpress_shortcode_settings($General, $FeedAttribs);
324 powerpress_settings_tab_footer(); ?>
325 </div>
326 </div>
327
328 <div id="settings-destinations" class="pp-tabcontent">
329 <?php
330 powerpressadmin_edit_destinations($FeedSettings, $General, $FeedAttribs);
331 ?>
332 </div>
333
334 <div id="settings-analytics" class="pp-tabcontent">
335 <div class="pp-sidenav">
336 <?php
337 powerpressadmin_edit_blubrry_services($General);
338 ?>
339 </div>
340 <?php
341 if( $MultiSiteServiceSettings && defined('POWERPRESS_MULTISITE_VERSION') )
342 {
343 PowerPressMultiSitePlugin::edit_blubrry_services($General);
344 }
345 else
346 {
347 powerpressadmin_edit_media_statistics($General);
348 }
349 ?>
350 </div>
351
352 <div id="settings-other" class="pp-tabcontent">
353 <div class="pp-sidenav-toggle-container">
354 <div id="other-toggle-sidenav" class="toggle-sidenav" title="Blubrry Services" onclick="powerpress_displaySideNav(this);">&lt;</div>
355 <div class="pp-sidenav">
356 <?php
357 powerpressadmin_edit_blubrry_services($General);
358 ?>
359 <div class="pp-sidenav-extra" style="margin-top: 10%;"><a href="https://www.blubrry.com/support/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('POWERPRESS DOCUMENTATION', 'powerpress')); ?></a></div>
360 <div class="pp-sidenav-extra"><a href="https://www.blubrry.com/podcast-insider/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('PODCAST INSIDER BLOG', 'powerpress')); ?></a></div>
361 <div class="pp-sidenav-extra"><a href="https://blubrry.com/manual/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('PODCAST MANUAL', 'powerpress')); ?></a></div>
362 <div class="pp-sidenav-extra"><a href="https://blubrry.com/services/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY RESOURCES', 'powerpress')); ?></a></div>
363 <div class="pp-sidenav-extra"><a href="https://blubrry.com/support/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY SUPPORT', 'powerpress')); ?></a></div>
364 <div class="pp-sidenav-extra"><a href="https://wordpress.org/support/plugin/powerpress/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY POWERPRESS FORUM', 'powerpress')); ?></a></div>
365 </div>
366 </div>
367 <button style="display: none;" id="other-default-open" class="pp-sidenav-tablinks active" onclick="sideNav(event, 'other-all')"><img class="pp-nav-icon" style="width: 22px;" alt="" src="<?php echo powerpress_get_root_url(); ?>images/settings_nav_icons/rss-symbol.svg"><?php echo htmlspecialchars(__('Hidden button', 'powerpress')); ?></button>
368 <div id="other-all" class="pp-sidenav-tab active">
369 <?php
370 powerpressadmin_settings_tab_other($General, $FeedSettings, $feed_slug, $cat_ID, $FeedAttribs);
371 powerpress_settings_tab_footer();
372 ?>
373 </div>
374 </div>
375 <div id="settings-make-money" class="pp-tabcontent">
376 <div class="pp-sidenav-toggle-container">
377 <div id="advanced-toggle-sidenav" class="toggle-sidenav" title="Blubrry Services" onclick="powerpress_displaySideNav(this);">&lt;</div>
378 <div class="pp-sidenav">
379 <?php
380 powerpressadmin_edit_blubrry_services($General);
381 ?>
382 <div class="pp-sidenav-extra" style="margin-top: 10%;"><a href="https://www.blubrry.com/support/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('POWERPRESS DOCUMENTATION', 'powerpress')); ?></a></div>
383 <div class="pp-sidenav-extra"><a href="https://www.blubrry.com/podcast-insider/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('PODCAST INSIDER BLOG', 'powerpress')); ?></a></div>
384 <div class="pp-sidenav-extra"><a href="https://blubrry.com/manual/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('PODCAST MANUAL', 'powerpress')); ?></a></div>
385 <div class="pp-sidenav-extra"><a href="https://blubrry.com/services/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY RESOURCES', 'powerpress')); ?></a></div>
386 <div class="pp-sidenav-extra"><a href="https://blubrry.com/support/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY SUPPORT', 'powerpress')); ?></a></div>
387 <div class="pp-sidenav-extra"><a href="https://wordpress.org/support/plugin/powerpress/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY POWERPRESS FORUM', 'powerpress')); ?></a></div>
388 </div>
389 </div>
390 <?php
391 $publisher_origin = rtrim(powerpress_get_publish_url(), '/'); ?>
392 <button style="display: none;" id="make-money-default-open" class="pp-sidenav-tablinks active" onclick="sideNav(event, 'make-money-all')"><img class="pp-nav-icon" style="width: 22px;" alt="" src="<?php echo powerpress_get_root_url(); ?>images/settings_nav_icons/rss-symbol.svg"><?php echo htmlspecialchars(__('Hidden button', 'powerpress')); ?></button>
393
394 <div id="make-money-all" class="pp-sidenav-tab active">
395 <div class="pp_container">
396 <h1 class="pp-heading"><?php echo __('Programmatic Advertising', 'powerpress'); ?></h1>
397 <br />
398 <p class="pp-sub"><!-- TODO: Update copy? --><?php echo __('As a Blubrry hosting customer, you have access to our Programmatic Advertising service, which automatically puts ads into your show and pays YOU out directly from Blubrry! Simply configure your shows in the Blubrry Publisher then use the link there to sync you WordPress site.', 'powerpress'); ?></p>
399 <br />
400 <p class="pp-main"><a class="pp-main"
401 href="<?php echo $publisher_origin; ?>/partners/programmatic-advertising-management/"
402 class="pp_align-center"><?php echo __('Configure Shows for Programmatic Ads', 'powerpress'); ?></a></p>
403
404 </div>
405 </div>
406 </div>
407
408 <div id="settings-live-item" class="pp-tabcontent">
409 <div class="pp-sidenav-toggle-container">
410 <div id="advanced-toggle-sidenav" class="toggle-sidenav" title="Blubrry Services" onclick="powerpress_displaySideNav(this);">&lt;</div>
411 <div class="pp-sidenav">
412 <?php
413 powerpressadmin_edit_blubrry_services($General);
414 ?>
415 <div class="pp-sidenav-extra" style="margin-top: 10%;"><a href="https://www.blubrry.com/support/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('POWERPRESS DOCUMENTATION', 'powerpress')); ?></a></div>
416 <div class="pp-sidenav-extra"><a href="https://www.blubrry.com/podcast-insider/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('PODCAST INSIDER BLOG', 'powerpress')); ?></a></div>
417 <div class="pp-sidenav-extra"><a href="https://blubrry.com/manual/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('PODCAST MANUAL', 'powerpress')); ?></a></div>
418 <div class="pp-sidenav-extra"><a href="https://blubrry.com/services/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY RESOURCES', 'powerpress')); ?></a></div>
419 <div class="pp-sidenav-extra"><a href="https://blubrry.com/support/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY SUPPORT', 'powerpress')); ?></a></div>
420 <div class="pp-sidenav-extra"><a href="https://wordpress.org/support/plugin/powerpress/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY POWERPRESS FORUM', 'powerpress')); ?></a></div>
421 </div>
422 </div>
423 <?php
424 powerpressadmin_live_item_options($FeedSettings);
425 ?>
426 </div>
427
428 <div id="settings-experimental" class="pp-tabcontent">
429 <div class="pp-sidenav-toggle-container">
430 <div id="advanced-toggle-sidenav" class="toggle-sidenav" title="Blubrry Services" onclick="powerpress_displaySideNav(this);">&lt;</div>
431 <div class="pp-sidenav">
432 <?php
433 powerpressadmin_edit_blubrry_services($General);
434 ?>
435 <div class="pp-sidenav-extra" style="margin-top: 10%;"><a href="https://www.blubrry.com/support/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('POWERPRESS DOCUMENTATION', 'powerpress')); ?></a></div>
436 <div class="pp-sidenav-extra"><a href="https://www.blubrry.com/podcast-insider/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('PODCAST INSIDER BLOG', 'powerpress')); ?></a></div>
437 <div class="pp-sidenav-extra"><a href="https://blubrry.com/manual/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('PODCAST MANUAL', 'powerpress')); ?></a></div>
438 <div class="pp-sidenav-extra"><a href="https://blubrry.com/services/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY RESOURCES', 'powerpress')); ?></a></div>
439 <div class="pp-sidenav-extra"><a href="https://blubrry.com/support/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY SUPPORT', 'powerpress')); ?></a></div>
440 <div class="pp-sidenav-extra"><a href="https://wordpress.org/support/plugin/powerpress/" class="pp-sidenav-extra-text"><?php echo htmlspecialchars(__('BLUBRRY POWERPRESS FORUM', 'powerpress')); ?></a></div>
441 </div>
442 </div>
443 <?php
444 powerpressadmin_experimental_options($FeedSettings);
445 ?>
446 </div>
447 </div>
448 <div class="clear"></div>
449
450 <div class="clear"></div>
451 <?php
452
453
454 }
455
456 function powerpressadmin_edit_podcast_channel($FeedSettings, $General)
457 {
458 // TODO
459 ?>
460 <input type="hidden" name="action" value="powerpress-save-customfeed" />
461 <p style="margin-bottom: 0;">
462 <?php echo __('Configure your custom podcast feed.', 'powerpress'); ?>
463 </p>
464 <?php
465 }
466
467 function powerpressadmin_edit_category_feed($FeedSettings, $General)
468 {
469 ?>
470 <input type="hidden" name="action" value="powerpress-save-categoryfeedsettings" />
471 <p style="margin-bottom: 0;">
472 <?php echo __('Configure your category feed to support podcasting.', 'powerpress'); ?>
473 </p>
474 <?php
475 }
476
477 function powerpressadmin_edit_feed_general($FeedSettings, $General, $FeedAttribs)
478 {
479 require_once('powerpressadmin-tags.php');
480 $warning = '';
481 $episode_count = powerpress_get_episode_count('podcast');
482 if( $episode_count == 0 )
483 {
484 $warning = __('WARNING: You must create at least one podcast episode for your podcast feed to be valid.', 'powerpress');
485 }
486
487 $feed_link = '';
488 switch( $FeedAttribs['type'])
489 {
490 case 'category': {
491 if( !empty($General['cat_casting_podcast_feeds']) )
492 $feed_link = get_category_feed_link($FeedAttribs['category_id'], 'podcast');
493 else // Use the old link
494 $feed_link = get_category_feed_link($FeedAttribs['category_id']);
495 }; break;
496 case 'ttid': {
497 $feed_link = get_term_feed_link($FeedAttribs['term_taxonomy_id'], $FeedAttribs['taxonomy_type'], 'rss2');
498 }; break;
499 case 'post_type': {
500 $feed_link = get_post_type_archive_feed_link($FeedAttribs['post_type'], $FeedAttribs['feed_slug']);
501 }; break;
502 case 'channel': {
503 $feed_link = get_feed_link($FeedAttribs['feed_slug']);
504 }; break;
505 default: {
506 $feed_link = get_feed_link('podcast');
507 }; break;
508 }
509
510 if( !isset($FeedSettings['apply_to']) )
511 $FeedSettings['apply_to'] = 1;
512 ?>
513 <h1 class="pp-heading"><?php echo __('Podcast Feeds', 'powerpress'); ?></h1>
514 <p class="pp-settings-text"><?php echo __('Your podcast RSS feed: ', 'powerpress'); ?>
515 <a href="<?php echo esc_attr($feed_link); ?>"> <?php echo esc_attr($feed_link); ?> </a>
516 </p>
517
518 <div class="pp-settings-section">
519 <h2><?php echo __('Enhance Feeds', 'powerpress'); ?></h2>
520 <ul>
521 <li>
522 <input class="pp-settings-radio" type="radio" name="Feed[apply_to]" value="1" <?php if( $FeedSettings['apply_to'] == 1 ) echo 'checked'; ?> />
523 <div class="pp-settings-subsection">
524 <p class="pp-main"><?php echo __('Enhance All Feeds', 'powerpress'); ?> (<?php echo __('Recommended', 'powerpress'); ?>)</p>
525 <p class="pp-sub"><?php echo __('Adds podcasting support to all feeds', 'powerpress'); ?></p>
526 </div>
527 </li>
528 <li>
529 <input class="pp-settings-radio" type="radio" name="Feed[apply_to]" value="2" <?php if( $FeedSettings['apply_to'] == 2 ) echo 'checked'; ?> />
530 <div class="pp-settings-subsection">
531 <p class="pp-main"><?php echo __('Enhance Main Feed Only', 'powerpress'); ?></p>
532 <p class="pp-sub"><?php echo __('Adds podcasting support to your main feed only', 'powerpress'); ?></p>
533 </div>
534 </li>
535 <li>
536 <input class="pp-settings-radio" type="radio" name="Feed[apply_to]" value="0" <?php if( $FeedSettings['apply_to'] == 0 ) echo 'checked'; ?> />
537 <div class="pp-settings-subsection">
538 <p class="pp-main"><?php echo __('Do Not Enhance Feeds', 'powerpress'); ?></p>
539 <p class="pp-sub"><?php echo __('Feed Settings below will only apply to your podcast channel feeds', 'powerpress'); ?></p>
540 </div>
541 </li>
542 </ul>
543 </div>
544 <div class="pp-settings-section">
545 <h2><?php echo __('Podcast Feeds', 'powerpress'); ?></h2>
546 <?php if( $warning ) { ?>
547 <span class="powerpress-error" style="background-color: #FFEBE8; border-color: #CC0000; padding: 6px 10px;"><?php echo $warning; ?></span>
548 <?php } ?>
549 <?php
550
551 //$General = get_option('powerpress_general');
552 $Feeds = array('podcast'=> __('Special Podcast only Feed', 'powerpress') );
553 if( isset($General['custom_feeds']['podcast']) )
554 $Feeds = $General['custom_feeds'];
555 else if( isset($General['custom_feeds'])&& is_array($General['custom_feeds']) )
556 $Feeds += $General['custom_feeds'];
557
558 foreach( $Feeds as $feed_slug=> $feed_title )
559 {
560 if( empty($feed_title) )
561 $feed_title = $feed_slug;
562 $edit_link = admin_url( 'admin.php?page=powerpress/powerpressadmin_customfeeds.php&amp;action=powerpress-editfeed&amp;feed_slug=') . $feed_slug;
563 ?>
564 <p class="pp-settings-text-with-label"><b><?php echo $feed_title; ?></b></p>
565 <p class="pp-label-bottom"><a href="<?php echo get_feed_link($feed_slug); ?>" title="<?php echo $feed_title; ?>" target="_blank"><?php echo get_feed_link($feed_slug); ?></a>
566 <?php if( defined('POWERPRESS_FEEDVALIDATOR_URL') ) { ?>
567 - <a href="<?php echo POWERPRESS_FEEDVALIDATOR_URL. urlencode(get_feed_link($feed_slug)); ?>" target="_blank"><?php echo __('Validate Feed', 'powerpress'); ?></a>
568 <?php } ?>
569 <?php if( false && $feed_slug != 'podcast' ) { ?>
570 - <a href="<?php echo $edit_link; ?>" title="<?php echo __('Edit Podcast Channel', 'powerpress'); ?>"><?php echo __('Edit', 'powerpress'); ?></a>
571 <?php } ?>
572 </p>
573 <?php } ?>
574 <p class="pp-settings-text"><?php echo __('These are podcast only feeds suitable for submission podcast directories such as Apple Podcasts.', 'powerpress'); ?></p>
575 <p style="margin-bottom: 3ch;" class="description pp-settings-text"><?php echo __('Note: We do not recommend submitting your main site feed to podcast directories such as iTunes. iTunes and many other podcast directories work best with feeds that do not have regular blog posts mixed in.', 'powerpress'); ?></p>
576
577 <div>
578 <input type="hidden" name="General[feed_action_hook]" value="0" />
579 <input class="pp-settings-checkbox" type="checkbox" name="General[feed_action_hook]" value="1" <?php if( !empty($General['feed_action_hook']) && $General['feed_action_hook'] == 1 ) echo 'checked '; ?>/>
580 <div class="pp-settings-subsection">
581 <p class="pp-settings-text"><?php echo __('Do not allow other plugins to modify podcast feeds.', 'powerpress'); ?></p>
582 </div>
583 </div>
584 <div>
585 <input type="hidden" name="General[feed_accel]" value="0" />
586 <input class="pp-settings-checkbox" type="checkbox" name="General[feed_accel]" value="1" <?php if( !empty($General['feed_accel']) && $General['feed_accel'] == 1 ) echo 'checked '; ?>/>
587 <div class="pp-settings-subsection">
588 <p class="pp-settings-text"><?php echo __('Accelerate feed', 'powerpress'); ?></p>
589 </div>
590 </div>
591
592 </div>
593
594 <div class="pp-settings-section">
595 <h2><?php echo __('Feed Discovery', 'powerpress'); ?></h2>
596 <input class="pp-settings-checkbox" type="checkbox" name="General[feed_links]" value="1" <?php if( !empty($General['feed_links']) && $General['feed_links'] == 1 ) echo 'checked '; ?>/>
597 <div class="pp-settings-subsection">
598 <p class="pp-main"><?php echo __('Include podcast feed links in HTML headers.', 'powerpress'); ?>
599 <p class="pp-label-bottom"><?php echo __('Adds "feed discovery" links to your web site\'s headers allowing web browsers and feed readers to auto-detect your podcast feeds.', 'powerpress'); ?></p></p>
600 </div>
601 </div>
602
603 <div class="pp-settings-section">
604 <h2><?php echo __('RSS2 Image', 'powerpress'); ?></h2>
605 <input type="hidden" name="General[disable_rss_image]" value="1" />
606 <input class="pp-settings-checkbox" type="checkbox" name="General[disable_rss_image]" value="0" <?php if( empty($General['disable_rss_image']) ) echo 'checked '; ?>/>
607 <div class="pp-settings-subsection">
608 <p class="pp-main"><?php echo __('Include RSS Image in feeds.', 'powerpress'); ?></label></p>
609 </div>
610 </div>
611
612 <div class="pp-settings-section">
613 <h2><?php echo __('Emoji', 'powerpress'); ?></h2>
614 <?php
615 if( 'utf8mb4' != $GLOBALS['wpdb']->charset )
616 {
617 ?>
618 <p class="pp-settings-text" style="font-weight: bold; color: #CC0000;">
619 <?php
620 echo __('Emoji may not be supported with your WordPress installation. Please upgrade your database to support utf8mb4 available in WordPress 4.2 and newer.', 'powerpress');
621 ?>
622 </p>
623 <?php } ?>
624 <input type="hidden" name="General[rss_emoji]" value="0" />
625 <input class="pp-settings-checkbox" type="checkbox" name="General[rss_emoji]" value="1" <?php if( !empty($General['rss_emoji']) ) echo 'checked '; ?>/>
626 <div class="pp-settings-subsection">
627 <p class="pp-main"><?php echo __('Include Emoji in feeds.', 'powerpress'); ?></p>
628 <p class="pp-label-bottom"><a href="https://blubrry.com/support/powerpress-documentation/feeds/#emoji" target="_blank"><?php echo __('Learn more', 'powerpress'); ?></a></p>
629 </div>
630 </div>
631 <?php powerpress_admin_tags(); ?>
632 <?php
633 }
634
635 function powerpressadmin_edit_feed_settings($FeedSettings, $General, $FeedAttribs = array() )
636 {
637 $SupportUploads = powerpressadmin_support_uploads();
638 if( !isset($FeedSettings['posts_per_rss']) )
639 $FeedSettings['posts_per_rss'] = '';
640 if( !isset($FeedSettings['copyright']) )
641 $FeedSettings['copyright'] = '';
642 if (!isset($FeedSettings['copyright_url']) )
643 $FeedSettings['copyright_url'] = '';
644 if( !isset($FeedSettings['email']) )
645 $FeedSettings['email'] = '';
646 if( !isset($FeedSettings['title']) )
647 $FeedSettings['title'] = '';
648 if( !isset($FeedSettings['rss_language']) )
649 $FeedSettings['rss_language'] = '';
650
651 $feed_link = '';
652 switch( $FeedAttribs['type'])
653 {
654 case 'category': {
655 if( !empty($General['cat_casting_podcast_feeds']) )
656 $feed_link = get_category_feed_link($FeedAttribs['category_id'], 'podcast');
657 else // Use the old link
658 $feed_link = get_category_feed_link($FeedAttribs['category_id']);
659 }; break;
660 case 'ttid': {
661 $feed_link = get_term_feed_link($FeedAttribs['term_taxonomy_id'], $FeedAttribs['taxonomy_type'], 'rss2');
662 }; break;
663 case 'post_type': {
664 $feed_link = get_post_type_archive_feed_link($FeedAttribs['post_type'], $FeedAttribs['feed_slug']);
665 }; break;
666 case 'channel': {
667 $feed_link = get_feed_link($FeedAttribs['feed_slug']);
668 }; break;
669 default: {
670 $feed_link = get_feed_link('podcast');
671 }; break;
672 }
673
674 $cat_ID = $FeedAttribs['category_id'];
675
676 ?>
677 <h1 class="pp-heading"><?php echo __('Feed Settings', 'powerpress'); ?></h1>
678 <p class="pp-settings-text"><?php echo __('Your podcast RSS feed: ', 'powerpress'); ?>
679 <a href="<?php echo esc_attr($feed_link); ?>"> <?php echo esc_attr($feed_link); ?> </a>
680 </p>
681
682 <div class="pp-settings-section">
683 <h2><?php echo __('Feed Title', 'powerpress'); ?></h2>
684 <label for="Feed[title]" class="pp-settings-label"><?php echo __('Show Title', 'powerpress'); ?></label>
685 <input class="pp-settings-text-input" type="text" name="Feed[title]" value="<?php echo esc_attr($FeedSettings['title']); ?>" maxlength="255" />
686 <label for="Feed[title]" class="pp-settings-label-under">
687 <?php if( $cat_ID ) { ?>
688 <?php echo __('Leave blank to use default category title', 'powerpress'); ?>
689 <?php } else { ?>
690 <?php echo __('Leave blank to use blog title for the show', 'powerpress'); ?>
691 <?php } ?>
692 </label>
693 </div>
694
695 <div class="pp-settings-section">
696 <h2><?php echo __('Feed Description', 'powerpress'); ?></h2>
697 <label for="Feed[description]" class="pp-settings-label"><?php echo __('Show Description', 'powerpress'); ?></label>
698 <input class="pp-settings-text-input" type="text" name="Feed[description]" value="<?php echo esc_attr( !empty($FeedSettings['description'])? $FeedSettings['description']:''); ?>" maxlength="1000" />
699 <label for="Feed[description]" class="pp-settings-label-under">
700 <?php if( $cat_ID ) { ?>
701 <?php echo __('Leave blank to use category description', 'powerpress'); ?>
702 <?php } else { ?>
703 <?php echo __('Leave blank to use blog description', 'powerpress'); ?>
704 <?php } ?>
705 </label>
706 </div>
707
708 <div class="pp-settings-section">
709 <h2><?php echo __('Feed Landing Page URL', 'powerpress'); ?></h2>
710 <input class="pp-settings-text-input" type="text" name="Feed[url]"
711 value="<?php echo esc_attr(!empty($FeedSettings['url']) ? $FeedSettings['url'] : ''); ?>"
712 maxlength="255" />
713 <label for="Feed[url]" class="pp-settings-label-under">
714 <?php echo $cat_ID
715 ? __('Leave blank to use category page', 'powerpress')
716 : __('Leave blank to use home page', 'powerpress'); ?>
717 </label>
718 <p class="description">
719 <?php if ($cat_ID): ?>
720 <?php echo __('Category page URL', 'powerpress'); ?>: <?php echo get_category_link($cat_ID); ?>
721 <?php else: ?>
722 e.g. <?php echo get_bloginfo('url'); ?>/custom-page/
723 <?php endif; ?>
724 </p>
725 </div>
726
727 <div class="pp-settings-section">
728 <h2><?php echo __('PodcastMirror Feed URL', 'powerpress'); ?><br /></h2>
729 <label for="Feed[feed_redirect_url]" class="pp-settings-label"><?php echo __('URL', 'powerpress'); ?></label>
730 <input class="pp-settings-text-input" type="text" name="Feed[feed_redirect_url]" value="<?php echo esc_attr(!empty($FeedSettings['feed_redirect_url'])? $FeedSettings['feed_redirect_url']:''); ?>" maxlength="100" />
731 <label for="Feed[feed_redirect_url]" class="pp-settings-label-under">
732 <?php echo __('Leave blank to use built-in feed', 'powerpress'); ?>
733 </label>
734 <span class="pp-right-label" style="float: right;"><a href="https://podcastmirror.com" target="_blank"><?php echo __('Learn more', 'powerpress'); ?></a></span>
735 <p style="margin-top: 1em;" class="pp-settings-text"><?php echo __('Use this option to mirror your podcast feed to provide fast, scalable subscriptions to your show. This option is not required. Service is FeedBurner compatible.', 'powerpress'); ?></p>
736 <?php
737 $link = $feed_link;
738 if( strstr($link, '?') )
739 $link .= "&redirect=no";
740 else
741 $link .= "?redirect=no";
742 ?>
743 <p class="pp-settings-text"><?php echo __('Bypass Redirect URL', 'powerpress'); ?>: <a href="<?php echo $link; ?>" target="_blank"><?php echo $link; ?></a></p>
744 </div>
745
746 <div class="pp-settings-section">
747 <h2><?php echo __('Show the most recent', 'powerpress'); ?></h2>
748 <p class="pp-settings-text"><?php echo __('Please enable the Feed Episode Maximizer option to optimize your feed for more than 10 episodes.', 'powerpress'); ?></p>
749 <label for="Feed[posts_per_rss]" class="pp-settings-label"><?php echo __('Show the most recent', 'powerpress'); ?></label>
750 <input class="pp-settings-text-input" type="text" name="Feed[posts_per_rss]" value="<?php echo ( !empty($FeedSettings['posts_per_rss'])? $FeedSettings['posts_per_rss']:''); ?>" maxlength="5" />
751 <label for="Feed[posts_per_rss]" class="pp-settings-label-under">
752 <?php echo sprintf(__('episodes / posts per feed (site default: %d)', 'powerpress'), get_option('posts_per_rss')); ?>
753 </label>
754 </div>
755
756 <div class="pp-settings-section">
757 <h2><?php echo __('Feed Lock', 'powerpress'); ?><br /></h2>
758 <input type="checkbox" onclick="powerpress_toggle_lock_section(event)" class="pp-settings-checkbox" name="Feed[pp_enable_feed_lock]" value="1" <?php echo ( !empty($FeedSettings['pp_enable_feed_lock']) || empty($FeedSettings['email']) ?'checked ':''); ?>/>
759 <div class="pp-settings-subsection" style="border: none;">
760 <p class="pp-sub"><?php echo __('Enable Feed Lock', 'powerpress'); ?></p>
761 </div>
762 <div id="pp-feed-lock-section" style="display: <?php echo empty($FeedSettings['pp_enable_feed_lock']) ? "none" : "block"; ?>">
763 <div>
764 <input class="pp-settings-radio-small" type="radio" style="margin: 2ch 8px 0 1em;vertical-align: top;" class="powerpress_lock_option" id="powerpress_lock_option_1" name="Feed[unlock_podcast]" value="0" <?php if( empty($FeedSettings['unlock_podcast']) ) echo 'checked'; ?> />
765 <div class="pp-settings-subsection-no-border" style="padding-bottom: 0;">
766 <p class="pp-settings-text" style="margin: 0;"><?php echo __('Yes - Podcast cannot be imported to a new platform.', 'powerpress'); ?></p>
767 <p class="pp-sub" style="font-size: 14px"><?php echo __('Default', 'powerpress'); ?></p>
768 </div>
769 </div>
770 <div>
771 <input class="pp-settings-radio-small" type="radio" style="margin: 2ch 8px 0 1em;vertical-align: top;" class="powerpress_lock_option" id="powerpress_lock_option_2" name="Feed[unlock_podcast]" value="1" <?php if( isset($FeedSettings['unlock_podcast']) && $FeedSettings['unlock_podcast'] == 1 ) echo 'checked'; ?> />
772 <div class="pp-settings-subsection-no-border">
773 <p class="pp-settings-text" style="margin: 0;"><?php echo __('No - Podcast can be imported to a new platform.', 'powerpress'); ?></p>
774 </div>
775 </div>
776 </div>
777 </div>
778
779 <?php
780 if( in_array($FeedAttribs['type'], array('channel', 'category', 'post_types', 'general')) )
781 {
782 ?>
783 <div class="pp-settings-section">
784 <h2><?php echo __('Feed Episode Maximizer', 'powerpress'); ?></h2>
785 <input class="pp-settings-checkbox" type="checkbox" name="Feed[maximize_feed]" value="1" <?php if( !empty($FeedSettings['maximize_feed']) ) echo 'checked'; ?> />
786 <div class="pp-settings-subsection">
787 <p class="pp-main"><?php echo __('Maximize the number of episodes while maintaining an optimal feed size.', 'powerpress'); ?></p>
788 <p class="pp-settings-text"><a href="https://blubrry.com/support/powerpress-documentation/feeds/#maximizer" target="_blank"><?php echo __('Learn more', 'powerpress'); ?></a></p>
789 </div>
790 </div>
791
792 <?php
793 }
794 ?>
795
796 <div class="pp-settings-section">
797 <h2><?php echo __('Feed Language', 'powerpress'); ?></h2>
798 <select class="pp-settings-select" name="Feed[rss_language]">
799 <?php
800 $Languages = powerpress_languages();
801
802 echo '<option value="">'. __('Blog Default Language', 'powerpress') .'</option>';
803 foreach( $Languages as $value=> $desc )
804 echo "\t<option value=\"$value\"". ($FeedSettings['rss_language']==$value?' selected':''). ">". esc_attr($desc)."</option>\n";
805 ?>
806 </select>
807 <label class="pp-settings-label-under" for="Feed[rss_language]">
808 <?php
809 $rss_language = get_bloginfo_rss('language');
810 $rss_language = strtolower($rss_language);
811 if( isset($Languages[ $rss_language ]) )
812 {
813 ?>
814 <?php echo __('Blog Default', 'powerpress'); ?>: <?php echo $Languages[ $rss_language ]; ?>
815 <?php } else { ?>
816 <?php echo __('Blog Default', 'powerpress'); ?>: <?php echo $rss_language; ?>
817 <?php } ?>
818 </label>
819 </div>
820
821 <div class="pp-settings-section">
822 <h2><?php echo __('Copyright', 'powerpress'); ?></h2>
823 <?php
824 powerpress_render_template([
825 'type' => 'copyright',
826 'context' => 'channel',
827 'FeedSlug' => $FeedAttribs['feed_slug'],
828 'Data' => $FeedSettings,
829 'NamePrefix' => "Feed",
830 'hide_section_header' => true,
831 'show_inherit_checkbox' => false
832 ]);
833 ?>
834 </div>
835
836 <div class="pp-settings-section">
837 <h2><?php echo __('Author Email', 'powerpress'); ?></h2>
838 <input type="text" class="pp-settings-text-input" name="Feed[email]" value="<?php echo esc_attr($FeedSettings['email']); ?>" maxlength="255" />
839 <label for="Feed[email]" class="pp-settings-label-under"><?php echo __('Apple will email this address when your podcast is accepted into the Apple Podcast Directory.', 'powerpress'); ?></label>
840 <div class="pp-settings-subsection" style="border: none; display: flex; align-items: center; justify-content: flex-start;">
841 <input type="hidden" name="Feed[pp_enable_email]" value="0" />
842 <input type="checkbox" style="margin-top: 0;" class="pp-settings-checkbox" name="Feed[pp_enable_email]" value="1" <?php echo ( !isset($FeedSettings['pp_enable_email']) || $FeedSettings['pp_enable_email'] == 1 ? 'checked ':''); ?>/>
843 <?php echo __('Include email in feed', 'powerpress'); ?>
844 <div class="pp-tooltip-right" style="margin-left: 5px; height: 16px; width: 16px;">i
845 <span class="text-pp-tooltip" style="top: -50%; min-width: 200px;"><?php echo esc_html(__('Email addresses in RSS feeds are enabled by default as this is often needed for verification when claiming or submitting your show to podcast apps/directories. You can disable this option when you have no need to confirm ownership of the feed and the email address will be removed.', 'powerpress')); ?></span>
846 </div>
847 </div>
848 </div>
849
850 <div class="pp-settings-section">
851 <div class="row">
852 <h2 style="margin: 0;">
853 <?php echo __('Shows & Content You Love', 'powerpress'); ?>
854 </h2>
855 <div class="pp-tooltip-right" style="margin-left: 5px; height: 16px; width: 16px;">i
856 <span class="text-pp-tooltip" style="top: -50%; min-width: 200px;"><?php echo esc_html(__('You can now recommend podcasts you love and or specific episodes of content that will aggregated by podcast apps and presented to your listeners in apps found at podcastapps.com', 'powerpress')); ?></span>
857 </div>
858 </div>
859 <?php if (!empty(get_option('powerpress_creds'))) { ?>
860 <div class="col mt-3" id="remote-item-add-block">
861 <div class="row">
862 <div class="form-check" style="margin-right: 20px;">
863 <input class="form-check-input" type="radio" name="podroll" id="add-podroll" value="1">
864 <label class="form-check-label" for="daily" style="color: black; font-size: 1rem;">
865 <?php echo __("Add to PodRoll", "powerpress"); ?>
866 <div class="pp-tooltip-right" style="margin-left: 5px; height: 16px; width: 16px;">i
867 <span class="text-pp-tooltip" style="top: -50%; min-width: 200px;"><?php echo esc_html(__('Add shows that you would like to recommend to your listeners.', 'powerpress')); ?></span>
868 </div>
869 </label>
870 </div>
871 <div class="form-check">
872 <input class="form-check-input" type="radio" name="podroll" id="add-feed" value="0">
873 <label class="form-check-label" for="weekly" style="color: black; font-size: 1rem;">
874 <?php echo __("Add to RSS Feed", "powerpress"); ?>
875 <div class="pp-tooltip-right" style="margin-left: 5px; height: 16px; width: 16px;">i
876 <span class="text-pp-tooltip" style="top: -50%; min-width: 200px;"><?php echo esc_html(__('Have an external podcast episode or resource you would like to highlight added to your RSS feed.', 'powerpress')); ?></span>
877 </div>
878 </label>
879 </div>
880 </div>
881 <div id="show-search-container" class="row mt-3" style="display: none;">
882 <div style="display: flex; align-items: center; justify-content: space-between; width: 100%;">
883 <input type="hidden" id="podcast-guid" class="form-control" >
884 <input type="hidden" id="podcast-link" class="form-control" >
885 <input type="hidden" id="podcast-medium" class="form-control">
886 <input type="text" id="search-podcasts" class="pp-settings-text-input" style="width: 90%;" placeholder="Search for a show">
887 <span id="search-for-show" class="input-group-text" style="cursor: pointer; color: #1976d2; font-weight: bold;">
888 <?php echo __("Search", "powerpress"); ?>
889 </span>
890 </div>
891 </div>
892 <ul id="feed-search-results">
893 </ul>
894 <div id="episode-search-container" style="display: none">
895 <div class="row mt-3">
896 <input type="hidden" id="item-guid" class="form-control" >
897 <input style="width: 90%;" type="text" id="search-episodes" class="pp-settings-text-input" onkeyup="searchList('search-episodes', 'episode-search-results')" placeholder="Search for an episode (optional)">
898 </div>
899 <ul id="episode-search-results">
900 </ul>
901 </div>
902 <div class="row mt-3" id="add-episode-container" style="display: none; justify-content: flex-end;">
903 <a id="add-remote-item" style="color: #1976d2; cursor: pointer; font-weight: bold;">
904 <?php echo __("Add Content", "powerpress"); ?>
905 </a>
906 </div>
907 </div>
908 <?php
909 $existingRemoteItems = $FeedSettings['remote_items'] ?? [];
910 $existingPodrollItems = [];
911 $existingFeedItems = [];
912
913 foreach ($existingRemoteItems as $remoteItem) {
914 if ($remoteItem['podroll'] == 1)
915 $existingPodrollItems[] = $remoteItem;
916 else
917 $existingFeedItems[] = $remoteItem;
918 }
919
920 ?>
921 <div class="row mt-2">
922 <div class="col-md-6">
923 <h3 style="font-weight: bold;">
924 <?php echo __("PodRoll Shows", "powerpress"); ?>
925 </h3>
926 <div class="col" style="border-radius: 5px; border: 1px solid #E2E2E2;" id="podroll-list-col">
927 <?php foreach($existingPodrollItems as $item) { ?>
928 <div id="remote-item-<?php echo $item['feed_guid'];?>">
929 <div class="row pl-3 pr-2" style="display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #ddd;">
930 <h4 style="margin: 0; padding-left: 5%; width: 80%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" class="list-result">
931 <?php echo esc_html($item['item_title'] ?? 'RemoteItem'); ?>
932 </h4>
933 <input type="hidden" name="Feed[remoteItems][podroll][<?php echo $item['feed_guid']; ?>][item_title]" value="<?php echo htmlspecialchars($item['item_title']); ?>" />
934 <input type="hidden" name="Feed[remoteItems][podroll][<?php echo $item['feed_guid']; ?>][link]" value="<?php echo htmlspecialchars($item['item_link']); ?>" />
935 <input type="hidden" name="Feed[remoteItems][podroll][<?php echo $item['feed_guid']; ?>][medium]" value="<?php echo htmlspecialchars($item['medium'] ?? 'podcast'); ?>" />
936 <input type="hidden" name="Feed[remoteItems][podroll][<?php echo $item['feed_guid']; ?>][title]" value="<?php echo htmlspecialchars($item['title'] ?? ''); ?>" />
937 <div style="height: 100%; width: 10%; display: flex; align-items: center; justify-content: center;">
938 <a href="<?php echo htmlspecialchars($item['item_link']); ?>" target="_blank" style="text-decoration: none;">
939 <span class="dashicons dashicons-rss"></span>
940 </a>
941 </div>
942 <button type="button" style="width: 10%; border: none; background: inherit; color: red; font-size: 25px; cursor: pointer;" id="remove-remote-item-<?php echo $item['feed_guid']; ?>">&times;</button>
943 </div>
944 </div>
945 <?php } ?>
946 </div>
947 </div>
948 <div class="col-md-6">
949 <h3 style="font-weight: bold;">
950 <?php echo __("RSS Feed", "powerpress"); ?>
951 </h3>
952 <div class="col" style="border-radius: 5px; border: 1px solid #E2E2E2;" id="feed-list-col">
953 <?php foreach($existingFeedItems as $item) { ?>
954 <div id="remote-item-<?php echo $item['feed_guid'];?>">
955 <div class="row pl-3 pr-2" style="display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #ddd;">
956 <h4 style="margin: 0; padding-left: 5%; width: 80%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" class="list-result">
957 <?php echo esc_html($item['item_title']); ?>
958 </h4>
959 <input type="hidden" name="Feed[remoteItems][feed][<?php echo $item['feed_guid']; ?>][item_title]" value="<?php echo htmlspecialchars($item['item_title']); ?>" />
960 <input type="hidden" name="Feed[remoteItems][feed][<?php echo $item['feed_guid']; ?>][item_guid]" value="<?php echo htmlspecialchars($item['item_guid'] ?? ''); ?>" />
961 <input type="hidden" name="Feed[remoteItems][feed][<?php echo $item['feed_guid']; ?>][link]" value="<?php echo htmlspecialchars($item['item_link']); ?>" />
962 <input type="hidden" name="Feed[remoteItems][feed][<?php echo $item['feed_guid']; ?>][medium]" value="<?php echo htmlspecialchars($item['medium'] ?? 'podcast'); ?>" />
963 <div style="height: 100%; width: 10%; display: flex; align-items: center; justify-content: center;">
964 <a href="<?php echo htmlspecialchars($item['item_link']); ?>" target="_blank" style="text-decoration: none;">
965 <span class="dashicons dashicons-rss"></span>
966 </a>
967 </div>
968 <button type="button" style="width: 10%; border: none; background: inherit; color: red; font-size: 25px; cursor: pointer;" id="remove-remote-item-<?php echo $item['feed_guid']; ?>">&times;</button>
969 </div>
970 </div>
971 <?php } ?>
972 </div>
973 </div>
974 </div>
975 <?php } else { ?>
976 <div class="col-mt-3">
977 <?php
978 $pp_nonce = powerpress_login_create_nonce();
979 ?>
980 <p><?php echo esc_html(__('A Blubrry account is required to use this feature.', 'powerpress')); ?> <a target="_blank" href="<?php echo admin_url("admin.php?page=powerpressadmin_onboarding.php&step=wantStats"); ?>"><?php echo esc_html(__('Create a free account', 'powerpress')); ?></a> or link your existing account <a target="_blank" href="<?php echo esc_attr(add_query_arg( '_wpnonce', $pp_nonce, admin_url("admin.php?page=powerpressadmin_onboarding.php&step=blubrrySignin&from=powerpressadmin_basic"))); ?>"><?php echo esc_html(__('here', 'powerpress')); ?></a>.</p>
981 </div>
982
983 <?php } ?>
984 </div>
985
986 <div class="pp-settings-section">
987 <h2><?php echo __('Txt Tag', 'powerpress'); ?></h2>
988 <?php
989 powerpress_render_template([
990 'type' => 'txt_tag',
991 'context' => 'channel',
992 'FeedSlug' => $FeedAttribs['feed_slug'],
993 'Data' => $FeedSettings,
994 'NamePrefix' => "Feed",
995 'hide_section_header' => true,
996 'show_inherit_checkbox' => false
997 ]);
998 ?>
999 </div>
1000 <script defer>
1001
1002 document.addEventListener('DOMContentLoaded', function() {
1003 initTxtTagManager('<?php echo $FeedAttribs['feed_slug']; ?>');
1004 });
1005
1006 </script>
1007
1008 <div class="pp-settings-section">
1009 <h2>
1010 <?php echo __('Medium Tag', 'powerpress'); ?>
1011 <div class="pp-tooltip-right" style="height: 16px; width: 16px; font-size: 80%;">i
1012 <span class="text-pp-tooltip" style="top: -50%; min-width: 200px;"><?php echo esc_html(__('This setting tells an application what the content contained within the feed IS, as opposed to what the content is ABOUT in the case of a category.', 'powerpress')); ?></span>
1013 </div>
1014 </h2>
1015 <select class="pp-settings-select" name="Feed[medium]">
1016 <?php
1017 $selectedOption = $FeedSettings['medium'] ?? 'podcast';
1018 $options = [
1019 'podcast',
1020 'music',
1021 'video',
1022 'film',
1023 'audiobook',
1024 'newsletter',
1025 'blog',
1026 'course'
1027 ];
1028
1029 foreach ($options as $option) {
1030 if ($option == $selectedOption) {
1031 echo '<option selected value="'.$option.'">'.$option.'</option>';
1032 } else {
1033 echo '<option value="'.$option.'">'.$option.'</option>';
1034 }
1035 }
1036 ?>
1037 </select>
1038 </div>
1039
1040 <div class="pp-settings-section">
1041 <h2><?php echo __('GUID', 'powerpress'); ?></h2>
1042 <input type="checkbox" onclick="powerpress_toggle_guid_section(event)" class="pp-settings-checkbox" name="Feed[guid_override_check]" value="1" <?php echo ( !empty($FeedSettings['guid_override_check']) ?'checked ':''); ?>/>
1043 <div class="pp-settings-subsection" style="border: none;">
1044 <p class="pp-sub"><?php echo __('Enable GUID Override', 'powerpress'); ?></p>
1045 </div>
1046 <div id="pp-guid-override-section" style="display: <?php echo empty($FeedSettings['guid_override_check']) ? "none" : "block"; ?>">
1047 <label for="Feed[guid_override]" class="pp-settings-label"><?php echo __('Override GUID', 'powerpress'); ?></label>
1048 <input class="pp-settings-text-input" type="text" name="Feed[guid_override]" value="<?php echo esc_attr( !empty($FeedSettings['guid_override'])? $FeedSettings['guid_override']:''); ?>" maxlength="255" />
1049 <label for="Feed[guid_override]" class="pp-settings-label-under">
1050 <?php echo __('You should only override the default PowerPress GUID if you have an existing GUID for your show.', 'powerpress'); ?>
1051 </label>
1052 </div>
1053 </div>
1054
1055 <div class="pp-settings-section">
1056 <h2><?php echo __('Caching Debug Comments', 'powerpress'); ?></h2>
1057 <input class="pp-settings-checkbox" type="checkbox" name="General[allow_feed_comments]" value="1" <?php if( !empty($General['allow_feed_comments']) ) echo 'checked'; ?> />
1058 <div class="pp-settings-subsection">
1059 <p class="pp-main">
1060 <?php echo __('Allow WP Super Cache or W3 Total Cache to add HTML Comments to the bottom of your feeds', 'powerpress'); ?>
1061 (<?php echo __('Recommended unchecked', 'powerpress'); ?>)
1062 </p>
1063 </div>
1064 <p class="pp-label-bottom" style="margin-top: 2ch;"><?php echo __('iTunes is known to have issues with feeds that have HTML comments at the bottom.', 'powerpress'); ?>
1065 <?php echo __('NOTE: This setting should only be enabled for debugging purposes.', 'powerpress'); ?></p>
1066
1067 </div>
1068
1069 <script>
1070 let currentEpisodeList = [];
1071
1072 /**
1073 * escape html special characters to prevent xss and html parsing issues
1074 * @param {string} text - text to escape
1075 * @returns {string} html-escaped text
1076 */
1077 function escapeHtml(text) {
1078 const div = document.createElement('div');
1079 div.textContent = text;
1080 return div.innerHTML;
1081 }
1082
1083 function searchList(searchId, resultsId) {
1084 // Declare variables
1085 var input, filter, ul, li, a, i, txtValue;
1086 input = document.getElementById(searchId);
1087 filter = input.value.toUpperCase();
1088 ul = document.getElementById(resultsId);
1089 li = ul.getElementsByTagName('li');
1090
1091 // Loop through all list items, and hide those who don't match the search query
1092 for (i = 0; i < li.length; i++) {
1093 a = li[i].getElementsByTagName("a")[0];
1094 txtValue = a.textContent || a.innerText;
1095 if (txtValue.toUpperCase().indexOf(filter) > -1 && filter !== '' && !currentBlockList.includes(txtValue)) {
1096 li[i].style.display = "";
1097 } else {
1098 li[i].style.display = "none";
1099 }
1100 }
1101 }
1102
1103 jQuery(document).ready(function() {
1104 jQuery('[name=podroll]').on('change', function() {
1105 let value = jQuery(this).val();
1106 jQuery('#show-search-container').show();
1107 jQuery('#add-episode-container').show()
1108
1109 if (value == 1) {
1110 jQuery('#episode-search-container').hide();
1111 } else {
1112 if (jQuery('#podcast-guid').val() != '')
1113 jQuery('#episode-search-container').show();
1114 }
1115 });
1116
1117 jQuery('#add-remote-item').on('click', function() {
1118 let showGUID = jQuery('#podcast-guid').val();
1119 let showLink = jQuery('#podcast-link').val();
1120 let showTitle = jQuery('#search-podcasts').val();
1121 let medium = jQuery('#podcast-medium').val();
1122
1123 if (!showGUID || showGUID === '') {
1124 jQuery('#remote-item-error').text("You do not currently have a show selected to add.");
1125 jQuery('#remote-item-error-bubble').show();
1126 } else {
1127 let newHTML = '<div id="remote-item-' + showGUID + '">';
1128 newHTML += '<div class="row" style="display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #ddd;">';
1129
1130 if (jQuery('[name=podroll]:checked').val() == 1) { // podroll
1131 newHTML += '<h4 style="margin: 0; padding-left: 5%; width: 80%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" class="list-result">' + escapeHtml(showTitle) + '</h4>';
1132 newHTML += '<input type="hidden" name="Feed[remoteItems][podroll][' + showGUID + '][item_title]" value="' + escapeHtml(showTitle) + '" />';
1133 newHTML += '<input type="hidden" name="Feed[remoteItems][podroll][' + showGUID + '][link]" value="' + escapeHtml(showLink) + '" />';
1134 newHTML += '<input type="hidden" name="Feed[remoteItems][podroll][' + showGUID + '][medium]" value="' + escapeHtml(medium) + '" />';
1135 } else { // feed
1136 let itemGUID = jQuery('#item-guid').val();
1137 let episodeTitle = jQuery('#search-episodes').val();
1138 if (episodeTitle != '') {
1139 newHTML += '<h4 style="margin: 0; padding-left: 5%; width: 80%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" class="list-result">' + escapeHtml(episodeTitle) + '</h4>';
1140 newHTML += '<input type="hidden" name="Feed[remoteItems][feed][' + showGUID + '][item_title]" value="' + escapeHtml(episodeTitle) + '" />';
1141 newHTML += '<input type="hidden" name="Feed[remoteItems][feed][' + showGUID + '][item_guid]" value="' + escapeHtml(itemGUID) + '" />';
1142 } else {
1143 newHTML += '<h4 style="margin: 0; padding-left: 5%; width: 80%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" class="list-result">' + escapeHtml(showTitle) + '</h4>';
1144 newHTML += '<input type="hidden" name="Feed[remoteItems][feed][' + showGUID + '][item_title]" value="' + escapeHtml(showTitle) + '" />';
1145 }
1146 newHTML += '<input type="hidden" name="Feed[remoteItems][feed][' + showGUID + '][link]" value="' + escapeHtml(showLink) + '" />';
1147 newHTML += '<input type="hidden" name="Feed[remoteItems][feed][' + showGUID + '][medium]" value="' + escapeHtml(medium) + '" />';
1148 }
1149 newHTML += '<div style="height: 100%; width: 10%; display: flex; align-items: center; justify-content: center;"><a href="' + escapeHtml(showLink) + '" target="_blank" style="text-decoration: none;"><span class="dashicons dashicons-rss"></span></a></div>';
1150 newHTML += '<button type="button" style="width: 10%; border: none; background: inherit; color: red; font-size: 25px; cursor: pointer;" id="remove-remote-item-' + showGUID + '">&times;</button>';
1151 newHTML += '</div>';
1152 newHTML += '</div>';
1153
1154 if (jQuery('[name=podroll]:checked').val() == 1) { // podroll
1155 jQuery('#podroll-list-col').append(newHTML);
1156 } else { // feed
1157 jQuery('#feed-list-col').append(newHTML);
1158 }
1159
1160 jQuery('#podcast-guid').val('');
1161 jQuery('#podcast-link').val('');
1162 jQuery('#item-guid').val('');
1163 jQuery('#search-podcasts').val('');
1164 jQuery('#search-episodes').val('');
1165 jQuery('#podcast-medium').val('');
1166 jQuery('#episode-search-container').hide();
1167 }
1168 });
1169
1170 jQuery('#search-podcasts').on('keyup', function() {
1171 let value = jQuery('#search-podcasts').val();
1172
1173 if (value == '') {
1174 jQuery('#feed-search-results').empty();
1175 }
1176 });
1177
1178 /**
1179 * enter key handler to trigger podcast search in PodRoll table
1180 */
1181 var searchPodcastsEl = document.getElementById('search-podcasts');
1182 if (searchPodcastsEl) {
1183 searchPodcastsEl.addEventListener('keypress', function(e) {
1184 if (e.key === 'Enter' || e.which === 13) {
1185 e.preventDefault();
1186 document.getElementById('search-for-show').click();
1187 }
1188 });
1189 }
1190
1191 jQuery('#search-for-show').on('click', function() {
1192 // New search, so clean up any old results
1193 jQuery('#episode-search-results').empty();
1194 jQuery('#feed-search-results').empty();
1195 jQuery('#podcast-guid').val('');
1196 jQuery('#podcast-link').val('');
1197 jQuery('#item-guid').val('');
1198 jQuery('#episode-search-container').hide();
1199
1200 jQuery('#remote-item-error-bubble').hide();
1201 let queryStr = jQuery('#search-podcasts').val();
1202
1203 jQuery.ajax( {
1204 type: 'POST',
1205 url: '<?php echo admin_url(); ?>admin-ajax.php',
1206 data: { action: 'powerpress-podcast-index-shows', nonce: '<?php echo wp_create_nonce('powerpress-edit-feed'); ?>', piQuery: queryStr },
1207 timeout: (30 * 1000),
1208 success: function(response) {
1209 let data = jQuery.parseJSON(response);
1210 if (data.status) {
1211 if (data.count > 0) {
1212 let feeds = data.feeds;
1213 jQuery.each(feeds, function(key, val) {
1214 let showID = val.id;
1215 let showName = val.title;
1216 let showLink = val.url || val.link; // url gives rss feed, use site link as fallback
1217 let showGUID = val.podcastGuid;
1218 let medium = val.medium;
1219
1220 let newHTML = '<li class="search-result" id="feed-result-' + showID + '">' +
1221 '<a>' + showName + '</a>' +
1222 '<p style="display: none;" class="guid-data">' + showGUID + '</p>' +
1223 '<p style="display: none;" class="link-data">' + showLink + '</p>' +
1224 '<p style="display: none;" class="medium-data">' + medium + '</p>' +
1225 '<p style="display: none;" class="original-title-data">' + showName + '</p>' +
1226 '</li>';
1227 jQuery('#feed-search-results').append(newHTML);
1228 });
1229 } else {
1230 alert('<?php echo __("We could not find any feeds based on your input. Please try again.", 'powerpress'); ?>');
1231 }
1232 } else {
1233 alert('<?php echo __("Something went wrong with your search. Please try again.", 'powerpress'); ?>');
1234 }
1235 },
1236 error: function(objAJAXRequest, strError) {
1237 alert( '<?php echo __('Unknown error occurred while querying shows. Please try again later.', 'powerpress'); ?>' );
1238 }
1239 });
1240 });
1241
1242
1243 jQuery(document).on('click',"[id*='item-result-']", function (e) {
1244 let guid = jQuery(this).children('p').text();
1245 jQuery('#item-guid').val(guid);
1246 jQuery('#search-episodes').val(jQuery(this).children('a').text());
1247
1248 let ul = document.getElementById("episode-search-results");
1249 let li = ul.getElementsByTagName('li');
1250
1251 // hide search results after adding
1252 for (let i = 0; i < li.length; i++) {
1253 li[i].style.display = "none";
1254 }
1255 });
1256
1257 jQuery(document).on('click',"[id*='feed-result-']", function (e) {
1258 jQuery('#remote-item-warning-bubble').hide();
1259 let pChildren = jQuery(this).children('p');
1260 let guid = jQuery(jQuery(this).children('p')[0]).text()
1261 let link = jQuery(jQuery(this).children('p')[1]).text()
1262 let medium = jQuery(jQuery(this).children('p')[2]).text()
1263
1264 jQuery.ajax( {
1265 type: 'POST',
1266 url: '<?php echo admin_url(); ?>admin-ajax.php',
1267 data: { action: 'powerpress-podcast-index-episodes', nonce: '<?php echo wp_create_nonce('powerpress-edit-feed'); ?>', podcastGuid: guid },
1268 timeout: (30 * 1000),
1269 success: function(response) {
1270 let data = jQuery.parseJSON(response);
1271 if (data.status) {
1272 let count = data.count;
1273
1274 if (count > 0) {
1275 let items = data.items;
1276 jQuery.each(items, function(key, item) {
1277 let itemID = item.id;
1278 let title = item.title;
1279 let itemGUID = item.guid;
1280
1281 let newHTML = '<li style="display: none;" class="search-result" id="item-result-' + itemID + '"><a>' + title + '</a><p style="display: none;">'+itemGUID+'</p></li>';
1282 jQuery('#episode-search-results').append(newHTML);
1283 });
1284 } else {
1285 alert('<?php echo __("The selected show has no episodes.", "powerpress"); ?>');
1286 }
1287 } else {
1288 alert('<?php echo __("Something went wrong while fetching episodes. Please try again.", "powerpress"); ?>');
1289 }
1290 },
1291 error: function(objAJAXRequest, strError) {
1292 alert( '<?php echo __('Unknown error occurred while querying episodes. Please try again later.', 'powerpress'); ?>' );
1293 }
1294 });
1295
1296 jQuery('#podcast-guid').val(guid);
1297 jQuery('#podcast-link').val(link);
1298 jQuery('#podcast-medium').val(medium);
1299 jQuery('#search-podcasts').val(jQuery(this).children('a').text())
1300 jQuery('#feed-search-results').empty();
1301
1302 if (jQuery('[name=podroll]:checked').val() != 1)
1303 jQuery('#episode-search-container').show();
1304 });
1305
1306 jQuery(document).on('click', "[id*=remove-remote-item-]", function (e) {
1307 jQuery(this).parent().parent().remove();
1308 });
1309 });
1310 </script>
1311
1312 <?php
1313
1314 }
1315
1316
1317 function powerpressadmin_settings_tab_other($General, $FeedSettings, $feed_slug, $cat_ID = false, $FeedAttribs = array() ) {
1318
1319 require_once( dirname(__FILE__).'/views/settings_tab_other.php' );
1320 }
1321
1322 function powerpressadmin_settings_tab_appearance($General, $FeedSettings, $FeedAttribs = array()) {
1323 require_once( dirname(__FILE__).'/views/settings_tab_appearance.php' );
1324 }
1325
1326 function powerpressadmin_edit_appearance_feed($General, $FeedSettings, $feed_slug)
1327 {
1328 // Appearance Settings
1329 ?>
1330 <h3><?php echo __('Website Settings', 'powerpress'); ?></h3>
1331 <table class="form-table">
1332 <tr valign="top">
1333 <th scope="row">
1334 <?php echo __('Disable Player', 'powerpress'); ?>
1335 </th>
1336 <td>
1337 <input name="DisablePlayerFor" type="checkbox" <?php if( isset($General['disable_player'][$feed_slug]) ) echo 'checked '; ?> value="1" /> <?php echo __('Do not display web player or links for this podcast.', 'powerpress'); ?>
1338 <input type="hidden" name="UpdateDisablePlayer" value="<?php echo $feed_slug; ?>" />
1339 </td>
1340 </tr>
1341 </table>
1342 <?php
1343
1344 }
1345
1346 function powerpressadmin_edit_itunes_feed($FeedSettings, $General, $FeedAttribs = array() )
1347 {
1348 $feed_slug = $FeedAttribs['feed_slug'];
1349 $cat_ID = $FeedAttribs['category_id'];
1350
1351 $SupportUploads = powerpressadmin_support_uploads();
1352 if( !isset($FeedSettings['itunes_cat_1']) )
1353 $FeedSettings['itunes_cat_1'] = '';
1354 if( !isset($FeedSettings['itunes_cat_2']) )
1355 $FeedSettings['itunes_cat_2'] = '';
1356 if( !isset($FeedSettings['itunes_cat_3']) )
1357 $FeedSettings['itunes_cat_3'] = '';
1358 if( !isset($FeedSettings['apple_cat_1']) )
1359 $FeedSettings['apple_cat_1'] = '';
1360 if( !isset($FeedSettings['apple_cat_2']) )
1361 $FeedSettings['apple_cat_2'] = '';
1362 if( !isset($FeedSettings['apple_cat_3']) )
1363 $FeedSettings['apple_cat_3'] = '';
1364 if( !isset($FeedSettings['itunes_explicit']) )
1365 $FeedSettings['itunes_explicit'] = 2;
1366 if( !isset($FeedSettings['itunes_talent_name']) )
1367 $FeedSettings['itunes_talent_name'] = '';
1368 if( !isset($FeedSettings['email']) )
1369 $FeedSettings['email'] = '';
1370 if( !isset($FeedSettings['itunes_new_feed_url_podcast']) )
1371 $FeedSettings['itunes_new_feed_url_podcast'] = '';
1372 if( !isset($FeedSettings['itunes_new_feed_url']) )
1373 $FeedSettings['itunes_new_feed_url'] = '';
1374 if( !isset($FeedSettings['itunes_type']) )
1375 $FeedSettings['itunes_type'] = '';
1376
1377 //Logic to convert old iTunes categories to 2019 ones.
1378 $CatArray = array('cat_1' => $FeedSettings['itunes_cat_1'], 'cat_2' => $FeedSettings['itunes_cat_2'], 'cat_3' => $FeedSettings['itunes_cat_3']);
1379 $mappings = array('01-00' => '01-00', '01-01' => '01-02', '01-02' => '01-03', '01-03' => '01-04', '01-04' => '01-01',
1380 '01-05' => '01-05', '01-06' => '01-06', '02-00' => '02-00', '02-02' => '02-01', '02-03' => '02-03',
1381 '03-00' => '03-00', '04-00' => '04-00', '04-04' => '04-03', '05-04' => '10-05', '07-00' => '07-00', '07-01' => '07-01', '07-04' => '07-06',
1382 '08-00' => '09-00', '09-00' => '11-00', '11-00' => '13-00', '11-01' => '13-01', '11-02' => '13-02',
1383 '11-03' => '13-03', '11-04' => '13-04', '11-05' => '13-05', '11-07' => '13-07', '12-02' => '14-06',
1384 '12-03' => '14-09', '13-00' => '15-00', '13-02' => '15-02', '13-03' => '15-03', '13-04' => '15-04','14-03' => '16-15',
1385 '15-00' => '17-00', '16-00' => '19-00');
1386 foreach($CatArray as $key => $value) {
1387 if(empty($FeedSettings['apple_'.$key])) {
1388 if ($value === '02-01') {
1389 // Business > Business News (02-01) to News > Business News (11-01)
1390 $FeedSettings['apple_' . $key] = '12-01';
1391 } else if ($value === '15-02') {
1392 // Technology > Tech News (15-02) to News > Tech News (11-07)
1393 $FeedSettings['apple_' . $key] = '12-07';
1394 } else if ($value === '13-01') {
1395 // Society & Culture > History (13-01) to History (08-00)
1396 $FeedSettings['apple_' . $key] = '08-00';
1397 } else if ($value === '12-01') {
1398 // Science & Medicine > Medicine (12-01) to Health > Medicine (07-03)
1399 $FeedSettings['apple_' . $key] = '07-03';
1400 } else if($value === '05-01') {
1401 // Games & Hobbies > Automotive (05-01) to Leisure > Automotive (10-02)
1402 $FeedSettings['apple_'. $key] = '10-02';
1403 } else if($value === '05-02') {
1404 // Games & Hobbies > Aviation (05-02) to Leisure > Aviation (10-03)
1405 $FeedSettings['apple_'. $key] = '10-03';
1406 } else if($value == '05-03') {
1407 // Games & Hobbies > Hobbies (05-03) to Leisure > Hobbies (10-06)
1408 $FeedSettings['apple_'. $key] = '10-06';
1409 } else if($value == '05-05') {
1410 // Games & Hobbies > Video Games (05-05) to Leisure > Video Games (10-08)
1411 $FeedSettings['apple_'. $key] = '10-08';
1412 } else if (array_key_exists($value, $mappings)) {
1413 //Category has a 1:1 mapping
1414 $FeedSettings['apple_'. $key] = $mappings[$value];
1415 }
1416 }
1417 }
1418 ?>
1419
1420 <h1 class="pp-heading"><?php echo __('Apple Settings', 'powerpress'); ?></h1>
1421 <p class="pp-settings-text">
1422 <?php echo __('The following settings will affect the display of your podcast\'s listing on Apple Podcasts, or when/how your podcast appears in Apple Search results.','powerpress'); ?>
1423 </p>
1424
1425 <?php
1426 $MoreCategories = false;
1427 if( !empty($FeedSettings['itunes_cat_2']) )
1428 $MoreCategories = true;
1429 else if( !empty($FeedSettings['itunes_cat_3']) )
1430 $MoreCategories = true;
1431
1432 $Categories = powerpress_itunes_categories(true);
1433 $AppleCategories = powerpress_apple_categories(true);
1434
1435 ?>
1436 <div class="pp-settings-section" style="display: inline-block;width: 28%;">
1437 <h2><?php echo __('Category', 'powerpress'); ?><span class="powerpress-required"><?php echo __('Required', 'powerpress'); ?></span></h2>
1438
1439 <?php
1440 $errorClass = '';
1441 if(empty($FeedSettings['itunes_cat_1'])) {
1442 //don't show an error if there isn't a corresponding itunes category
1443 }
1444 else if(empty($FeedSettings['apple_cat_1'])) {
1445 $errorClass = "class='pp-form-error'";
1446 }
1447 ?>
1448 <select <?php echo $errorClass ?> name="Feed[apple_cat_1]" class="pp-settings-select" style="width: 80%;">
1449 <?php
1450
1451 $AppleCategories = powerpress_apple_categories(true);
1452
1453 echo '<option value="">'. __('Select Category', 'powerpress') .'</option>';
1454
1455 foreach( $AppleCategories as $value=> $desc ) {
1456 echo "\t<option value=\"$value\"" . ($FeedSettings['apple_cat_1'] == $value ? ' selected' : '') . ">" . htmlspecialchars($desc) . "</option>\n";
1457 }
1458 ?>
1459 </select>
1460 <?php
1461 if($errorClass == "class='pp-form-error'") {
1462 echo '<p style="width: 250px;">';
1463 echo __('Please enter an Apple Podcasts category to prepare yourself for the new 2019 categories', 'powerpress');
1464 echo '</p>'; }
1465 else {
1466 echo '';
1467 }
1468 ?>
1469 </div>
1470
1471
1472
1473 <!-- start advanced features -->
1474 <!--<div id="more_itunes_cats" style="display: inline-block;">-->
1475
1476 <div class="pp-settings-section" style="display: inline-block;width: 28%;">
1477 <?php
1478 $errorClass = '';
1479 if(empty($FeedSettings['itunes_cat_2'])) {
1480 //don't show an error if there isn't a corresponding itunes caregory
1481 }
1482 else if(empty($FeedSettings['apple_cat_2'])) {
1483 $errorClass = "class='pp-form-error'";
1484 }
1485 ?>
1486 <h2><?php echo __('Category 2', 'powerpress'); ?> </h2>
1487 <select <?php echo $errorClass ?> name="Feed[apple_cat_2]" class="pp-settings-select" style="width: 80%;">
1488 <?php
1489
1490 echo '<option value="">'. __('Select Category', 'powerpress') .'</option>';
1491
1492 foreach( $AppleCategories as $value=> $desc ) {
1493
1494 echo "\t<option value=\"$value\"" . ($FeedSettings['apple_cat_2'] == $value ? ' selected' : '') . ">" . htmlspecialchars($desc) . "</option>\n";
1495 }
1496
1497 reset($Categories);
1498 ?>
1499 </select>
1500
1501 <?php
1502 if($errorClass == "class='pp-form-error'") {
1503 echo '<p class="pp-settings-text" style="width: 250px;">';
1504 echo __('Please enter an Apple Podcasts category to prepare yourself for the new 2019 categories', 'powerpress');
1505 echo '</p>'; }
1506 else {
1507 echo '';
1508 }
1509 ?>
1510
1511 </div>
1512
1513 <div class="pp-settings-section" style="display: inline-block;width: 28%;">
1514 <?php
1515 $errorClass = '';
1516 if(empty($FeedSettings['itunes_cat_3'])) {
1517 //don't show an error if there isn't a corresponding itunes caregory
1518 }
1519 else if(empty($FeedSettings['apple_cat_3'])) {
1520 $errorClass = "class='pp-form-error'";
1521 }
1522 ?>
1523 <h2><?php echo __('Category 3', 'powerpress'); ?></h2>
1524 <select <?php echo $errorClass ?> name="Feed[apple_cat_3]" class="pp-settings-select" style="width: 80%;">
1525 <?php
1526 echo '<option value="">'. __('Select Category', 'powerpress') .'</option>';
1527 foreach( $AppleCategories as $value=> $desc ) {
1528 echo "\t<option value=\"$value\"" . ($FeedSettings['apple_cat_3'] == $value ? ' selected' : '') . ">" . htmlspecialchars($desc) . "</option>\n";
1529 }
1530
1531 reset($Categories);
1532 ?>
1533 </select>
1534
1535 <?php
1536 if($errorClass == "class='pp-form-error'") {
1537 echo '<p style="width: 250px;">';
1538 echo __('Please enter an Apple Podcasts category to prepare yourself for the new 2019 categories', 'powerpress');
1539 echo '</p>';
1540 }
1541 else {
1542 echo '';
1543 }
1544
1545 ?>
1546 </div>
1547
1548 <!--</div>-->
1549 <!-- end advanced features -->
1550
1551 <div class="pp-settings-section">
1552 <h2><?php echo __('Author Name', 'powerpress'); ?></h2>
1553 <input type="text" class="pp-settings-text-input" name="Feed[itunes_talent_name]" value="<?php echo esc_attr($FeedSettings['itunes_talent_name']); ?>" maxlength="255" /><br />
1554 <input type="checkbox" class="pp-settings-checkbox" name="Feed[itunes_author_post]" value="1" <?php echo ( !empty($FeedSettings['itunes_author_post'])?'checked ':''); ?>/>
1555 <div class="pp-settings-subsection" style="border: none;">
1556 <p class="pp-sub"><?php echo __('Use blog post author\'s name for individual episodes.', 'powerpress'); ?></p>
1557 </div>
1558 </div>
1559
1560
1561 <div class="pp-settings-section" style="display: inline-block;width: 45%;">
1562 <h2><?php echo __('Explicit', 'powerpress'); ?><span class="powerpress-required"><?php echo __('Required', 'powerpress'); ?></span></h2>
1563 <select name="Feed[itunes_explicit]" class="pp-settings-select" style="width: 80%;">
1564 <?php
1565 $explicit = array(0=> __('No option selected', 'powerpress'), 1=>__('Yes - explicit content', 'powerpress'), 2=>__('Clean - no explicit content', 'powerpress'));
1566
1567 foreach( $explicit as $value=> $desc )
1568 echo "\t<option value=\"$value\"". ($FeedSettings['itunes_explicit']==$value?' selected':''). (($FeedSettings['itunes_explicit']!=0&&$value==0)?'disabled':''). ">$desc</option>\n";
1569
1570 ?>
1571 </select>
1572 <p class="description pp-settings-text"><?php echo __('Note: As of February, 2016, you must select either Yes or Clean.', 'powerpress'); ?><br /><br /></p>
1573 </div>
1574 <div class="pp-settings-section" style="display: inline-block;width: 45%;">
1575 <h2><?php echo __('Feed Type', 'powerpress'); ?></h2>
1576 <select name="Feed[itunes_type]" class="pp-settings-select" style="width: 80%;">
1577 <?php
1578 $types = array(''=> __('No option selected', 'powerpress'), 'episodic'=>__('Episodic (default)', 'powerpress'), 'serial'=>__('Serial', 'powerpress'));
1579
1580 foreach( $types as $value=> $desc )
1581 echo "\t<option value=\"$value\"". ($FeedSettings['itunes_type']==$value?' selected':''). ">$desc</option>\n";
1582
1583 ?>
1584 </select>
1585 <p class="description pp-settings-text">
1586 <?php echo __('Episodic: displays latest episode first.', 'powerpress'); ?> <br />
1587 <?php echo __('Serial: displays latest episode last.', 'powerpress'); ?>
1588 </p>
1589 </div>
1590
1591
1592 <div class="pp-settings-section">
1593 <h2><?php echo __('New Feed URL', 'powerpress'); ?></h2>
1594 <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'); ?>;">
1595 <p class="pp-settings-text" style="margin-top: 5px;"><strong><a href="#" onclick="return powerpress_new_feed_url_prompt();"><?php echo __('Set iTunes New Feed URL', 'powerpress'); ?></a></strong></p>
1596 <p class="pp-settings-text"><strong>
1597 <?php echo __('The Apple New Feed URL option works primarily for Apple\'s Podcast directory only, and should only be used if you are unable to implement a HTTP 301 redirect.', 'powerpress'); ?>
1598 <?php echo __('A 301 redirect will route <u>all podcast clients including iTunes</u> to your new feed address.', 'powerpress'); ?>
1599 </strong>
1600 </p>
1601 <p class="pp-settings-text">
1602 <?php echo __('Learn more:', 'powerpress'); ?> <a href="https://blubrry.com/manual/syndicating-your-podcast-rss-feeds/changing-your-podcast-rss-feed-address-url/" target="_blank"><?php echo __('Changing Your Podcast RSS Feed Address (URL)', 'powerpress'); ?></a>
1603 </p>
1604 </div>
1605 <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'); ?>;">
1606 <p class="pp-settings-text" 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.', 'powerpress'); ?></strong></p>
1607 <p class="pp-settings-text"><strong><?php echo __('DO NOT MODIFY THIS SETTING UNLESS YOU ABSOLUTELY KNOW WHAT YOU ARE DOING.', 'powerpress'); ?></strong></p>
1608 <p class="pp-settings-text">
1609 <?php echo htmlspecialchars( sprintf(__('Apple recommends you maintain the %s tag in your feed for at least two weeks to ensure that most subscribers will receive the new New Feed URL.', 'powerpress'), '<itunes:new-feed-url>' ) ); ?>
1610 </p>
1611 <p class="pp-settings-text">
1612 <?php
1613 $FeedName = __('Main RSS2 feed', 'powerpress');
1614 $FeedURL = get_feed_link('rss2');
1615 if( $cat_ID )
1616 {
1617 $category = get_category_to_edit($cat_ID);
1618 $FeedName = sprintf( __('%s category feed', 'powerpress'), htmlspecialchars($category->name) );
1619 if( !empty($General['cat_casting_podcast_feeds']) )
1620 $FeedURL = get_category_feed_link($cat_ID, 'podcast');
1621 else
1622 $FeedURL = get_category_feed_link($cat_ID);
1623 }
1624 else if( $feed_slug )
1625 {
1626 if( !empty($General['custom_feeds'][ $feed_slug ]) )
1627 $FeedName = $General['custom_feeds'][ $feed_slug ];
1628 else
1629 $FeedName = __('Podcast', 'powerpress');
1630 $FeedName = trim($FeedName).' '.__('feed', 'powerpress');
1631 $FeedURL = get_feed_link($feed_slug);
1632 }
1633 else if( $FeedAttribs['type'] == 'ttid' )
1634 {
1635 $term_object = get_term_to_edit($FeedAttribs['term_id'],$FeedAttribs['taxonomy_type']);
1636 $FeedName = sprintf( __('%s taxonomy term feed', 'powerpress'), htmlspecialchars($term_object->name) );
1637 $FeedURL = get_term_feed_link($FeedAttribs['term_id'],$FeedAttribs['taxonomy_type'], 'rss2');
1638 }
1639
1640 echo sprintf(__('The New Feed URL value below will be applied to the %s (%s).', 'powerpress'), $FeedName, $FeedURL);
1641 ?>
1642 </p>
1643 <p style="margin-bottom: 0;">
1644 <label class="pp-settings-label"><?php echo __('New Feed URL', 'powerpress'); ?></label>
1645 <input type="text" class="pp-settings-text-input" name="Feed[itunes_new_feed_url]" value="<?php echo esc_attr($FeedSettings['itunes_new_feed_url']); ?>" maxlength="255" />
1646 </p>
1647 <label class="pp-settings-label-under"><?php echo __('Leave blank for no New Feed URL', 'powerpress'); ?></label>
1648
1649 <p class="pp-settings-text" style="margin-top: 2em;"><a href="https://blubrry.com/manual/syndicating-your-podcast-rss-feeds/changing-your-podcast-rss-feed-address-url/" target="_blank"><?php echo __('More information regarding the iTunes New Feed URL is available here.', 'powerpress'); ?></a></p>
1650 <p class="pp-settings-text">
1651 <?php
1652 if( !$cat_ID && !$feed_slug )
1653 {
1654 if( empty($General['channels']) )
1655 echo sprintf(__('Please activate the \'Custom Podcast Channels\' Advanced Option to set the new-feed-url for your podcast only feed (%s)', 'powerpress'), get_feed_link('podcast') );
1656 else
1657 echo sprintf(__('Please navigate to the \'Custom Podcast Channels\' section to set the new-feed-url for your podcast only feed (%s)', 'powerpress'), get_feed_link('podcast') );
1658 }
1659 ?>
1660 </p>
1661 </div>
1662 </div>
1663
1664
1665 <h1 class="pp-heading" style="margin-bottom: 1em;"><?php echo __('Advanced Options', 'powerpress'); ?></h1>
1666 <div id="permanent_itunes_settings" class="pp-settings-section">
1667
1668 <div>
1669 <p class="pp-settings-text" style="margin-bottom: 1em;">
1670 <strong style="color: #CC0000; font-weight: bold;"><?php echo __('SETTINGS BELOW HAVE PERMANENT CONSEQUENCES.', 'powerpress'); ?></strong>
1671 </p>
1672 <p style="margin-bottom: 0;" class="pp-settings-text">
1673 <?php echo __('Feeds affected', 'powerpress'); ?>:
1674 </p>
1675 <div style="margin-left: 20px;" class="pp-settings-text">
1676 <?php
1677 // $General, $feed_slug=false, $cat_ID=false
1678
1679 if( $feed_slug )
1680 {
1681 echo '<a href="';
1682 echo esc_attr( get_feed_link($feed_slug) );
1683 echo '" target="_blank">';
1684 echo esc_html( get_feed_link($feed_slug) );
1685 echo '</a>';
1686 }
1687 else if( $cat_ID )
1688 {
1689 if( !empty($General['cat_casting_podcast_feeds']) )
1690 $feed_url = get_category_feed_link($cat_ID, 'podcast');
1691 else
1692 $feed_url = get_category_feed_link($cat_ID);
1693 echo '<a href="';
1694 echo esc_attr( $feed_url );
1695 echo '" target="_blank">';
1696 echo esc_html( $feed_url );
1697 echo '</a>';
1698 }
1699 else
1700 {
1701 echo '<a href="';
1702 echo esc_attr( get_feed_link('') );
1703 echo '" target="_blank">';
1704 echo esc_html( get_feed_link('') );
1705 echo '</a>';
1706
1707 if( empty($General['custom_feeds']['podcast']) )
1708 {
1709 echo '<br /><a href="';
1710 echo esc_attr( get_feed_link('podcast') );
1711 echo '" target="_blank">';
1712 echo esc_html( get_feed_link('podcast') );
1713 echo '</a>';
1714 }
1715 }
1716
1717 ?>
1718 </div>
1719
1720 </div>
1721
1722 <h2><?php echo __('Block', 'powerpress'); ?></h2>
1723 <input type="checkbox" class="pp-settings-checkbox" name="Feed[itunes_block]" value="1" <?php if( !empty($FeedSettings['itunes_block']) ) echo 'checked'; ?> />
1724 <div class="pp-settings-subsection">
1725 <p class="pp-sub"><?php echo __('Prevent the entire podcast from appearing in the Apple Podcast directory.', 'powerpress'); ?></p>
1726 </div>
1727
1728 <h2><?php echo __('Complete', 'powerpress'); ?></h2>
1729 <input type="checkbox" class="pp-settings-checkbox" name="Feed[itunes_complete]" value="1" <?php if( !empty($FeedSettings['itunes_complete']) ) echo 'checked'; ?> />
1730 <div class="pp-settings-subsection">
1731 <p class="pp-sub"><?php echo __('Indicate the completion of a podcast. Apple will no longer update your listing in the Apple Podcast directory.', 'powerpress'); ?></p>
1732 </div>
1733
1734 </div>
1735
1736 <?php
1737 }
1738
1739 ?>