function powerpressadmin_appearance($General = false, $Feed = false)
{
    if ($General === false) {
        $General = powerpress_get_settings('powerpress_general');
    }
    $General = powerpress_default_settings($General, 'appearance');
    if (!isset($General['player_function'])) {
        $General['player_function'] = 1;
    }
    if (!isset($General['player_aggressive'])) {
        $General['player_aggressive'] = 0;
    }
    if (!isset($General['new_window_width'])) {
        $General['new_window_width'] = '';
    }
    if (!isset($General['new_window_height'])) {
        $General['new_window_height'] = '';
    }
    if (!isset($General['player_width'])) {
        $General['player_width'] = '';
    }
    if (!isset($General['player_height'])) {
        $General['player_height'] = '';
    }
    if (!isset($General['player_width_audio'])) {
        $General['player_width_audio'] = '';
    }
    if (!isset($General['disable_appearance'])) {
        $General['disable_appearance'] = false;
    }
    if (!isset($General['subscribe_links'])) {
        $General['subscribe_links'] = true;
    }
    if (!isset($General['subscribe_label'])) {
        $General['subscribe_label'] = '';
    }
    /*
    $Players = array('podcast'=>__('Default Podcast (podcast)', 'powerpress') );
    if( isset($General['custom_feeds']) )
    {
    	while( list($podcast_slug, $podcast_title) = each($General['custom_feeds']) )
    	{
    		if( $podcast_slug == 'podcast' )
    			continue;
    		$Players[$podcast_slug] = sprintf('%s (%s)', $podcast_title, $podcast_slug);
    	}
    }
    */
    ?>

<!-- start advanced features -->
<?php 
    if (!empty($General['advanced_mode_2'])) {
        ?>
<h3><?php 
        echo __('Media Appearance Settings', 'powerpress');
        ?>
</h3>
<div id="enable_presentation_settings">
<table class="form-table">
<tr valign="top">
<th scope="row">&nbsp;	</th> 
<td>
	<ul>
		<li><p><label><input type="radio" name="General[disable_appearance]" value="0" <?php 
        if ($General['disable_appearance'] == 0) {
            echo 'checked';
        }
        ?>
 onclick="javascript: jQuery('#presentation_settings').css('display', (this.checked?'block':'none') );" /> <?php 
        echo __('Enable PowerPress Media Players and Links', 'powerpress');
        ?>
</label> (<?php 
        echo __('default', 'powerpress');
        ?>
)</p>
			<ul><li>
				<p class="description"><?php 
        echo __('PowerPress will add media players and links to your site.', 'powerpress');
        ?>
</p>
			</li></ul>
		</li>
		
		<li><p><label><input type="radio" name="General[disable_appearance]" value="1" <?php 
        if ($General['disable_appearance'] == 1) {
            echo 'checked';
        }
        ?>
 onclick="javascript: jQuery('#presentation_settings').css('display', (this.checked?'none':'block') );" /> <?php 
        echo __('Disable PowerPress Media Players and Links', 'powerpress');
        ?>
</label></p>
			<ul><li>
				<p class="description"><?php 
        echo __('PowerPress will <u>not</u> add any media players or media links to your site. PowerPress will only be used to add podcasting support to your feeds.', 'powerpress');
        ?>
</p>
			</li></ul>
		</li>
	</ul>
</td>
</tr>
</table>
</div>
<div id="presentation_settings"<?php 
        if ($General['disable_appearance']) {
            echo ' style="display: none;"';
        }
        ?>
>
<!-- start presentation settings -->
<!-- end advanced features -->
<?php 
    }
    ?>

<h3><?php 
    echo __('Blog Posts and Pages', 'powerpress');
    ?>
</h3>


<table class="form-table">
<tr valign="top">
<th scope="row"><?php 
    echo htmlspecialchars(__('Display Media & Links', 'powerpress'));
    ?>
</th> 
<td>
	<ul>
		<li><p><label><input type="radio" name="General[display_player]" value="1" <?php 
    if ($General['display_player'] == 1) {
        echo 'checked';
    }
    ?>
 /> <?php 
    echo __('Below page content', 'powerpress');
    ?>
</label> (<?php 
    echo __('default', 'powerpress');
    ?>
)</p>
				<ul><li>
					<p class="description"><?php 
    echo __('Player and media links will appear <u>below</u> your post and page content.', 'powerpress');
    ?>
<p>
				</li></ul>
		</li>
		<li><p><label><input type="radio" name="General[display_player]" value="2" <?php 
    if ($General['display_player'] == 2) {
        echo 'checked';
    }
    ?>
 /> <?php 
    echo __('Above page content', 'powerpress');
    ?>
</label></p>
			<ul><li>
				<p class="description"><?php 
    echo __('Player and media links will appear <u>above</u> your post and page content.', 'powerpress');
    ?>
</p>
			</li></ul>
		</li>
		<li>
			<p><label><input type="radio" name="General[display_player]" value="0" <?php 
    if ($General['display_player'] == 0) {
        echo 'checked';
    }
    ?>
 /> <?php 
    echo __('Disable', 'powerpress');
    ?>
</label></p>
			<ul><li>
				<p class="description"><?php 
    echo __('Player and media links will <u>NOT</u> appear in your post and page content. Media player and links can be added manually by using the <i>shortcode</i> below.', 'powerpress');
    ?>
</p>
			</li></ul>
		</li>
	</ul>
	<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:', 'powerpress');
    ?>
 <a href="http://codex.wordpress.org/Template_Tags/the_excerpt" title="<?php 
    echo __('WordPress Excerpts', 'powerpress');
    ?>
" target="_blank"><?php 
    echo __('WordPress Excerpts', 'powerpress');
    ?>
</a>  (<?php 
    echo __('e.g. search results', 'powerpress');
    ?>
)</p>
</td>
</tr>
</table>

<?php 
    if (!empty($General['advanced_mode_2'])) {
        ?>
<!-- start advanced features -->
<table class="form-table">
<tr valign="top">
<th scope="row">
<?php 
        echo __('Media Player', 'powerpress');
        ?>
</th>
<td>

<p><label><input type="checkbox" name="PlayerSettings[display_media_player]" value="2" <?php 
        if ($General['player_function'] == 1 || $General['player_function'] == 2) {
            echo 'checked ';
        }
        ?>
/> <?php 
        echo __('Display Player', 'powerpress');
        ?>
</label></p>
<?php 
        /* ?>
        <p style="margin-left: 35px;"><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.', 'powerpress'); ?></p>
        <?php */
        ?>
<p><?php 
        echo __('Detected mobile and tablet devices use an HTML5 player with a fallback link to download the media.', 'powerpress');
        ?>
</p>
</td>
</tr>
</table>




<table class="form-table">

<tr valign="top">
<th scope="row">

<?php 
        echo __('Media Links', 'powerpress');
        ?>
</th> 
<td>
	<p style="padding-top: 8px;"><label><input type="checkbox" name="PlayerSettings[display_pinw]" value="3" <?php 
        if ($General['player_function'] == 3 || $General['player_function'] == 1) {
            echo 'checked ';
        }
        ?>
/> <?php 
        echo __('Display Play in new Window Link', 'powerpress');
        ?>
</label></p>
	
	<p><label><input type="checkbox" name="PlayerSettings[display_download]" value="1" <?php 
        if ($General['podcast_link'] != 0) {
            echo 'checked ';
        }
        ?>
/> <?php 
        echo __('Display Download Link', 'powerpress');
        ?>
</label></p>
	
	<p style="margin-left: 35px;"><input type="checkbox" id="display_download_size" name="PlayerSettings[display_download_size]" value="1" <?php 
        if ($General['podcast_link'] == 2 || $General['podcast_link'] == 3) {
            echo 'checked';
        }
        ?>
 onclick="if( !this.checked ) { jQuery('#display_download_duration').removeAttr('checked'); }" /> <?php 
        echo __('Include file size', 'powerpress');
        ?>
	<input type="checkbox" style="margin-left: 30px;" id="display_download_duration" name="PlayerSettings[display_download_duration]" value="1" <?php 
        if ($General['podcast_link'] == 3) {
            echo 'checked';
        }
        ?>
 onclick="if( this.checked ) { jQuery('#display_download_size').attr('checked','checked'); }" /> <?php 
        echo __('Include file size and duration', 'powerpress');
        ?>
</p>
	
	<p><label><input type="checkbox" name="General[podcast_embed]" value="1" <?php 
        if (!empty($General['podcast_embed'])) {
            echo 'checked ';
        }
        ?>
/> <?php 
        echo __('Display Player Embed Link', 'powerpress');
        ?>
 </label></p>
	<p style="margin-left: 35px;">
		<input type="checkbox" name="General[podcast_embed_in_feed]" value="1" <?php 
        if (!empty($General['podcast_embed_in_feed'])) {
            echo 'checked';
        }
        ?>
  /> <?php 
        echo __('Include embed in feeds', 'powerpress');
        ?>
	</p>
	<p><?php 
        echo __('Embed option works with the MediaElement.js Media Player for audio and video, Flow Player Classic for audio and HTML5 Video player for video.', 'powerpress');
        ?>
</p>
</td>
</tr>
</table>

<table class="form-table">

<tr valign="top">
<th scope="row">
<?php 
        echo __('Subscribe Links', 'powerpress');
        ?>
 <?php 
        echo powerpressadmin_new();
        ?>
</th> 
<td>
	<p style="padding-top: 8px;"><label><input type="checkbox" name="General[subscribe_links]" value="1" <?php 
        if ($General['subscribe_links'] == 1) {
            echo 'checked ';
        }
        ?>
/> 
	<?php 
        echo __('Display subscribe links below player and media links.', 'powerpress');
        ?>
</label></p>
	<ul>
	<li><label for="subscribe_label">Subscribe label: <input type="text" id="subscribe_label" value="<?php 
        echo esc_attr($General['subscribe_label']);
        ?>
" name="General[subscribe_label]" placeholder="Subscribe:" /></label>
	<?php 
        echo __('(leave blank for default)', 'powerpress');
        ?>
	</li>
	</ul>

<p style="padding-top:10px;"><input type="checkbox" name="NULL[subscribe_feature_itunes]" value="1" checked disabled /> <label><?php 
        echo __('Subscribe on iTunes', 'powerpress');
        ?>
</label></p>
<div style="margin-left: 24px;">
	<p><?php 
        echo __('Link to your one click iTunes Subscription URL.', 'powerpress');
        ?>
</p>
	
	<p><a href="<?php 
        echo 'https://linkmaker.itunes.apple.com/?q=' . urlencode(get_bloginfo('name'));
        ?>
&amp;media=podcasts" target="_blank"><?php 
        echo __('Find your iTunes Subscription URL', 'powerpress');
        ?>
</a></p>
</div>

<p><input type="checkbox" name="NULL[subscribe_feature_android]" value="1" checked disabled /> <label><?php 
        echo __('Subscribe on Android', 'powerpress');
        ?>
</label> <?php 
        echo powerpressadmin_new();
        ?>
</p>
<div style="margin-left: 24px;">
	<p><?php 
        echo __('Link to your one click Subscribe on Android URL.', 'powerpress');
        ?>
</p>
	<p><a href="http://subscribeonandroid.com/podcasters/" target="_blank"><?php 
        echo __('Learn more about Subscribe on Android', 'powerpress');
        ?>
</a></p>
</div>

<p><input type="checkbox" name="NULL[subscribe_feature_rss]" value="1" checked disabled /> <label><?php 
        echo __('Subscribe via RSS', 'powerpress');
        ?>
</label></p>
<div style="margin-left: 24px;">
	<p><?php 
        echo __('Link to your podcast RSS feed.', 'powerpress');
        ?>
</p>
</div>

<p><input type="checkbox" id="subscribe_feature_email" name="General[subscribe_feature_email]" value="1" <?php 
        if (!empty($General['subscribe_feature_email'])) {
            echo 'checked ';
        }
        ?>
/> <label for="subscribe_feature_email"><?php 
        echo __('Subscribe By Email', 'powerpress');
        ?>
</label> <?php 
        echo powerpressadmin_new();
        ?>
</p>
<div style="margin-left: 24px;">
	<p><?php 
        echo __('Link to your one click Subscribe by Email URL.', 'powerpress');
        ?>
</p>
	<p>
	<?php 
        echo __('Subscribe By Email is a service that allows listeners to subscribe to their favorite podcasts by email.', 'powerpress');
        ?>
	</p>
	<p><a href="http://subscribebyemail.com/podcasters/" target="_blank"><?php 
        echo __('Learn more about Subscribe by Email', 'powerpress');
        ?>
</a></p>
	<p><?php 
        echo __('Note: Subscribe by Email does not replace newsletters or mailing lists. It is only for podcast syndication.', 'powerpress');
        ?>
	</p>
</div>
</td>
</tr>
</table>

<?php 
        powerpress_admin_appearance_common($Feed);
        ?>
<!-- end advanced features -->
<?php 
    }
    ?>


<table class="form-table">
<tr valign="top">
<th scope="row" style="background-image: url(../wp-includes/images/smilies/icon_exclaim.gif); background-position: 10px 10px; background-repeat: no-repeat; ">

<div style="margin-left: 24px;"><?php 
    echo __('Having Issues?', 'powerpress');
    ?>
</div></th>
<td>
	<select name="General[player_aggressive]" class="bpp_input_med">
<?php 
    $linkoptions = array(0 => __('No, everything is working', 'powerpress'), 1 => __('Yes, please try to fix', 'powerpress'), 2 => __('Yes, alternative fix', 'powerpress'), 3 => __('Yes, excluding excerpts', 'powerpress'));
    while (list($value, $desc) = each($linkoptions)) {
        echo "\t<option value=\"{$value}\"" . ($General['player_aggressive'] == $value ? ' selected' : '') . ">{$desc}</option>\n";
    }
    ?>
</select>
<p style="margin-top: 5px;">
	<?php 
    echo __('Use this option if you are having problems with the players not appearing on some or all of your pages.', 'powerpress');
    ?>
</p>
<?php 
    if (!empty($General['advanced_mode_2'])) {
        ?>
<p style="margin-top: 20px; margin-bottom:0;">
	<?php 
        echo __('If the above option fixes the player issues, then you most likely have a conflicting theme or plugin activated. You can verify your theme is not causing the problem by testing your site using the latest default WordPress theme (twentyfourteen). For plugins, disable them one by one until the player re-appears, which indicates the last plugin deactivated caused the conflict.', 'powerpress');
        ?>
</p>
<?php 
    }
    ?>
</td>
</tr>
</table>

<?php 
    if (!empty($General['advanced_mode_2'])) {
        ?>
<!-- start advanced features -->
<div id="new_window_settings" style="display: <?php 
        echo $General['player_function'] == 1 || $General['player_function'] == 3 ? 'block' : 'none';
        ?>
">
<h3><?php 
        echo __('Play in New Window Settings', 'powerpress');
        ?>
</h3>
<table class="form-table">

<tr valign="top">
<th scope="row">
<?php 
        echo __('New Window Width', 'powerpress');
        ?>
</th>
<td>
<input type="text" name="General[new_window_width]" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');" value="<?php 
        echo esc_attr($General['new_window_width']);
        ?>
" maxlength="4" />
<?php 
        echo __('Width of new window (leave blank for 420 default)', 'powerpress');
        ?>
</td>
</tr>

<tr valign="top">
<th scope="row">
<?php 
        echo __('New Window Height', 'powerpress');
        ?>
</th>
<td>
<input type="text" name="General[new_window_height]" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');" value="<?php 
        echo esc_attr($General['new_window_height']);
        ?>
" maxlength="4" />
<?php 
        echo __('Height of new window (leave blank for 240 default)', 'powerpress');
        ?>
</td>
</tr>

<tr valign="top">
<th scope="row">
&nbsp;
</th>
<td>

	<p style="margin: 8px 0 0 0;">
		<label><input type="checkbox" name="General[new_window_nofactor]" value="1" <?php 
        if (!empty($General['new_window_nofactor'])) {
            echo 'checked';
        }
        ?>
  /> <?php 
        echo __('Do not factor in scroll bars', 'powerpress');
        ?>
</label>
	</p>
	<div style="margin: 0 0 0 20px;"><?php 
        echo __('By default, PowerPress adds to the width and height above to compensate for possible vertical and horizontal scroll bars. Check this option if you do not want PowerPress to compensate for browser scroll bars.', 'powerpress');
        ?>
</div>
</td>

</table>
</div>


<h3><?php 
        echo __('Media Format Settings', 'powerpress');
        ?>
</h3>
<table class="form-table">

<tr valign="top">
<th scope="row">
<?php 
        echo __('AAC Audio (.m4a)', 'powerpress');
        ?>
</th>
<td>

	<p style="margin: 8px 0 0 0;">
		<label><input type="checkbox" name="General[m4a]" value="use_players" <?php 
        if (!empty($General['m4a']) && $General['m4a'] == 'use_players') {
            echo 'checked';
        }
        ?>
  /> <?php 
        echo __('Use Flow Player Classic / HTML5 Audio player', 'powerpress');
        ?>
</label>
	</p>
	<div style="margin-left: 20px;"><?php 
        echo __('Leave this option unchecked if you want m4a chapter markers, images and information displayed.', 'powerpress');
        ?>
</div>
	<div style="margin: 10px 0 0 20px;"><?php 
        echo __('When unchecked, m4a will be played with the quicktime video embed. Video player width/height settings apply.', 'powerpress');
        ?>
</div>

</td>
</tr>
</table>
</div>
<!-- end presentation settings -->
<!-- end advanced features -->
<?php 
    }
}
function powerpress_admin_editfeed($type = '', $type_value = '', $feed_slug = false)
{
    $SupportUploads = powerpressadmin_support_uploads();
    $General = powerpress_get_settings('powerpress_general');
    $FeedAttribs = array('type' => $type, 'feed_slug' => '', 'category_id' => 0, 'term_taxonomy_id' => 0, 'term_id' => 0, 'taxonomy_type' => '', 'post_type' => '');
    $cat_ID = false;
    $term_taxonomy_id = false;
    $FeedTitle = __('Feed Settings', 'powerpress');
    switch ($type) {
        case 'channel':
            $feed_slug = $type_value;
            $FeedAttribs['feed_slug'] = $type_value;
            $FeedSettings = powerpress_get_settings('powerpress_feed_' . $feed_slug);
            if (!$FeedSettings) {
                $FeedSettings = array();
                $FeedSettings['title'] = '';
                if (!empty($General['custom_feeds'][$feed_slug])) {
                    $FeedSettings['title'] = $General['custom_feeds'][$feed_slug];
                }
            }
            $FeedSettings = powerpress_default_settings($FeedSettings, 'editfeed_custom');
            if (!isset($General['custom_feeds'][$feed_slug])) {
                $General['custom_feeds'][$feed_slug] = __('Podcast (default)', 'powerpress');
            }
            $FeedTitle = sprintf('Podcast Settings for Channel: %s', htmlspecialchars($General['custom_feeds'][$feed_slug]));
            echo sprintf('<input type="hidden" name="feed_slug" value="%s" />', $feed_slug);
            echo '<input type="hidden" name="action" value="powerpress-save-channel" />';
            break;
        case 'category':
            $cat_ID = $type_value;
            $FeedAttribs['category_id'] = $type_value;
            $FeedSettings = powerpress_get_settings('powerpress_cat_feed_' . $cat_ID);
            $FeedSettings = powerpress_default_settings($FeedSettings, 'editfeed_custom');
            $category = get_category_to_edit($cat_ID);
            $FeedTitle = sprintf(__('Podcast Settings for Category: %s', 'powerpress'), htmlspecialchars($category->name));
            echo sprintf('<input type="hidden" name="cat" value="%s" />', $cat_ID);
            echo '<input type="hidden" name="action" value="powerpress-save-category" />';
            break;
        case 'ttid':
            $term_taxonomy_id = $type_value;
            $FeedAttribs['term_taxonomy_id'] = $type_value;
            $FeedSettings = powerpress_get_settings('powerpress_taxonomy_' . $term_taxonomy_id);
            $FeedSettings = powerpress_default_settings($FeedSettings, 'editfeed_custom');
            global $wpdb;
            $term_info = $wpdb->get_results("SELECT term_id, taxonomy FROM {$wpdb->term_taxonomy} WHERE term_taxonomy_id = {$term_taxonomy_id}", ARRAY_A);
            if (!empty($term_info[0]['term_id'])) {
                $term_ID = $term_info[0]['term_id'];
                $taxonomy_type = $term_info[0]['taxonomy'];
                $FeedAttribs['term_id'] = $term_ID;
                $FeedAttribs['taxonomy_type'] = $taxonomy_type;
                $term_object = get_term_to_edit($term_ID, $taxonomy_type);
                $FeedTitle = sprintf(__('Podcast Settings for Taxonomy Term: %s', 'powerpress'), htmlspecialchars($term_object->name));
            } else {
                $FeedTitle = sprintf(__('Podcast Settings for Taxonomy Term: %s', 'powerpress'), 'Term ID ' . htmlspecialchars($term_taxonomy_id));
            }
            echo sprintf('<input type="hidden" name="ttid" value="%s" />', $term_taxonomy_id);
            echo '<input type="hidden" name="action" value="powerpress-save-ttid" />';
            break;
        case 'post_type':
            $FeedAttribs['post_type'] = $type_value;
            $FeedAttribs['feed_slug'] = $feed_slug;
            $FeedSettingsArray = powerpress_get_settings('powerpress_posttype_' . $FeedAttribs['post_type']);
            if (!is_array($FeedSettingsArray[$feed_slug])) {
                $FeedSettingsArray[$feed_slug] = array();
            }
            $FeedSettings = powerpress_default_settings($FeedSettingsArray[$feed_slug], 'editfeed_custom');
            //$category = get_category_to_edit($cat_ID);
            $PostTypeTitle = $FeedAttribs['post_type'];
            // TODO: Get readable title of post type
            $FeedTitle = sprintf(__('Podcast Settings for Post Type %s with slug %s', 'powerpress'), htmlspecialchars($PostTypeTitle), htmlspecialchars($feed_slug));
            echo sprintf('<input type="hidden" name="podcast_post_type" value="%s" />', $FeedAttribs['post_type']);
            echo sprintf('<input type="hidden" name="feed_slug" value="%s" />', $feed_slug);
            echo '<input type="hidden" name="action" value="powerpress-save-post_type" />';
            break;
        default:
            $FeedSettings = powerpress_get_settings('powerpress_feed');
            $FeedSettings = powerpress_default_settings($FeedSettings, 'editfeed');
            echo '<input type="hidden" name="action" value="powerpress-save-settings" />';
            break;
    }
    echo '<h2>' . $FeedTitle . '</h2>';
    if ($cat_ID && (isset($_GET['from_categories']) || isset($_POST['from_categories']))) {
        echo '<input type="hidden" name="from_categories" value="1" />';
    }
    ?>
<div id="powerpress_settings_page" class="powerpress_tabbed_content"> 
  <ul class="powerpress_settings_tabs">
		<li><a href="#feed_tab_feed"><span><?php 
    echo htmlspecialchars(__('Feed Settings', 'powerpress'));
    ?>
</span></a></li>
		<li><a href="#feed_tab_itunes"><span><?php 
    echo htmlspecialchars(__('iTunes Settings', 'powerpress'));
    ?>
</span></a></li>
		<li><a href="#feed_tab_artwork"><span><?php 
    echo htmlspecialchars(__('Artwork', 'powerpress'));
    ?>
</span></a></li>
	<?php 
    if (in_array($FeedAttribs['type'], array('category', 'ttid', 'post_type', 'channel'))) {
        ?>
		<li><a href="#feed_tab_appearance"><span><?php 
        echo htmlspecialchars(__('Media Appearance', 'powerpress'));
        ?>
</span></a></li>
	<?php 
    }
    ?>
	<?php 
    if (in_array($FeedAttribs['type'], array('category', 'ttid', 'post_type', 'channel'))) {
        ?>
		<li><a href="#feed_tab_other"><span><?php 
        echo htmlspecialchars(__('Other Settings', 'powerpress'));
        ?>
</span></a></li> 
	<?php 
    }
    ?>
  </ul>
	
	
	<div id="feed_tab_feed" class="powerpress_tab">
		<?php 
    powerpressadmin_edit_feed_settings($FeedSettings, $General, $FeedAttribs);
    if (!empty($General['advanced_mode_2'])) {
        powerpressadmin_edit_tv($FeedSettings, $feed_slug);
    }
    ?>
	</div>
	
	<div id="feed_tab_itunes" class="powerpress_tab">
		<?php 
    if ($feed_slug != 'podcast') {
        powerpressadmin_edit_itunes_general($FeedSettings, $General, $FeedAttribs);
    }
    powerpressadmin_edit_itunes_feed($FeedSettings, $General, $FeedAttribs);
    ?>
	</div>
	
	<div id="feed_tab_artwork" class="powerpress_tab">
		<?php 
    powerpressadmin_edit_artwork($FeedSettings, $General);
    ?>
	</div>
	
	<?php 
    if ($feed_slug || $FeedAttribs['type'] == 'category' || $FeedAttribs['type'] == 'ttid') {
        ?>
	<div id="feed_tab_appearance" class="powerpress_tab">
		<?php 
        //powerpressadmin_appearance($General);
        if ($feed_slug) {
            powerpressadmin_edit_appearance_feed($General, $FeedSettings, $feed_slug, $FeedAttribs);
        }
        powerpress_admin_appearance_common($FeedSettings, $FeedAttribs);
        ?>
	</div>
	
	<div id="feed_tab_other" class="powerpress_tab">
		<?php 
        powerpressadmin_edit_basics_feed($General, $FeedSettings, $feed_slug, $cat_ID, $FeedAttribs);
        ?>
	</div>
	<?php 
    }
    ?>
	
</div>
<div class="clear"></div>
<?php 
}
Example #3
0
function powerpress_admin_tags()
{
    $General = powerpress_get_settings('powerpress_general');
    $TagSettings = powerpress_default_settings($General, 'tags');
    ?>
<script language="javascript"><!--
function ToggleID3Tags(Obj)
{
	document.getElementById('edit_id3_tags').style.display=(Obj.checked?'block':'none');
}
//-->
</script>
<input type="hidden" name="action" value="powerpress-save-tags" />
<h2><?php 
    echo __('MP3 Tags', 'powerpress');
    ?>
</h2>

<p><?php 
    echo __('Blubrry Hosting users can configure how to have the service write their MP3 ID3 Tags before publishing episodes.', 'powerpress');
    ?>
</p>

<p style="margin-bottomd: 0;">
<?php 
    echo __('ID3 tags contain useful information (title, artist, album, year, etc...) about your podcast as well as an image for display during playback in most media players.', 'powerpress');
    echo ' ';
    echo sprintf(__('Please visit the %s section of the %s to learn more about MP3 ID3 tags.', 'powerpress'), '<a href="http://create.blubrry.com/manual/creating-podcast-media/audio/id3-tags-media-meta-data/" target="_blank">' . __('ID3 Tags and media meta data', 'powerpress') . '</a>', '<a href="http://create.blubrry.com/manual/" target="_blank">' . __('Podcasting Manual', 'powerpress') . '</a>');
    ?>
</p>
<?php 
    if (empty($General['blubrry_hosting']) || $General['blubrry_hosting'] === 'false') {
        ?>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php 
        echo __('Write Tags', 'powerpress');
        ?>
</th> 
<td>
	<p>
		<input name="NotAvailable" type="checkbox" value="1" onchange="alert('<?php 
        echo __('You must configure your Blubrry Services Account in the Blubrry PowerPress > Basic Settings page in order to utilize this feature.', 'powerpress');
        ?>
'); this.checked=false; return false;" /> 
		<?php 
        echo __('Use Blubrry Hosting services to write MP3 ID3 tags to your media.', 'powerpress');
        ?>
	</p>
</td>
</tr>
</table>

<?php 
    } else {
        ?>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php 
        echo __('Write Tags', 'powerpress');
        ?>
</th> 
<td>
	<p>
		<input name="General[write_tags]" type="checkbox" value="1" <?php 
        if (!empty($General['write_tags'])) {
            echo 'checked ';
        }
        ?>
 onchange="ToggleID3Tags(this);" /> 
		<?php 
        echo __('Use Blubrry Hosting services to write MP3 ID3 tags to your media.', 'powerpress');
        ?>
	</p>
</td>
</tr>
</table>
<?php 
    }
    ?>
<table class="form-table" id="edit_id3_tags" style="display:<?php 
    echo !empty($General['blubrry_hosting']) && $General['blubrry_hosting'] !== 'false' ? !empty($General['write_tags']) ? 'block' : 'none' : 'block';
    ?>
;">

<?php 
    if (empty($General['tag_title'])) {
        $General['tag_title'] = '';
    }
    if (empty($General['tag_artist'])) {
        $General['tag_artist'] = '';
    }
    if (empty($General['tag_album'])) {
        $General['tag_album'] = '';
    }
    if (empty($General['tag_genre'])) {
        $General['tag_genre'] = '';
    }
    if (empty($General['tag_year'])) {
        $General['tag_year'] = '';
    }
    if (empty($General['tag_track'])) {
        $General['tag_track'] = '';
    }
    if (empty($General['tag_composer'])) {
        $General['tag_composer'] = '';
    }
    if (empty($General['tag_copyright'])) {
        $General['tag_copyright'] = '';
    }
    if (empty($General['tag_url'])) {
        $General['tag_url'] = '';
    }
    if (empty($General['tag_coverart'])) {
        $General['tag_coverart'] = '';
    }
    powerpressadmin_tag_option('tag_title', $General['tag_title'], __('Title Tag', 'powerpress'), __('Use blog post title', 'powerpress'));
    powerpressadmin_tag_option('tag_artist', $General['tag_artist'], __('Artist Tag', 'powerpress'), __('Use Feed Talent Name', 'powerpress'));
    powerpressadmin_tag_option('tag_album', $General['tag_album'], __('Album Tag', 'powerpress'), __('Use blog title', 'powerpress') . ': ' . get_bloginfo('name') . '');
    powerpressadmin_tag_option('tag_genre', $General['tag_genre'], __('Genre Tag', 'powerpress'), __('Use genre \'Podcast\'', 'powerpress'));
    powerpressadmin_tag_option('tag_year', $General['tag_year'], __('Year Tag', 'powerpress'), __('Use current year', 'powerpress'));
    powerpressadmin_tag_option('tag_track', $General['tag_track'], __('Track Tag', 'powerpress'), __('Do not specify track number', 'powerpress'));
    powerpressadmin_tag_option('tag_composer', $General['tag_composer'], __('Composer Tag', 'powerpress'), __('Use Feed Talent Name', 'powerpress'));
    powerpressadmin_tag_option('tag_copyright', $General['tag_copyright'], __('Copyright Tag', 'powerpress'), __('Use &copy; Talent Name', 'powerpress'));
    powerpressadmin_tag_option('tag_url', $General['tag_url'], __('URL Tag', 'powerpress'), __('Use main blog URL', 'powerpress') . ': ' . get_bloginfo('url') . '');
    powerpressadmin_tag_option('tag_coverart', $General['tag_coverart'], __('Coverart Tag', 'powerpress'), '');
    ?>

</table>
<?php 
}
function powerpress_admin_defaults()
{
    $FeedAttribs = array('type' => 'general', 'feed_slug' => '', 'category_id' => 0, 'term_taxonomy_id' => 0, 'term_id' => 0, 'taxonomy_type' => '', 'post_type' => '');
    $General = powerpress_get_settings('powerpress_general');
    $General = powerpress_default_settings($General, 'basic');
    $FeedSettings = powerpress_get_settings('powerpress_feed');
    $FeedSettings = powerpress_default_settings($FeedSettings, 'editfeed');
    // Make sure variables are set
    if (empty($FeedSettings['title'])) {
        $FeedSettings['title'] = '';
    }
    $Step = 0;
    if (!empty($FeedSettings['itunes_cat_1']) && !empty($FeedSettings['email']) && !empty($FeedSettings['itunes_image'])) {
        $Step = 1;
    }
    $episode_total = 0;
    if ($Step == 1) {
        $episode_total = powerpress_admin_episodes_per_feed('podcast');
        if ($episode_total > 0) {
            $Step = 2;
        }
    }
    if ($Step == 2 && !empty($FeedSettings['itunes_url'])) {
        $Step = 3;
    }
    $MultiSiteServiceSettings = false;
    if (is_multisite()) {
        $MultiSiteSettings = get_site_option('powerpress_multisite');
        if (!empty($MultiSiteSettings['services_multisite_only'])) {
            $MultiSiteServiceSettings = true;
        }
    }
    ?>
<script type="text/javascript"><!--


jQuery(document).ready(function($) {
	jQuery('#powerpress_advanced_mode_button').click( function(event) {
		event.preventDefault();
		jQuery('#powerpress_advanced_mode').val('1');
		jQuery(this).closest("form").submit();
	} );
} );
//-->
</script>
<input type="hidden" name="action" value="powerpress-save-defaults" />
<input type="hidden" id="powerpress_advanced_mode" name="General[advanced_mode_2]" value="0" />

<div id="powerpress_admin_header">
<h2><?php 
    echo __('Blubrry PowerPress Settings', 'powerpress');
    ?>
</h2> 
<span class="powerpress-mode"><?php 
    echo __('Simple Mode', 'powerpress');
    ?>
	&nbsp; <a href="<?php 
    echo admin_url("admin.php?page=powerpress/powerpressadmin_basic.php&amp;mode=advanced");
    ?>
" id="powerpress_advanced_mode_button" class="button-primary"><?php 
    echo __('Switch to Advanced Mode', 'powerpress');
    ?>
</a>
</span>
</div>

<?php 
    powerpressadmin_default_steps($FeedSettings, $General, $Step);
    if ($MultiSiteServiceSettings && defined('POWERPRESS_MULTISITE_VERSION')) {
        PowerPressMultiSitePlugin::edit_blubrry_services($General);
    } else {
        powerpressadmin_edit_blubrry_services($General);
    }
    ?>
<h3><?php 
    echo __('Podcast Settings', 'powerpress');
    ?>
</h3>
<table class="form-table">
<tr valign="top">
<th scope="row">
<?php 
    echo __('Program Title', 'powerpress');
    ?>
</th>
<td>
<input type="text" name="Feed[title]" style="width: 60%;"  value="<?php 
    echo esc_attr($FeedSettings['title']);
    ?>
" maxlength="255" />
(<?php 
    echo __('leave blank to use blog title', 'powerpress');
    ?>
)
<p><?php 
    echo __('Blog title:', 'powerpress') . ' ' . get_bloginfo_rss('name');
    ?>
</p>
</td>
</tr>
</table>
<?php 
    if ($Step > 1) {
        // Only display if we have episdoes in the feed!
        powerpressadmin_edit_itunes_general($FeedSettings, $General, $FeedAttribs);
    }
    // iTunes settings (in simple mode of course)
    powerpressadmin_edit_itunes_feed($FeedSettings, $General, $FeedAttribs);
    powerpressadmin_edit_artwork($FeedSettings, $General);
    powerpressadmin_appearance($General, $FeedSettings);
    powerpressadmin_advanced_options($General);
}
function powerpress_admin_menu()
{
    $Powerpress = get_option('powerpress_general');
    if (defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) || defined('PODCASTING_VERSION')) {
        // CRAP
    } else {
        if (empty($Powerpress['use_caps']) || current_user_can('edit_podcast')) {
            // Otherwise we're using a version of wordpress that is not supported.
            require_once POWERPRESS_ABSPATH . '/powerpressadmin-metabox.php';
            $FeedSlugPostTypesArray = array();
            if (!empty($Powerpress['posttype_podcasting'])) {
                $FeedSlugPostTypesArray = get_option('powerpress_posttype-podcasting');
                if (empty($FeedSlugPostTypesArray)) {
                    $FeedSlugPostTypesArray = array();
                }
            }
            if (!defined('POWERPRESS_POST_TYPES')) {
                $page_types = array('page');
                // Only apply to default pages
                if (empty($Powerpress['posttype_podcasting'])) {
                    $page_types = powerpress_admin_get_post_types('page');
                }
                // Get pages by capability type
                while (list($null, $page_type) = each($page_types)) {
                    if (empty($FeedSlugPostTypesArray['podcast'][$page_type])) {
                        add_meta_box('powerpress-podcast', __('Podcast Episode', 'powerpress'), 'powerpress_meta_box', $page_type, 'normal');
                    }
                }
                $post_types = array('post');
                // Only apply to default posts
                if (empty($Powerpress['posttype_podcasting'])) {
                    $post_types = powerpress_admin_get_post_types('post');
                }
                // Get pages by capability type
            } else {
                $post_type_string = str_replace(' ', '', POWERPRESS_POST_TYPES);
                // Get all the spaces out
                $post_types = explode(',', $post_type_string);
            }
            if (!empty($Powerpress['posttype_podcasting'])) {
                add_meta_box('powerpress-podcast', __('Podcast Episode (default)', 'powerpress'), 'powerpress_meta_box', 'post', 'normal');
                // Default podcast box for post type 'post'
                $FeedSlugPostTypesArray = get_option('powerpress_posttype-podcasting');
                if (empty($FeedSlugPostTypesArray)) {
                    $FeedSlugPostTypesArray = array();
                }
                while (list($feed_slug, $FeedSlugPostTypes) = each($FeedSlugPostTypesArray)) {
                    while (list($post_type, $type_title) = each($FeedSlugPostTypes)) {
                        if ($feed_slug != 'podcast' || $post_type != 'post') {
                            $feed_title = $type_title;
                            if (empty($feed_title)) {
                                $feed_title = $feed_slug;
                            }
                            //echo (" $feed_slug ");
                            add_meta_box('powerpress-' . $feed_slug, __('Podcast Episode', 'powerpress') . ': ' . $feed_title, 'powerpress_meta_box', $post_type, 'normal');
                        }
                    }
                }
            }
            if (isset($Powerpress['custom_feeds'])) {
                $FeedDefaultPodcast = get_option('powerpress_feed_podcast');
                while (list($null, $post_type) = each($post_types)) {
                    // Make sure this post type can edit the default podcast channel...
                    if (!empty($FeedDefaultPodcast['custom_post_type']) && $FeedDefaultPodcast['custom_post_type'] != $post_type) {
                        continue;
                    }
                    if (empty($FeedSlugPostTypesArray['podcast'][$post_type])) {
                        add_meta_box('powerpress-podcast', __('Podcast Episode (default)', 'powerpress'), 'powerpress_meta_box', $post_type, 'normal');
                    }
                }
                while (list($feed_slug, $feed_title) = each($Powerpress['custom_feeds'])) {
                    if ($feed_slug == 'podcast') {
                        continue;
                    }
                    $FeedCustom = get_option('powerpress_feed_' . $feed_slug);
                    $feed_slug = esc_attr($feed_slug);
                    reset($post_types);
                    while (list($null, $post_type) = each($post_types)) {
                        // Make sure this post type can edit the default podcast channel...
                        if (!empty($FeedCustom['custom_post_type']) && $FeedCustom['custom_post_type'] != $post_type) {
                            continue;
                        }
                        if (empty($FeedSlugPostTypesArray[$feed_slug][$post_type])) {
                            add_meta_box('powerpress-' . $feed_slug, __('Podcast Episode for Custom Channel', 'powerpress') . ': ' . esc_attr($feed_title), 'powerpress_meta_box', $post_type, 'normal');
                        }
                    }
                }
                reset($Powerpress['custom_feeds']);
            } else {
                reset($post_types);
                while (list($null, $post_type) = each($post_types)) {
                    if (empty($FeedSlugPostTypesArray['podcast'][$post_type])) {
                        add_meta_box('powerpress-podcast', __('Podcast Episode', 'powerpress'), 'powerpress_meta_box', $post_type, 'normal');
                    }
                }
            }
            // For custom compatibility type set:
            if (isset($Powerpress['custom_feeds']) && defined('POWERPRESS_CUSTOM_CAPABILITY_TYPE')) {
                $post_types = powerpress_admin_get_post_types(POWERPRESS_CUSTOM_CAPABILITY_TYPE);
                if (!empty($post_types)) {
                    while (list($feed_slug, $feed_title) = each($Powerpress['custom_feeds'])) {
                        if ($feed_slug == 'podcast') {
                            continue;
                        }
                        $FeedCustom = get_option('powerpress_feed_' . $feed_slug);
                        reset($post_types);
                        while (list($null, $post_type) = each($post_types)) {
                            if (!empty($FeedCustom['custom_post_type']) && $FeedCustom['custom_post_type'] != $post_type) {
                                continue;
                            }
                            if (empty($FeedSlugPostTypesArray[$feed_slug][$post_type])) {
                                add_meta_box('powerpress-' . $feed_slug, __('Podcast Episode for Custom Channel', 'powerpress') . ': ' . $feed_title, 'powerpress_meta_box', $post_type, 'normal');
                            }
                        }
                    }
                    reset($Powerpress['custom_feeds']);
                }
            }
        }
    }
    if (current_user_can(POWERPRESS_CAPABILITY_MANAGE_OPTIONS)) {
        $Powerpress = powerpress_default_settings($Powerpress, 'basic');
        if (isset($_GET['page']) && strstr($_GET['page'], 'powerpress') !== false && isset($_POST['General'])) {
            $ToBeSaved = $_POST['General'];
            if (isset($ToBeSaved['channels'])) {
                $Powerpress['channels'] = $ToBeSaved['channels'];
            }
            if (isset($ToBeSaved['cat_casting'])) {
                $Powerpress['cat_casting'] = $ToBeSaved['cat_casting'];
            }
            if (isset($ToBeSaved['taxonomy_podcasting'])) {
                $Powerpress['taxonomy_podcasting'] = $ToBeSaved['taxonomy_podcasting'];
            }
            if (isset($ToBeSaved['posttype_podcasting'])) {
                $Powerpress['posttype_podcasting'] = $ToBeSaved['posttype_podcasting'];
            }
            if (isset($ToBeSaved['podpress_stats'])) {
                $Powerpress['podpress_stats'] = $ToBeSaved['podpress_stats'];
            }
            if (isset($ToBeSaved['blubrry_hosting'])) {
                $Powerpress['blubrry_hosting'] = $ToBeSaved['blubrry_hosting'];
            }
        }
        add_menu_page(__('PowerPress', 'powerpress'), __('PowerPress', 'powerpress'), POWERPRESS_CAPABILITY_EDIT_PAGES, 'powerpress/powerpressadmin_basic.php', 'powerpress_admin_page_basic', powerpress_get_root_url() . 'powerpress_ico.png');
        add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Settings', 'powerpress'), __('Settings', 'powerpress'), POWERPRESS_CAPABILITY_EDIT_PAGES, 'powerpress/powerpressadmin_basic.php', 'powerpress_admin_page_basic');
        add_options_page(__('PowerPress', 'powerpress'), __('PowerPress', 'powerpress'), POWERPRESS_CAPABILITY_EDIT_PAGES, 'powerpress/powerpressadmin_basic.php', 'powerpress_admin_page_basic');
        add_submenu_page('powerpress/powerpressadmin_basic.php', __('Migrate to Blubrry Podcast Media Hosting', 'powerpress'), __('Migrate Media', 'powerpress') . ' ' . powerpressadmin_new('font-weight: bold; color: #ffffff;'), POWERPRESS_CAPABILITY_EDIT_PAGES, 'powerpress/powerpressadmin_migrate.php', 'powerpress_admin_page_migrate');
        add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Podcasting SEO', 'powerpress'), '<span style="color:#f18500">' . __('Podcasting SEO', 'powerpress') . '</span> ' . powerpressadmin_new('font-weight: bold; color: #ffffff;') . '', POWERPRESS_CAPABILITY_EDIT_PAGES, 'powerpress/powerpressadmin_search.php', 'powerpress_admin_page_search');
        add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Audio Player Options', 'powerpress'), __('Audio Player', 'powerpress'), POWERPRESS_CAPABILITY_EDIT_PAGES, 'powerpress/powerpressadmin_player.php', 'powerpress_admin_page_players');
        add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Video Player Options', 'powerpress'), __('Video Player', 'powerpress'), POWERPRESS_CAPABILITY_EDIT_PAGES, 'powerpress/powerpressadmin_videoplayer.php', 'powerpress_admin_page_videoplayers');
        // Coming soon, maybe PP 6.1
        //add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Mobile Player Options', 'powerpress'), __('Mobile Player', 'powerpress'), POWERPRESS_CAPABILITY_EDIT_PAGES, 'powerpress/powerpressadmin_mobileplayer.php', 'powerpress_admin_page_mobileplayers');
        if (!empty($Powerpress['channels'])) {
            add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Custom Podcast Channels', 'powerpress'), __('Podcast Channels', 'powerpress'), POWERPRESS_CAPABILITY_EDIT_PAGES, 'powerpress/powerpressadmin_customfeeds.php', 'powerpress_admin_page_customfeeds');
        }
        if (!empty($Powerpress['cat_casting'])) {
            add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Category Podcasting', 'powerpress'), __('Category Podcasting', 'powerpress'), POWERPRESS_CAPABILITY_EDIT_PAGES, 'powerpress/powerpressadmin_categoryfeeds.php', 'powerpress_admin_page_categoryfeeds');
        }
        if (defined('POWERPRESS_TAXONOMY_PODCASTING') || !empty($Powerpress['taxonomy_podcasting'])) {
            add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Taxonomy Podcasting', 'powerpress'), __('Taxonomy Podcasting', 'powerpress'), POWERPRESS_CAPABILITY_EDIT_PAGES, 'powerpress/powerpressadmin_taxonomyfeeds.php', 'powerpress_admin_page_taxonomyfeeds');
        }
        if (defined('POWERPRESS_POSTTYPE_PODCASTING') || !empty($Powerpress['posttype_podcasting'])) {
            add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Post Type Podcasting', 'powerpress'), __('Post Type Podcasting', 'powerpress'), POWERPRESS_CAPABILITY_EDIT_PAGES, 'powerpress/powerpressadmin_posttypefeeds.php', 'powerpress_admin_page_posttypefeeds');
        }
        if (!empty($Powerpress['podpress_stats'])) {
            add_submenu_page('powerpress/powerpressadmin_basic.php', __('PodPress Stats', 'powerpress'), __('PodPress Stats', 'powerpress'), POWERPRESS_CAPABILITY_EDIT_PAGES, 'powerpress/powerpressadmin_podpress-stats.php', 'powerpress_admin_page_podpress_stats');
        }
        if (!empty($Powerpress['blubrry_hosting']) && $Powerpress['blubrry_hosting'] !== 'false') {
            add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress MP3 Tags', 'powerpress'), __('MP3 Tags', 'powerpress'), POWERPRESS_CAPABILITY_EDIT_PAGES, 'powerpress/powerpressadmin_tags.php', 'powerpress_admin_page_tags');
        }
        add_submenu_page('powerpress/powerpressadmin_basic.php', __('PowerPress Tools', 'powerpress'), __('Tools', 'powerpress'), POWERPRESS_CAPABILITY_EDIT_PAGES, 'powerpress/powerpressadmin_tools.php', 'powerpress_admin_page_tools');
    }
}
function powerpressadmin_appearance($General = false)
{
    if ($General === false) {
        $General = powerpress_get_settings('powerpress_general');
    }
    $General = powerpress_default_settings($General, 'appearance');
    if (!isset($General['player_function'])) {
        $General['player_function'] = 1;
    }
    if (!isset($General['player_aggressive'])) {
        $General['player_aggressive'] = 0;
    }
    if (!isset($General['new_window_width'])) {
        $General['new_window_width'] = '';
    }
    if (!isset($General['new_window_height'])) {
        $General['new_window_height'] = '';
    }
    if (!isset($General['player_width'])) {
        $General['player_width'] = '';
    }
    if (!isset($General['player_height'])) {
        $General['player_height'] = '';
    }
    if (!isset($General['player_width_audio'])) {
        $General['player_width_audio'] = '';
    }
    if (!isset($General['disable_appearance'])) {
        $General['disable_appearance'] = false;
    }
    $Players = array('podcast' => __('Default Podcast (podcast)', 'powerpress'));
    if (isset($General['custom_feeds'])) {
        while (list($podcast_slug, $podcast_title) = each($General['custom_feeds'])) {
            if ($podcast_slug == 'podcast') {
                continue;
            }
            $Players[$podcast_slug] = sprintf('%s (%s)', $podcast_title, $podcast_slug);
        }
    }
    ?>

<!-- start advanced features -->
<?php 
    if (!empty($General['advanced_mode_2'])) {
        ?>
<h3><?php 
        echo __('Media Appearance Settings', 'powerpress');
        ?>
</h3>
<div id="enable_presentation_settings">
<table class="form-table">
<tr valign="top">
<th scope="row">&nbsp;	</th> 
<td>
	<ul>
		<li><p><label><input type="radio" name="General[disable_appearance]" value="0" <?php 
        if ($General['disable_appearance'] == 0) {
            echo 'checked';
        }
        ?>
 onclick="javascript: jQuery('#presentation_settings').css('display', (this.checked?'block':'none') );" /> <?php 
        echo __('Enable PowerPress Media Players and Links', 'powerpress');
        ?>
</label> (<?php 
        echo __('default', 'powerpress');
        ?>
)</p>
			<ul><li>
				<p class="description"><?php 
        echo __('PowerPress will add media players and links to your site.', 'powerpress');
        ?>
</p>
			</li></ul>
		</li>
		
		<li><p><label><input type="radio" name="General[disable_appearance]" value="1" <?php 
        if ($General['disable_appearance'] == 1) {
            echo 'checked';
        }
        ?>
 onclick="javascript: jQuery('#presentation_settings').css('display', (this.checked?'none':'block') );" /> <?php 
        echo __('Disable PowerPress Media Players and Links', 'powerpress');
        ?>
</label></p>
			<ul><li>
				<p class="description"><?php 
        echo __('PowerPress will <u>not</u> add any media players or media links to your site. PowerPress will only be used to add podcasting support to your feeds.', 'powerpress');
        ?>
</p>
			</li></ul>
		</li>
	</ul>
</td>
</tr>
</table>
</div>
<div id="presentation_settings"<?php 
        if ($General['disable_appearance']) {
            echo ' style="display: none;"';
        }
        ?>
>
<!-- start presentation settings -->
<!-- end advanced features -->
<?php 
    }
    ?>

<h3><?php 
    echo __('Blog Posts and Pages', 'powerpress');
    ?>
</h3>


<table class="form-table">
<tr valign="top">
<th scope="row"><?php 
    echo htmlspecialchars(__('Display Media & Links', 'powerpress'));
    ?>
</th> 
<td>
	<ul>
		<li><p><label><input type="radio" name="General[display_player]" value="1" <?php 
    if ($General['display_player'] == 1) {
        echo 'checked';
    }
    ?>
 /> <?php 
    echo __('Below page content', 'powerpress');
    ?>
</label> (<?php 
    echo __('default', 'powerpress');
    ?>
)</p>
				<ul><li>
					<p class="description"><?php 
    echo __('Player and media links will appear <u>below</u> your post and page content.', 'powerpress');
    ?>
<p>
				</li></ul>
		</li>
		<li><p><label><input type="radio" name="General[display_player]" value="2" <?php 
    if ($General['display_player'] == 2) {
        echo 'checked';
    }
    ?>
 /> <?php 
    echo __('Above page content', 'powerpress');
    ?>
</label></p>
			<ul><li>
				<p class="description"><?php 
    echo __('Player and media links will appear <u>above</u> your post and page content.', 'powerpress');
    ?>
</p>
			</li></ul>
		</li>
		<li>
			<p><label><input type="radio" name="General[display_player]" value="0" <?php 
    if ($General['display_player'] == 0) {
        echo 'checked';
    }
    ?>
 /> <?php 
    echo __('Disable', 'powerpress');
    ?>
</label></p>
			<ul><li>
				<p class="description"><?php 
    echo __('Player and media links will <u>NOT</u> appear in your post and page content. Media player and links can be added manually by using the <i>shortcode</i> below.', 'powerpress');
    ?>
</p>
			</li></ul>
		</li>
	</ul>
	<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:', 'powerpress');
    ?>
 <a href="http://codex.wordpress.org/Template_Tags/the_excerpt" title="<?php 
    echo __('WordPress Excerpts', 'powerpress');
    ?>
" target="_blank"><?php 
    echo __('WordPress Excerpts', 'powerpress');
    ?>
</a>  (<?php 
    echo __('e.g. search results', 'powerpress');
    ?>
)</p>
</td>
</tr>
</table>

<?php 
    if (!empty($General['advanced_mode_2'])) {
        ?>
<!-- start advanced features -->
<table class="form-table">
<tr valign="top">
<th scope="row">
<?php 
        echo __('PowerPress Shortcode', 'powerpress');
        ?>
</th>
<td>
<p>
<?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 content.', 'powerpress'), '<code>[powerpress]</code>');
        ?>
 
<?php 
        echo __('Simply insert the following code on a new line in your content.', 'powerpress');
        ?>
</p>
<div style="margin-left: 30px;">
	<code>[powerpress]</code>
</div>
<p>
<?php 
        echo sprintf(__('Please visit the %s page for additional options.', 'powerpress'), '<a href="http://create.blubrry.com/resources/powerpress/advanced-tools-and-options/shortcode/" target="_blank">' . __('PowerPress Shortcode', 'powerpress') . '</a>');
        ?>
</p>
<p class="description">
<?php 
        echo __('Note: When specifying a URL to media in the powerpress shortcode, only the player is included. The Media Links will <u>NOT</u> be included since there is not enough meta information to display them.', 'powerpress');
        ?>
</p>
</td>
</tr>

<tr valign="top">
<th scope="row">
<?php 
        echo __('Media Player', 'powerpress');
        ?>
</th>
<td>

<p><label><input type="checkbox" name="PlayerSettings[display_media_player]" value="2" <?php 
        if ($General['player_function'] == 1 || $General['player_function'] == 2) {
            echo 'checked ';
        }
        ?>
/> <?php 
        echo __('Display Player', 'powerpress');
        ?>
</label></p>
<?php 
        /* ?>
        <p style="margin-left: 35px;"><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.', 'powerpress'); ?></p>
        <?php */
        ?>
<p><?php 
        echo __('Detected mobile and tablet devices use an HTML5 player with a fallback link to download the media.', 'powerpress');
        ?>
</p>
</td>
</tr>
</table>




<table class="form-table">

<tr valign="top">
<th scope="row">

<?php 
        echo __('Media Links', 'powerpress');
        ?>
</th> 
<td>
	<p><label><input type="checkbox" name="PlayerSettings[display_pinw]" value="3" <?php 
        if ($General['player_function'] == 3 || $General['player_function'] == 1) {
            echo 'checked ';
        }
        ?>
/> <?php 
        echo __('Display Play in new Window Link', 'powerpress');
        ?>
</label></p>
	
	<p><label><input type="checkbox" name="PlayerSettings[display_download]" value="1" <?php 
        if ($General['podcast_link'] != 0) {
            echo 'checked ';
        }
        ?>
/> <?php 
        echo __('Display Download Link', 'powerpress');
        ?>
</label></p>
	
	<p style="margin-left: 35px;"><input type="checkbox" id="display_download_size" name="PlayerSettings[display_download_size]" value="1" <?php 
        if ($General['podcast_link'] == 2 || $General['podcast_link'] == 3) {
            echo 'checked';
        }
        ?>
 onclick="if( !this.checked ) { jQuery('#display_download_duration').removeAttr('checked'); }" /> <?php 
        echo __('Include file size', 'powerpress');
        ?>
	<input type="checkbox" style="margin-left: 30px;" id="display_download_duration" name="PlayerSettings[display_download_duration]" value="1" <?php 
        if ($General['podcast_link'] == 3) {
            echo 'checked';
        }
        ?>
 onclick="if( this.checked ) { jQuery('#display_download_size').attr('checked','checked'); }" /> <?php 
        echo __('Include file size and duration', 'powerpress');
        ?>
</p>
	
	<p><label><input type="checkbox" name="General[podcast_embed]" value="1" <?php 
        if (!empty($General['podcast_embed'])) {
            echo 'checked ';
        }
        ?>
/> <?php 
        echo __('Display Player Embed Link', 'powerpress');
        ?>
 </label></p>
	<p style="margin-left: 35px;">
		<input type="checkbox" name="General[podcast_embed_in_feed]" value="1" <?php 
        if (!empty($General['podcast_embed_in_feed'])) {
            echo 'checked';
        }
        ?>
  /> <?php 
        echo __('Include embed in feeds', 'powerpress');
        ?>
	</p>
	<p><?php 
        echo __('Embed option works with the MediaElement.js Media Player for audio and video, Flow Player Classic for audio and HTML5 Video player for video.', 'powerpress');
        ?>
</p>
</td>
</tr>
</table>
<!-- end advanced features -->
<?php 
    }
    ?>


<table class="form-table">
<tr valign="top">
<th scope="row" style="background-image: url(../wp-includes/images/smilies/icon_exclaim.gif); background-position: 10px 10px; background-repeat: no-repeat; ">

<div style="margin-left: 24px;"><?php 
    echo __('Having Issues?', 'powerpress');
    ?>
</div></th>
<td>
	<select name="General[player_aggressive]" class="bpp_input_med">
<?php 
    $linkoptions = array(0 => __('No, everything is working', 'powerpress'), 1 => __('Yes, please try to fix', 'powerpress'));
    while (list($value, $desc) = each($linkoptions)) {
        echo "\t<option value=\"{$value}\"" . ($General['player_aggressive'] == $value ? ' selected' : '') . ">{$desc}</option>\n";
    }
    ?>
</select>
<p style="margin-top: 5px;">
	<?php 
    echo __('Use this option if you are having problems with the players not appearing on some or all of your pages.', 'powerpress');
    ?>
</p>
<?php 
    if (!empty($General['advanced_mode_2'])) {
        ?>
<p style="margin-top: 20px; margin-bottom:0;">
	<?php 
        echo __('If the above option fixes the player issues, then you most likely have a conflicting theme or plugin activated. You can verify your theme is not causing the problem by testing your site using the default WordPress twentyelevent or twentytwelve theme. For plugins, disable them one by one until the player re-appears, which indicates the last plugin deactivated caused the conflict.', 'powerpress');
        ?>
</p>
<?php 
    }
    ?>
</td>
</tr>
</table>

<?php 
    if (!empty($General['advanced_mode_2'])) {
        ?>
<!-- start advanced features -->
<div id="new_window_settings" style="display: <?php 
        echo $General['player_function'] == 1 || $General['player_function'] == 3 ? 'block' : 'none';
        ?>
">
<h3><?php 
        echo __('Play in New Window Settings', 'powerpress');
        ?>
</h3>
<table class="form-table">

<tr valign="top">
<th scope="row">
<?php 
        echo __('New Window Width', 'powerpress');
        ?>
</th>
<td>
<input type="text" name="General[new_window_width]" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');" value="<?php 
        echo $General['new_window_width'];
        ?>
" maxlength="4" />
<?php 
        echo __('Width of new window (leave blank for 420 default)', 'powerpress');
        ?>
</td>
</tr>

<tr valign="top">
<th scope="row">
<?php 
        echo __('New Window Height', 'powerpress');
        ?>
</th>
<td>
<input type="text" name="General[new_window_height]" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');" value="<?php 
        echo $General['new_window_height'];
        ?>
" maxlength="4" />
<?php 
        echo __('Height of new window (leave blank for 240 default)', 'powerpress');
        ?>
</td>
</tr>

<tr valign="top">
<th scope="row">
&nbsp;
</th>
<td>

	<p style="margin: 8px 0 0 0;">
		<label><input type="checkbox" name="General[new_window_nofactor]" value="1" <?php 
        if (!empty($General['new_window_nofactor'])) {
            echo 'checked';
        }
        ?>
  /> <?php 
        echo __('Do not factor in scroll bars', 'powerpress');
        ?>
</label>
	</p>
	<div style="margin: 0 0 0 20px;"><?php 
        echo __('By default, PowerPress adds to the width and height above to compensate for possible vertical and horizontal scroll bars. Check this option if you do not want PowerPress to compensate for browser scroll bars.', 'powerpress');
        ?>
</div>
</td>

</table>
</div>


<h3><?php 
        echo __('Media Format Settings', 'powerpress');
        ?>
</h3>
<table class="form-table">

<tr valign="top">
<th scope="row">
<?php 
        echo __('AAC Audio (.m4a)', 'powerpress');
        ?>
</th>
<td>

	<p style="margin: 8px 0 0 0;">
		<label><input type="checkbox" name="General[m4a]" value="use_players" <?php 
        if (!empty($General['m4a']) && $General['m4a'] == 'use_players') {
            echo 'checked';
        }
        ?>
  /> <?php 
        echo __('Use Flow Player Classic / HTML5 Audio player', 'powerpress');
        ?>
</label>
	</p>
	<div style="margin-left: 20px;"><?php 
        echo __('Leave this option unchecked if you want m4a chapter markers, images and information displayed.', 'powerpress');
        ?>
</div>
	<div style="margin: 10px 0 0 20px;"><?php 
        echo __('When unchecked, m4a will be played with the quicktime video embed. Video player width/height settings apply.', 'powerpress');
        ?>
</div>

</td>
</tr>
</table>
</div>
<!-- end presentation settings -->
<!-- end advanced features -->
<?php 
    }
}