Exemplo n.º 1
0
function powerpress_admin_players_init()
{
    //wp_enqueue_script('jquery');
    //echo "powerpres player init";
    wp_enqueue_style('mediaelement');
    wp_enqueue_style('wp-mediaelement');
    wp_enqueue_script('mediaelement');
    // wp_enqueue_script( 'wp-mediaelement' );
    wp_enqueue_script('powerpress-mejs', powerpress_get_root_url() . 'powerpress-mejs.js');
    $Settings = false;
    // Important, never remove this
    $Step = 1;
    $action = isset($_GET['action']) ? $_GET['action'] : (isset($_POST['action']) ? $_POST['action'] : false);
    //$type = (isset($_GET['type'])?$_GET['type']: (isset($_POST['type'])?$_POST['type']:'audio') );
    if (!$action) {
        return;
    }
    switch ($action) {
        case 'powerpress-select-player':
            $SaveSettings = array();
            //$SaveSettings = $_POST['Player'];
            if (isset($_POST['Player'])) {
                $SaveSettings = $_POST['Player'];
            }
            if (isset($_POST['VideoPlayer'])) {
                $SaveSettings += $_POST['VideoPlayer'];
            }
            powerpress_save_settings($SaveSettings, 'powerpress_general');
            powerpress_page_message_add_notice(__('Player activated successfully.', 'powerpress'));
            break;
        case 'powerpress-audio-player':
            $SaveSettings = $_POST['Player'];
            powerpress_save_settings($SaveSettings, 'powerpress_audio-player');
            powerpress_page_message_add_notice(__('Audio Player settings saved successfully.', 'powerpress'));
            break;
        case 'powerpress-flashmp3-maxi':
            $SaveSettings = $_POST['Player'];
            powerpress_save_settings($SaveSettings, 'powerpress_flashmp3-maxi');
            powerpress_page_message_add_notice(__('Flash Mp3 Maxi settings saved successfully.', 'powerpress'));
            break;
        case 'powerpress-audioplay':
            $SaveSettings = $_POST['Player'];
            powerpress_save_settings($SaveSettings, 'powerpress_audioplay');
            powerpress_page_message_add_notice(__('AudioPlay settings saved successfully.', 'powerpress'));
            break;
            //TODO: PowerPress 5.0
            //case 'powerpress-mediaelement':
            //{
            //	$SaveSettings = $_POST['Player'];
            //	powerpress_save_settings($SaveSettings, 'powerpress_mediaelement');
            //	powerpress_page_message_add_notice( __('MediaElement.js settings saved successfully.', 'powerpress') );
            //}; break;
    }
}
Exemplo n.º 2
0
function powerpress_meta_box($object, $box)
{
    $FeedSlug = str_replace('powerpress-', '', $box['id']);
    $DurationHH = '';
    $DurationMM = '';
    $DurationSS = '';
    $EnclosureURL = '';
    $EnclosureLength = '';
    $Embed = '';
    $CoverImage = '';
    $iTunesDuration = false;
    $iTunesKeywords = '';
    $iTunesSubtitle = '';
    $iTunesSummary = '';
    $iTunesAuthor = '';
    $iTunesExplicit = '';
    $iTunesCC = false;
    $iTunesOrder = false;
    $FeedAlways = false;
    $iTunesBlock = false;
    $NoPlayer = false;
    $NoLinks = false;
    $IsHD = false;
    $IsVideo = false;
    $Width = false;
    $Height = false;
    $WebMSrc = false;
    $GeneralSettings = get_option('powerpress_general');
    if (!isset($GeneralSettings['set_size'])) {
        $GeneralSettings['set_size'] = 0;
    }
    if (!isset($GeneralSettings['set_duration'])) {
        $GeneralSettings['set_duration'] = 0;
    }
    if (!isset($GeneralSettings['episode_box_embed'])) {
        $GeneralSettings['episode_box_embed'] = 0;
    }
    if (!empty($GeneralSettings['blubrry_hosting']) && $GeneralSettings['blubrry_hosting'] === 'false') {
        $GeneralSettings['blubrry_hosting'] = false;
    }
    $ExtraData = array();
    if ($object->ID) {
        if ($FeedSlug == 'podcast') {
            $enclosureArray = get_post_meta($object->ID, 'enclosure', true);
        } else {
            $enclosureArray = get_post_meta($object->ID, '_' . $FeedSlug . ':enclosure', true);
        }
        $EnclosureURL = '';
        $EnclosureLength = '';
        $EnclosureType = '';
        $EnclosureSerialized = false;
        if ($enclosureArray) {
            // list($EnclosureURL, $EnclosureLength, $EnclosureType, $EnclosureSerialized) =  explode("\n", $enclosureArray, 4);
            $MetaParts = explode("\n", $enclosureArray, 4);
            if (count($MetaParts) > 0) {
                $EnclosureURL = $MetaParts[0];
            }
            if (count($MetaParts) > 1) {
                $EnclosureLength = $MetaParts[1];
            }
            if (count($MetaParts) > 2) {
                $EnclosureType = $MetaParts[2];
            }
            if (count($MetaParts) > 3) {
                $EnclosureSerialized = $MetaParts[3];
            }
        }
        $EnclosureURL = trim($EnclosureURL);
        $EnclosureLength = trim($EnclosureLength);
        $EnclosureType = trim($EnclosureType);
        if ($EnclosureSerialized) {
            $ExtraData = @unserialize($EnclosureSerialized);
            if ($ExtraData) {
                if (isset($ExtraData['duration'])) {
                    $iTunesDuration = $ExtraData['duration'];
                } else {
                    if (isset($ExtraData['length'])) {
                        // Podcasting plugin support
                        $iTunesDuration = $ExtraData['length'];
                    }
                }
                if (isset($ExtraData['embed'])) {
                    $Embed = $ExtraData['embed'];
                }
                if (isset($ExtraData['keywords'])) {
                    $iTunesKeywords = $ExtraData['keywords'];
                }
                if (isset($ExtraData['subtitle'])) {
                    $iTunesSubtitle = $ExtraData['subtitle'];
                }
                if (isset($ExtraData['summary'])) {
                    $iTunesSummary = $ExtraData['summary'];
                }
                if (isset($ExtraData['author'])) {
                    $iTunesAuthor = $ExtraData['author'];
                }
                if (isset($ExtraData['no_player'])) {
                    $NoPlayer = $ExtraData['no_player'];
                }
                if (isset($ExtraData['no_links'])) {
                    $NoLinks = $ExtraData['no_links'];
                }
                if (isset($ExtraData['explicit'])) {
                    $iTunesExplicit = $ExtraData['explicit'];
                }
                if (isset($ExtraData['cc'])) {
                    $iTunesCC = $ExtraData['cc'];
                }
                if (isset($ExtraData['order'])) {
                    $iTunesOrder = $ExtraData['order'];
                }
                if (isset($ExtraData['always'])) {
                    $FeedAlways = $ExtraData['always'];
                }
                if (isset($ExtraData['block'])) {
                    $iTunesBlock = $ExtraData['block'];
                }
                if (isset($ExtraData['image'])) {
                    $CoverImage = $ExtraData['image'];
                }
                if (isset($ExtraData['ishd'])) {
                    $IsHD = $ExtraData['ishd'];
                }
                if (isset($ExtraData['height'])) {
                    $Height = $ExtraData['height'];
                }
                if (isset($ExtraData['width'])) {
                    $Width = $ExtraData['width'];
                }
                if (isset($ExtraData['webm_src'])) {
                    $WebMSrc = $ExtraData['webm_src'];
                }
            }
        }
        if (defined('POWERPRESS_AUTO_DETECT_ONCE') && POWERPRESS_AUTO_DETECT_ONCE != false) {
            if ($EnclosureLength) {
                $GeneralSettings['set_size'] = 1;
            }
            // specify
            if ($iTunesDuration) {
                $GeneralSettings['set_duration'] = 1;
            }
            // specify
        }
        if ($FeedSlug == 'podcast' && !$iTunesDuration) {
            // Get the iTunes duration the old way (very old way)
            $iTunesDuration = get_post_meta($object->ID, 'itunes:duration', true);
        }
        if ($iTunesDuration) {
            $iTunesDuration = powerpress_readable_duration($iTunesDuration, true);
            list($DurationHH, $DurationMM, $DurationSS) = explode(':', $iTunesDuration);
            if (ltrim($DurationHH, '0') == 0) {
                $DurationHH = '';
            }
            if ($DurationHH == '' && ltrim($DurationMM, '0') == 0) {
                $DurationMM = '';
            }
            if ($DurationHH == '' && $DurationMM == '' && ltrim($DurationSS, '0') == 0) {
                $DurationSS = '';
            }
        }
        // Check for HD Video formats
        if (preg_match('/\\.(mp4|m4v|webm|ogg|ogv)$/i', $EnclosureURL)) {
            $IsVideo = true;
        }
    }
    if ($EnclosureURL) {
        ?>
<div>
	<input type="checkbox" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][change_podcast]" id="powerpress_change" value="1"  onchange="javascript:document.getElementById('powerpress_podcast_box_<?php 
        echo $FeedSlug;
        ?>
').style.display=(this.checked?'block':'none');" />
	<?php 
        echo __('Modify existing podcast episode', 'powerpress');
        ?>
</div>
<?php 
    } else {
        echo '<input type="hidden" name="Powerpress[' . $FeedSlug . '][new_podcast]" value="1" />' . PHP_EOL;
    }
    ?>

<div class="powerpress_podcast_box" id="powerpress_podcast_box_<?php 
    echo $FeedSlug;
    ?>
"<?php 
    if ($EnclosureURL) {
        echo ' style="display:none;"';
    }
    ?>
>
<?php 
    if ($EnclosureURL) {
        ?>
	<div class="powerpress_row">
		<label><?php 
        echo __('Remove', 'powerpress');
        ?>
</label>
		<div class="powerpress_row_content">
			<input type="checkbox" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][remove_podcast]" id="powerpress_remove" value="1"  onchange="javascript:document.getElementById('powerpress_podcast_edit_<?php 
        echo $FeedSlug;
        ?>
').style.display=(this.checked?'none':'block');" />
			<?php 
        echo __('Podcast episode will be removed from this post upon save', 'powerpress');
        ?>
		</div>
	</div>
<?php 
    }
    ?>
	<div id="powerpress_podcast_edit_<?php 
    echo $FeedSlug;
    ?>
">
		<div class="error below-h2" id="powerpress_warning_<?php 
    echo $FeedSlug;
    ?>
" style="display:none;"></div>
		<div class="success below-h2" id="powerpress_success_<?php 
    echo $FeedSlug;
    ?>
" style="display:none;"></div>
		<div class="powerpress_row">
			<label for="Powerpress[<?php 
    echo $FeedSlug;
    ?>
][url]"><?php 
    echo __('Media URL', 'powerpress');
    ?>
</label>
			<div class="powerpress_row_content">
				<input id="powerpress_url_<?php 
    echo $FeedSlug;
    ?>
" class="powerpress-url" name="Powerpress[<?php 
    echo $FeedSlug;
    ?>
][url]" value="<?php 
    echo $EnclosureURL;
    ?>
" <?php 
    echo !empty($ExtraData['hosting']) ? 'readOnly' : '';
    ?>
 style="width: 70%; font-size: 90%;" />
				<?php 
    if (!empty($GeneralSettings['blubrry_hosting']) && $GeneralSettings['blubrry_hosting'] !== 'false' || empty($GeneralSettings['no_media_url_folder'])) {
        ?>
				<a href="<?php 
        echo admin_url('admin.php');
        ?>
?action=powerpress-jquery-media&podcast-feed=<?php 
        echo $FeedSlug;
        ?>
&KeepThis=true&TB_iframe=true&modal=true" title="<?php 
        echo __('Browse Media File', 'powerpress');
        ?>
" class="thickbox"><img src="<?php 
        echo powerpress_get_root_url();
        ?>
/images/blubrry_folder.png" alt="<?php 
        echo __('Browse Media Files', 'powerpress');
        ?>
" /></a>
				<?php 
    }
    ?>
				<input type="button" id="powerpress_check_<?php 
    echo $FeedSlug;
    ?>
_button" name="powerpress_check_<?php 
    echo $FeedSlug;
    ?>
_button" value="<?php 
    echo __('Verify', 'powerpress');
    ?>
" onclick="powerpress_get_media_info('<?php 
    echo $FeedSlug;
    ?>
');" alt="<?php 
    echo __('Verify Media', 'powerpress');
    ?>
" class="button" />
				<img id="powerpress_check_<?php 
    echo $FeedSlug;
    ?>
" src="<?php 
    echo admin_url();
    ?>
images/loading.gif" style="vertical-align:text-top; display: none;" alt="<?php 
    echo __('Checking Media', 'powerpress');
    ?>
" />
				
				<input type="hidden" id="powerpress_hosting_<?php 
    echo $FeedSlug;
    ?>
" name="Powerpress[<?php 
    echo $FeedSlug;
    ?>
][hosting]" value="<?php 
    echo !empty($ExtraData['hosting']) ? '1' : '0';
    ?>
" />
				<div id="powerpress_hosting_note_<?php 
    echo $FeedSlug;
    ?>
" style="margin-left: 2px; padding-bottom: 2px; padding-top: 2px; display: <?php 
    echo !empty($ExtraData['hosting']) ? 'block' : 'none';
    ?>
"><em><?php 
    echo __('Media file hosted by blubrry.com.', 'powerpress');
    ?>
					(<a href="#" title="<?php 
    echo __('Remove Blubrry.com hosted media file', 'powerpress');
    ?>
" onclick="powerpress_remove_hosting('<?php 
    echo $FeedSlug;
    ?>
');return false;"><?php 
    echo __('remove', 'powerpress');
    ?>
</a>)
				</em></div>
				

				<div style="padding-bottom: 2px; padding-top: 2px;">
					<span id="powerpress_ishd_<?php 
    echo $FeedSlug;
    ?>
_span" style="margin-left: 20px; display: <?php 
    echo $IsVideo ? 'inline' : 'none';
    ?>
; "><input id="powerpress_ishd_<?php 
    echo $FeedSlug;
    ?>
" name="Powerpress[<?php 
    echo $FeedSlug;
    ?>
][ishd]" value="1" type="checkbox" <?php 
    echo $IsHD == 1 ? 'checked' : '';
    ?>
 /> <?php 
    echo __('Video is HD (720p/1080i/1080p)', 'powerpress');
    ?>
</span>
<?php 
    if (!empty($GeneralSettings['episode_box_no_player']) || !empty($GeneralSettings['episode_box_no_links']) || !empty($GeneralSettings['episode_box_no_player_and_links'])) {
        if (!empty($GeneralSettings['episode_box_no_player_and_links'])) {
            ?>
		<span style="margin-left: 20px;"><input id="powerpress_no_player_and_links_<?php 
            echo $FeedSlug;
            ?>
" name="Powerpress[<?php 
            echo $FeedSlug;
            ?>
][no_player_and_links]" value="1" type="checkbox" <?php 
            echo $NoPlayer == 1 && $NoLinks == 1 ? 'checked' : '';
            ?>
 /> <?php 
            echo __('Do not display player and media links', 'powerpress');
            ?>
</span>
		<?php 
        }
        if (!empty($GeneralSettings['episode_box_no_player'])) {
            ?>
		<span style="margin-left: 20px;"><input id="powerpress_no_player_<?php 
            echo $FeedSlug;
            ?>
" name="Powerpress[<?php 
            echo $FeedSlug;
            ?>
][no_player]" value="1" type="checkbox" <?php 
            echo $NoPlayer == 1 ? 'checked' : '';
            ?>
 /> <?php 
            echo __('Do not display player', 'powerpress');
            ?>
</span>
		<?php 
        }
        if (!empty($GeneralSettings['episode_box_no_links'])) {
            ?>
		<span style="margin-left: 20px;"><input id="powerpress_no_links_<?php 
            echo $FeedSlug;
            ?>
" name="Powerpress[<?php 
            echo $FeedSlug;
            ?>
][no_links]" value="1" type="checkbox" <?php 
            echo $NoLinks == 1 ? 'checked' : '';
            ?>
 /> <?php 
            echo __('Do not display media links', 'powerpress');
            ?>
</span>
		<?php 
        }
    }
    ?>
				</div>
			</div><!-- end powerpress_row_content -->
		</div><!-- end powerpress_row -->
		<div class="powerpress_row" id="powerpress_webm_<?php 
    echo $FeedSlug;
    ?>
" style="display: <?php 
    echo $WebMSrc != '' || preg_match('/\\.(mp4|m4v)$/i', $EnclosureURL) ? 'block' : 'none';
    ?>
;">
			<label for="Powerpress[<?php 
    echo $FeedSlug;
    ?>
][webm_src]"><?php 
    echo __('Alt WebM URL', 'powerpress');
    ?>
</label>
			<div class="powerpress_row_content">
				<input id="powerpress_webm_src_<?php 
    echo $FeedSlug;
    ?>
" class="powerpress-webm-src" name="Powerpress[<?php 
    echo $FeedSlug;
    ?>
][webm_src]" value="<?php 
    echo $WebMSrc;
    ?>
" style="width: 70%; font-size: 90%;" />
			</div>
			<div class="powerpress_row_content">
				<em><?php 
    echo __('For HTML5 Video fallback, enter an alternative WebM media URL above. (optional)', 'powerpress');
    ?>
</em>
			</div>
		</div>
<?php 
    if (empty($GeneralSettings['episode_box_mode']) || $GeneralSettings['episode_box_mode'] != 1) {
        ?>
		<div class="powerpress_row">
			<label><?php 
        echo __('File Size', 'powerpress');
        ?>
</label>
			<div class="powerpress_row_content">
				<div style="margin-bottom: 4px;">
					<input id="powerpress_set_size_0_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][set_size]" value="0" type="radio" <?php 
        echo $GeneralSettings['set_size'] == 0 ? 'checked' : '';
        ?>
 /> 
					<?php 
        echo __('Auto detect file size', 'powerpress');
        ?>
				</div>
				<div>
					<input id="powerpress_set_size_1_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][set_size]" value="1" type="radio" <?php 
        echo $GeneralSettings['set_size'] == 1 ? 'checked' : '';
        ?>
 />
					<?php 
        echo __('Specify', 'powerpress') . ': ';
        ?>
					<input id="powerpress_size_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][size]" value="<?php 
        echo $EnclosureLength;
        ?>
" style="width: 110px; font-size: 90%;" onchange="javascript:jQuery('#powerpress_set_size_1_<?php 
        echo $FeedSlug;
        ?>
').attr('checked', true);"  />
					<?php 
        echo __('in bytes', 'powerpress');
        ?>
				</div>
			</div>
		</div>
		<div class="powerpress_row">
			<label><?php 
        echo __('Duration', 'powerpress');
        ?>
</label>
			<div class="powerpress_row_content">
				<div style="margin-bottom: 4px;">
					<input id="powerpress_set_duration_0_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][set_duration]" value="0" type="radio" <?php 
        echo $GeneralSettings['set_duration'] == 0 ? 'checked' : '';
        ?>
 />
					<?php 
        echo __('Auto detect duration (mp3\'s only)', 'powerpress');
        ?>
				</div>
				<div style="margin-bottom: 4px;">
					<input id="powerpress_set_duration_1_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][set_duration]" value="1" type="radio" <?php 
        echo $GeneralSettings['set_duration'] == 1 ? 'checked' : '';
        ?>
 />
					<?php 
        echo __('Specify', 'powerpress') . ': ';
        ?>
					<input id="powerpress_duration_hh_<?php 
        echo $FeedSlug;
        ?>
" class="powerpress-duration-hh" placeholder="HH" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][duration_hh]" maxlength="2" value="<?php 
        echo $DurationHH;
        ?>
" style="width: 36px; font-size: 90%; text-align: right;" onchange="javascript:jQuery('#powerpress_set_duration_1_<?php 
        echo $FeedSlug;
        ?>
').attr('checked', true);" /><strong>:</strong> 
					<input id="powerpress_duration_mm_<?php 
        echo $FeedSlug;
        ?>
" class="powerpress-duration-mm" placeholder="MM" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][duration_mm]" maxlength="2" value="<?php 
        echo $DurationMM;
        ?>
" style="width: 36px; font-size: 90%; text-align: right;" onchange="javascript:jQuery('#powerpress_set_duration_1_<?php 
        echo $FeedSlug;
        ?>
').attr('checked', true);" /><strong>:</strong> 
					<input id="powerpress_duration_ss_<?php 
        echo $FeedSlug;
        ?>
" class="powerpress-duration-ss" placeholder="SS" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][duration_ss]" maxlength="10" value="<?php 
        echo $DurationSS;
        ?>
" style="width: 36px; font-size: 90%; text-align: right;" onchange="javascript:jQuery('#powerpress_set_duration_1_<?php 
        echo $FeedSlug;
        ?>
').attr('checked', true);" />
				</div>
				<div>
					<input id="powerpress_set_duration_2_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][set_duration]" value="-1" type="radio" <?php 
        echo $GeneralSettings['set_duration'] == -1 ? 'checked' : '';
        ?>
 />
					<?php 
        echo __('Not specified', 'powerpress');
        ?>
				</div>
			</div>
		</div>
<?php 
    } else {
        ?>
<input id="powerpress_set_size_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][set_size]" value="0" type="hidden" />
<input id="powerpress_set_duration_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][set_duration]" value="0" type="hidden" />
<?php 
    }
    // Video Coverart Image (Poster)
    if (!empty($GeneralSettings['episode_box_cover_image']) || $CoverImage) {
        $form_action_url = admin_url("media-upload.php?type=powerpress_image&tab=type&post_id={$object->ID}&powerpress_feed={$FeedSlug}&TB_iframe=true&width=450&height=200");
        ?>
		<div class="powerpress_row">
			<label for="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][image]"><?php 
        echo __('Poster Image', 'powerpress');
        ?>
</label>
			<div class="powerpress_row_content">
				<input id="powerpress_image_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][image]" value="<?php 
        echo htmlspecialchars($CoverImage);
        ?>
" placeholder="<?php 
        echo htmlspecialchars(__('e.g. http://example.com/path/to/image.jpg', 'powerpress'));
        ?>
" style="width: 70%; font-size: 90%;" size="250" />
				<a href="<?php 
        echo $form_action_url;
        ?>
" class="thickbox powerpress-image-browser" id="powerpress_image_browser_<?php 
        echo $FeedSlug;
        ?>
" title="<?php 
        echo __('Select Poster Image', 'powerpress');
        ?>
"><img src="images/media-button-image.gif" /></a>
			</div>
			<div class="powerpress_row_content">
				<em><?php 
        echo __('Poster image for video (m4v, mp4, ogv, webm, etc..)', 'powerpress');
        ?>
</em>
			</div>
		</div>
<?php 
    }
    // Player width/height
    if (!empty($GeneralSettings['episode_box_player_size']) || $Width || $Height) {
        ?>
		<div class="powerpress_row">
			<label><?php 
        echo __('Player Size', 'powerpress');
        ?>
</label>
			<div class="powerpress_row_content">
				<input id="powerpress_player_width_<?php 
        echo $FeedSlug;
        ?>
" class="powerpress-player-width" placeholder="<?php 
        echo htmlspecialchars(__('Width', 'powerpress'));
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][width]" value="<?php 
        echo htmlspecialchars($Width);
        ?>
" style="width: 50px; font-size: 90%;" size="5" />
				x
				<input id="powerpress_player_height_<?php 
        echo $FeedSlug;
        ?>
" class="powerpress-player-height" placeholder="<?php 
        echo htmlspecialchars(__('Height', 'powerpress'));
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][height]" value="<?php 
        echo htmlspecialchars($Height);
        ?>
" style="width: 50px; font-size: 90%;" size="5" />
			</div>
		</div>
<?php 
    }
    // Embed option, enter your own embed code provided by sites such as YouTube, Viddler and Blip.tv
    if (!empty($GeneralSettings['episode_box_embed']) || $Embed) {
        ?>
		<div class="powerpress_row">
			<label for="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][embed]"><?php 
        echo __('Media Embed', 'powerpress');
        ?>
</label>
			<div class="powerpress_row_content">
				<textarea class="powerpress-embed" id="powerpress_embed_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][embed]" style="width: 90%; height: 80px; font-size: 90%;" onfocus="this.select();"><?php 
        echo htmlspecialchars($Embed);
        ?>
</textarea>
			</div>
		</div>
<?php 
    }
    if (!empty($GeneralSettings['episode_box_keywords']) || $iTunesKeywords) {
        ?>
		<div class="powerpress_row">
			<label for="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][keywords]"><?php 
        echo __('iTunes Keywords', 'powerpress');
        ?>
</label>
			<div class="powerpress_row_content">
				<input id="powerpress_keywords_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][keywords]" value="<?php 
        echo htmlspecialchars($iTunesKeywords);
        ?>
" style="width: 90%; font-size: 90%;" size="250" />
			</div>
			<div class="powerpress_row_content">
				<em><?php 
        echo __('Enter up to 12 keywords separated by commas. Leave blank to use your blog post tags.', 'powerpress');
        ?>
</em>
			</div>
		</div>
<?php 
    }
    if (!empty($GeneralSettings['episode_box_subtitle']) || $iTunesSubtitle) {
        ?>
		<div class="powerpress_row">
			<label for="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][subtitle]"><?php 
        echo __('iTunes Subtitle', 'powerpress');
        ?>
</label>
			<div class="powerpress_row_content">
				<input id="powerpress_subtitle_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][subtitle]" value="<?php 
        echo htmlspecialchars($iTunesSubtitle);
        ?>
" style="width: 90%; font-size: 90%;" size="250" />
			</div>
			<div class="powerpress_row_content">
				<em><?php 
        echo __('Your subtitle may not contain HTML and cannot exceed 250 characters in length. Leave blank to use the first 250 characters of your blog post.', 'powerpress');
        ?>
</em>
			</div>
		</div>
<?php 
    }
    if (!empty($GeneralSettings['episode_box_summary']) || $iTunesSummary) {
        ?>
		<div class="powerpress_row">
			<label for="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][summary]"><?php 
        echo __('iTunes Summary', 'powerpress');
        ?>
</label>
			<div class="powerpress_row_content">
				<textarea id="powerpress_summary_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][summary]" style="width: 90%; height: 80px; font-size: 90%;"><?php 
        echo htmlspecialchars($iTunesSummary);
        ?>
</textarea>
			</div>	
			<div class="powerpress_row_content">
				<em><?php 
        echo __('Your summary may not contain HTML and cannot exceed 4,000 characters in length. Leave blank to use your blog post.', 'powerpress');
        ?>
</em>
			</div>
		</div>
<?php 
    }
    if (!empty($GeneralSettings['episode_box_author']) || $iTunesAuthor) {
        ?>
		<div class="powerpress_row">
			<label for="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][author]"><?php 
        echo __('iTunes Author', 'powerpress');
        ?>
</label>
			<div class="powerpress_row_content">
				<input id="powerpress_author_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][author]" value="<?php 
        echo htmlspecialchars($iTunesAuthor);
        ?>
" style="width: 60%; font-size: 90%;" size="250" />
			</div>
			<div class="powerpress_row_content">
				<em><?php 
        echo __('Leave blank to use post author name.', 'powerpress');
        ?>
</em>
			</div>
		</div>
<?php 
    }
    if (!empty($GeneralSettings['episode_box_explicit']) || $iTunesExplicit) {
        ?>
		<div class="powerpress_row">
			<label for="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][explicit]"><?php 
        echo __('iTunes Explicit', 'powerpress');
        ?>
</label>
			<div class="powerpress_row_content">
				<select id="powerpress_explicit_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][explicit]" style="width: 220px;">
<?php 
        $explicit_array = array('' => __('Use feed\'s explicit setting', 'powerpress'), 0 => __('no - display nothing', 'powerpress'), 1 => __('yes - explicit content', 'powerpress'), 2 => __('clean - no explicit content', 'powerpress'));
        while (list($value, $desc) = each($explicit_array)) {
            echo "\t<option value=\"{$value}\"" . ($iTunesExplicit == $value ? ' selected' : '') . ">{$desc}</option>\n";
        }
        ?>
					</select>
			</div>	
		</div>
<?php 
    }
    if (!empty($GeneralSettings['episode_box_closed_captioned']) || $iTunesCC) {
        ?>
		<div class="powerpress_row">
			<label for="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][cc]"><?php 
        echo __('iTunes CC', 'powerpress');
        ?>
</label>
			<div class="powerpress_row_content">
				<select id="powerpress_cc_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][cc]" style="width: 220px;">
<?php 
        $cc_array = array('' => __('No Closed Captioning', 'powerpress'), 1 => __('Yes, Closed Captioned media', 'powerpress'));
        while (list($value, $desc) = each($cc_array)) {
            echo "\t<option value=\"{$value}\"" . ($iTunesCC == $value ? ' selected' : '') . ">{$desc}</option>\n";
        }
        unset($cc_array);
        ?>
					</select>
			</div>	
		</div>
<?php 
    }
    if (!empty($GeneralSettings['episode_box_order']) || $iTunesOrder) {
        ?>
		<div class="powerpress_row">
			<label for="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][order]"><?php 
        echo __('iTunes Order', 'powerpress');
        ?>
</label>
			<div class="powerpress_row_content">
				<input id="powerpress_order_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][order]" value="<?php 
        echo htmlspecialchars($iTunesOrder);
        ?>
" style="width: 60px; font-size: 90%;" size="250" />
			</div>	
		</div>
<?php 
    }
    if (!empty($GeneralSettings['episode_box_feature_in_itunes'])) {
        $iTunesFeatured = get_option('powerpress_itunes_featured');
        $FeaturedChecked = false;
        if (!empty($object->ID) && !empty($iTunesFeatured[$FeedSlug]) && $iTunesFeatured[$FeedSlug] == $object->ID) {
            $FeaturedChecked = true;
        }
        ?>
		<div class="powerpress_row">
			<label for="PowerpressFeature[<?php 
        echo $FeedSlug;
        ?>
]"><?php 
        echo __('Feature Episode', 'powerpress');
        ?>
</label>
			<div class="powerpress_row_content">
				<input type="checkbox" id="powerpress_feature_<?php 
        echo $FeedSlug;
        ?>
" name="PowerpressFeature[<?php 
        echo $FeedSlug;
        ?>
]" value="1" <?php 
        echo $FeaturedChecked ? 'checked' : '';
        ?>
 />
				<?php 
        echo __('Episode will appear at the top of your episode list in the iTunes directory.', 'powerpress');
        ?>
			</div>	
		</div>
<?php 
    }
    if (!empty($GeneralSettings['episode_box_block']) || $iTunesBlock) {
        ?>
		<div class="powerpress_row">
			<label for="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][block]"><?php 
        echo __('iTunes Block', 'powerpress');
        ?>
</label>
			<div class="powerpress_row_content">
				<select id="powerpress_block_<?php 
        echo $FeedSlug;
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][block]" style="width: 220px;">
<?php 
        $block_array = array('' => __('No', 'powerpress'), 1 => __('Yes, Block episode from iTunes', 'powerpress'));
        while (list($value, $desc) = each($block_array)) {
            echo "\t<option value=\"{$value}\"" . ($iTunesBlock == $value ? ' selected' : '') . ">{$desc}</option>\n";
        }
        unset($block_array);
        ?>
					</select>
			</div>	
		</div>
<?php 
    }
    if (!empty($GeneralSettings['episode_box_itunes_image']) || !empty($ExtraData['itunes_image'])) {
        if (empty($ExtraData['itunes_image'])) {
            $ExtraData['itunes_image'] = '';
        }
        $form_action_url = admin_url("media-upload.php?type=powerpress_image&tab=type&post_id={$object->ID}&powerpress_feed={$FeedSlug}&TB_iframe=true&width=450&height=200");
        ?>
		<div class="powerpress_row">
			<label for="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][itunes_image]"><?php 
        echo __('iTunes Image', 'powerpress');
        ?>
</label>
			<div class="powerpress_row_content">
				<input id="powerpress_itunes_image_<?php 
        echo $FeedSlug;
        ?>
" placeholder="<?php 
        echo htmlspecialchars(__('e.g. http://example.com/path/to/image.jpg', 'powerpress'));
        ?>
" name="Powerpress[<?php 
        echo $FeedSlug;
        ?>
][itunes_image]" value="<?php 
        echo htmlspecialchars($ExtraData['itunes_image']);
        ?>
" style="width: 70%; font-size: 90%;" size="250" />
				<a href="<?php 
        echo $form_action_url;
        ?>
" class="thickbox powerpress-itunes-image-browser" id="powerpress_itunes_image_browser_<?php 
        echo $FeedSlug;
        ?>
" title="<?php 
        echo __('Select iTunes Image', 'powerpress');
        ?>
"><img src="images/media-button-image.gif" /></a>
			</div>
		</div>
<?php 
    }
    // Added filter for other plugins to add fields on a per podcast feed slug basis
    echo apply_filters('powerpress_metabox', '', $object, $FeedSlug);
    ?>
	</div><!-- end powerpress_podcast_edit_<?php 
    echo $FeedSlug;
    ?>
 -->
</div><!-- end powerpress_podcast_box -->
<?php 
    if (!empty($GeneralSettings['episode_box_background_color'][$FeedSlug])) {
        ?>
<script type="text/javascript"><!--
jQuery(document).ready(function($) {
	jQuery('#powerpress-<?php 
        echo $FeedSlug;
        ?>
').css( {'background-color' : '<?php 
        echo $GeneralSettings['episode_box_background_color'][$FeedSlug];
        ?>
' });
	jQuery('#powerpress-<?php 
        echo $FeedSlug;
        ?>
').css( {'background-image' : '-moz-linear-gradient(center top , <?php 
        echo $GeneralSettings['episode_box_background_color'][$FeedSlug];
        ?>
, <?php 
        echo $GeneralSettings['episode_box_background_color'][$FeedSlug];
        ?>
)' });
});
//-->
</script><?php 
    }
}
Exemplo n.º 3
0
function powerpress_admin_jquery_header($title, $jquery = false)
{
    $other = false;
    if ($jquery) {
        add_thickbox();
    }
    // we use the thckbox for some settings
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php 
    do_action('admin_xml_ns');
    ?>
 <?php 
    language_attributes();
    ?>
>
<head>
<meta http-equiv="Content-Type" content="<?php 
    bloginfo('html_type');
    ?>
; charset=<?php 
    echo get_option('blog_charset');
    ?>
" />
<title><?php 
    bloginfo('name');
    ?>
 &rsaquo; <?php 
    echo $title;
    ?>
 &#8212; <?php 
    echo __('WordPress', 'powerpress');
    ?>
</title>
<?php 
    // In case these functions haven't been included yet...
    require_once ABSPATH . 'wp-admin/includes/admin.php';
    wp_admin_css('css/global');
    wp_admin_css();
    if ($jquery) {
        wp_enqueue_script('utils');
    }
    do_action('admin_print_styles');
    do_action('admin_print_scripts');
    do_action('admin_head');
    echo '<!-- done adding extra stuff -->';
    ?>
<link rel="stylesheet" href="<?php 
    echo powerpress_get_root_url();
    ?>
css/jquery.css" type="text/css" media="screen" />
<?php 
    if ($other) {
        echo $other;
    }
    ?>
</head>
<body>
<div id="container">
<p style="text-align: right; position: absolute; top: 5px; right: 5px; margin: 0; padding: 0;"><a href="#" onclick="self.parent.tb_remove();" title="<?php 
    echo __('Cancel', 'powerpress');
    ?>
"><img src="<?php 
    echo admin_url();
    ?>
/images/no.png" /></a></p>
<?php 
}
Exemplo n.º 4
0
function powerpressplayer_build_simpleflash($media_url, $EpisodeData = array())
{
    $autoplay = false;
    if (isset($EpisodeData['autoplay']) && $EpisodeData['autoplay']) {
        $autoplay = true;
    }
    // TODO: We need to handle this
    $player_id = powerpressplayer_get_next_id();
    $content = '';
    $content .= '<div class="powerpress_player" id="powerpress_player_' . $player_id . '">';
    $content .= '<object type="application/x-shockwave-flash" data="' . powerpress_get_root_url() . 'simple_mp3.swf" id="simple_mp3_' . $player_id . '" width="150" height="50">';
    $content .= '<param name="movie" value="' . powerpress_get_root_url() . 'simple_mp3.swf" />';
    $content .= '<param name="wmode" value="transparent" />';
    $content .= '<param name="FlashVars" value="' . get_bloginfo('url') . '?url=' . urlencode($media_url) . '&amp;autostart=' . ($autoplay ? 'true' : 'false') . '" />';
    $content .= '<param name="quality" value="high" />';
    $content .= '<embed wmode="transparent" src="' . get_bloginfo('url') . '?url=' . urlencode($media_url) . '&amp;autostart=' . ($autoplay ? 'true' : 'false') . '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="150" height="50">';
    // $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData, true);  // Feature removed since it causes double players to be insrted in Safari/Firefox
    $content .= powerpressplayer_build_playimageaudio($media_url);
    $content .= '</embed>';
    $content .= '</object>';
    $content .= "</div>\n";
    return $content;
}
function powerpressadmin_edit_blubrry_services($General, $action_url = false, $action = false)
{
    $DisableStatsInDashboard = false;
    if (!empty($General['disable_dashboard_stats'])) {
        $DisableStatsInDashboard = true;
    }
    if ($action_url == false) {
        $action_url = admin_url('admin.php?action=powerpress-jquery-account');
    }
    if ($action == false) {
        $action = 'powerpress-jquery-account';
    }
    ?>
<h3><?php 
    echo __('Integrate Blubrry Services', 'powerpress');
    ?>
</h3>
<ul><li><ul>
	<li style="margin-left: 30px; font-size:115%;"><?php 
    echo sprintf(__('Track your podcast downloads with Blubrry\'s <a href="%s" target="_blank">FREE Basic Statistics</a> or <a href="%s" target="_blank">Professional Media Statistics</a>.', 'powerpress'), 'http://create.blubrry.com/resources/podcast-media-download-statistics/basic-statistics/', 'http://create.blubrry.com/resources/podcast-media-download-statistics/');
    ?>
</li>
	<li style="margin-left: 30px; font-size:115%;"><?php 
    echo sprintf(__('Upload and publish podcast media directly from your blog with <a href="%s" target="_blank">Blubrry Media Hosting</a>.', 'powerpress'), 'http://create.blubrry.com/resources/podcast-media-hosting/');
    ?>
</li>
</ul></li></ul>
<div style="margin-left: 40px;">
	<p style="font-size: 125%;">
		<strong><a class="button-primary thickbox" title="<?php 
    echo esc_attr(__('Blubrry Services Integration', 'powerpress'));
    ?>
" href="<?php 
    echo wp_nonce_url($action_url, $action);
    ?>
&amp;KeepThis=true&amp;TB_iframe=true&amp;width=600&amp;height=400&amp;modal=false" target="_blank"><?php 
    echo __('Click here to configure Blubrry Statistics and Hosting services', 'powerpress');
    ?>
</a></strong>
	</p>
	<?php 
    if (!empty($General['blubrry_program_keyword'])) {
        // Check that the redirect is in the settings...
        $RedirectURL = 'http://media.blubrry.com/' . $General['blubrry_program_keyword'] . '/';
        $Error = true;
        if (stripos($General['redirect1'], $RedirectURL) !== false) {
            $Error = false;
        } else {
            if (stripos($General['redirect2'], $RedirectURL) !== false) {
                $Error = false;
            } else {
                if (stripos($General['redirect3'], $RedirectURL) !== false) {
                    $Error = false;
                }
            }
        }
        if ($Error) {
            ?>
	<p style="font-weight: bold; color: #CC0000;">
	<?php 
            echo __('Statistics are not implemented correctly on this blog. Please click the button above to re-configure your services.', 'powerpress');
            ?>
	</p>
	<?php 
        } else {
            ?>
	<p style="font-weight: bold;">
	<img src="<?php 
            echo powerpress_get_root_url();
            ?>
images/Check.png" style="width: 25px; height: 20px;"  alt="<?php 
            echo __('Enabled!', 'powerpress');
            ?>
" />
	<?php 
            if (empty($General['blubrry_hosting']) || $General['blubrry_hosting'] === 'false') {
                echo __('Blubrry Statistics Enabled!', 'powerpress');
            } else {
                echo __('Blubrry Statistics and Media Hosting Enabled!', 'powerpress');
            }
            ?>
	</p>
	<?php 
        }
        if (empty($General['blubrry_hosting']) || $General['blubrry_hosting'] === 'false') {
            ?>
	<p>
	<?php 
            echo __('Recently upgraded to Blubrry Hosting?', 'powerpress');
            ?>
 
	<a class="thickbox" title="<?php 
            echo esc_attr(__('Blubrry Services Integration', 'powerpress'));
            ?>
" href="<?php 
            echo admin_url();
            echo wp_nonce_url("admin.php?action=powerpress-jquery-account", 'powerpress-jquery-account');
            ?>
&amp;KeepThis=true&amp;TB_iframe=true&amp;width=600&amp;height=400&amp;modal=false" target="_blank"><?php 
            echo __('Click here to enter your account information.', 'powerpress');
            ?>
</a>
	</p>
	<?php 
        }
    }
    ?>
</div>
<?php 
    if (empty($General['blubrry_hosting']) || $General['blubrry_hosting'] === 'false') {
        ?>
<div class="blubrry-services">
	<div class="blubrry-hosting">
		<p class="top-lines"><?php 
        echo __('Need a reliable host for your podcast media?', 'powerpress');
        ?>
</p>
		<p><?php 
        echo __('Blubrry Media Hosting packages start at $12.', 'powerpress');
        ?>
</p>
		<p><a href="http://create.blubrry.com/resources/podcast-media-hosting/" target="_blank"><?php 
        echo __('Learn More', 'powerpress');
        ?>
</a></p>
	</div>
	<div class="blubrry-stats">
		<p class="top-lines"><?php 
        echo __('Measure your audience for <strong>free</strong> and add more detailed', 'powerpress');
        ?>
</p>
		<p><?php 
        echo __('reporting for only $5 per month.', 'powerpress');
        ?>
</p>
		<p>&nbsp;</p>
		<p><a href="http://create.blubrry.com/resources/podcast-media-download-statistics/" target="_blank"><?php 
        echo __('Learn More', 'powerpress');
        ?>
</a></p>
	</div>
	<div class="clear"></div>
</div>
<?php 
    }
    // end not signed up for hosting
    ?>
<div style="margin-left: 40px;">
	<p style="margin-top: 10px;">
	<input name="DisableStatsInDashboard" type="checkbox" value="1"<?php 
    if ($DisableStatsInDashboard == true) {
        echo ' checked';
    }
    ?>
 />
	<?php 
    echo __('Remove Statistics from WordPress Dashboard', 'powerpress');
    ?>
</p>
</div>
<?php 
}
function powerpress_admin_players($type = 'audio')
{
    $General = powerpress_get_settings('powerpress_general');
    if (version_compare($GLOBALS['wp_version'], '3.6-beta', '<') && empty($General['player'])) {
        $General['player'] = 'default';
    } else {
        if (empty($General['player'])) {
            $General['player'] = 'mediaelement-audio';
        }
    }
    if (version_compare($GLOBALS['wp_version'], '3.6-beta', '<') && empty($General['player'])) {
        $General['video_player'] = '';
    } else {
        if (empty($General['video_player'])) {
            $General['video_player'] = 'mediaelement-video';
        }
    }
    if (empty($General['audio_custom_play_button'])) {
        $General['audio_custom_play_button'] = '';
    }
    $select_player = false;
    if (isset($_GET['sp'])) {
        $select_player = true;
    }
    if ($type == 'video') {
        if (!isset($General['video_player'])) {
            $select_player = true;
        }
    } else {
        if (!isset($General['player'])) {
            $select_player = true;
        }
    }
    $Audio = array();
    $Audio['default'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/FlowPlayerClassic.mp3';
    $Audio['audio-player'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/1_Pixel_Out_Flash_Player.mp3';
    $Audio['flashmp3-maxi'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/Flash_Maxi_Player.mp3';
    $Audio['simple_flash'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/Simple_Flash_MP3_Player.mp3';
    $Audio['audioplay'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/AudioPlay.mp3';
    $Audio['html5audio'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/html5.mp3';
    $Audio['mediaelement-audio'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/MediaElement_audio.mp3';
    $Video = array();
    $Video['flare-player'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/FlarePlayer.mp4';
    $Video['flow-player-classic'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/flow.mp4';
    $Video['html5video'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/html5.mp4';
    $Video['videojs-html5-video-player-for-wordpress'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/videojs.mp4';
    $Video['mediaelement-video'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/MediaElement_video.mp4';
    //$Video['mediaelement-video'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/videojs.mp4';
    /*
    <div><
    object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="30" height="30">
    <PARAM NAME=movie VALUE="http://www.strangecube.com/audioplay/online/audioplay.swf?file=http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/AudioPlay.mp3&auto=no&sendstop=yes&repeat=1&buttondir=http://www.strangecube.com/audioplay/online/alpha_buttons/negative&bgcolor=0xffffff&mode=playpause"><PARAM NAME=quality VALUE=high><PARAM NAME=wmode VALUE=transparent><embed src="http://www.strangecube.com/audioplay/online/audioplay.swf?file=http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/AudioPlay.mp3&auto=no&sendstop=yes&repeat=1&buttondir=http://www.strangecube.com/audioplay/online/alpha_buttons/negative&bgcolor=0xffffff&mode=playpause" quality=high wmode=transparent width="30" height="30" align="" TYPE="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object></div><!-- End of generated code -->
    */
    if ($type == 'video' && function_exists('add_videojs_header')) {
        add_videojs_header();
    }
    ?>
<link rel="stylesheet" href="<?php 
    echo powerpress_get_root_url();
    ?>
3rdparty/colorpicker/css/colorpicker.css" type="text/css" />
<script type="text/javascript" src="<?php 
    echo powerpress_get_root_url();
    ?>
3rdparty/colorpicker/js/colorpicker.js"></script>
<script type="text/javascript" src="<?php 
    echo powerpress_get_root_url();
    ?>
player.min.js"></script>
<script type="text/javascript"><!--

powerpress_url = '<?php 
    echo powerpress_get_root_url();
    ?>
';

function rgb2hex(rgb) {
 
 rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
 function hex(x) {
  hexDigits = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
  return isNaN(x) ? "00" : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16];
 }
 
 if( rgb )
	return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
 return '';
}

function UpdatePlayerPreview(name, value)
{
	if( typeof(generator) != "undefined" ) // Update the Maxi player...
	{
		generator.updateParam(name, value);
		generator.updatePlayer();
	}
	
	if( typeof(update_audio_player) != "undefined" ) // Update the 1 px out player...
		update_audio_player();
}
				
jQuery(document).ready(function($) {
	
	jQuery('.color_preview').ColorPicker({
		onSubmit: function(hsb, hex, rgb, el) {
			jQuery(el).css({ 'background-color' : '#' + hex });
			jQuery(el).ColorPickerHide();
			var Id = jQuery(el).attr('id');
			Id = Id.replace(/_prev/, '');
			jQuery('#'+ Id  ).val( '#' + hex );
			UpdatePlayerPreview(Id, '#'+hex );
		},
		onBeforeShow: function () {
			jQuery(this).ColorPickerSetColor( rgb2hex( jQuery(this).css("background-color") ) );
		}
	})
	.bind('keyup', function(){
		jQuery(this).ColorPickerSetColor( rgb2hex( jQuery(this).css("background-color") ) );
	});
	
	jQuery('.color_field').bind('change', function () {
		var Id = jQuery(this).attr('id');
		jQuery('#'+ Id + '_prev'  ).css( { 'background-color' : jQuery(this).val() } );
		if( typeof(update_audio_player) != "undefined" ) // Update the 1 px out player...
			update_audio_player();
	});
	
	jQuery('.other_field').bind('change', function () {
		if( typeof(update_audio_player) != "undefined" ) // Update the 1 px out player...
			update_audio_player();
	});

});
//-->
</script>


<!-- special page styling goes here -->
<style type="text/css">
div.color_control { display: block; float:left; width: 100%; padding:  0; }
div.color_control input { display: inline; float: left; }
div.color_control div.color_picker { display: inline; float: left; margin-top: 3px; }
#player_preview { margin-bottom: 0px; height: 50px; margin-top: 8px;}
input#colorpicker-value-input {
	width: 60px;
	height: 16px;
	padding: 0;
	margin: 0;
	font-size: 12px;
	border-spacing: 0;
	border-width: 0;
}
table.html5formats {
	width: 600px;
	margin: 0;
	padding: 0;
}
table.html5formats tr {
	margin: 0;
	padding: 0;
}
table.html5formats tr th {
	font-weight: bold;
	border-bottom: 1px solid #000000;
	margin: 0;
	padding: 0 5px;
	width: 25%;
}
table.html5formats tr td {
	
	border-right: 1px solid #000000;
	border-bottom: 1px solid #000000;
	margin: 0;
	padding: 0 10px;
}
table.html5formats tr > td:first-child {
	border-left: 1px solid #000000;
}
</style>
<?php 
    // mainly 2 pages, first page selects a player, second configures the player, if there are optiosn to configure for that player. If the user is on the second page,
    // a link should be provided to select a different player.
    if ($select_player) {
        ?>
<input type="hidden" name="action" value="powerpress-select-player" />
<h2><?php 
        echo __('Blubrry PowerPress Player Options', 'powerpress');
        ?>
</h2>
<p style="margin-bottom: 0;"><?php 
        echo __('Select the media player you would like to use.', 'powerpress');
        ?>
</p>

<?php 
        if ($type == 'video') {
            ?>
<table class="form-table">
<tr valign="top">
<th scope="row">&nbsp;</th>  
<td>
	<ul>
<?php 
            if (version_compare($GLOBALS['wp_version'], '3.6-alpha', '>')) {
                ?>
		<li><label><input type="radio" name="VideoPlayer[video_player]" id="player_mediaelement_video" value="mediaelement-video" <?php 
                if ($General['video_player'] == 'mediaelement-video') {
                    echo 'checked';
                }
                ?>
 />
		<?php 
                echo __('MediaElement.js Media Player (default)', 'powerpress');
                ?>
</label> <?php 
                echo powerpressadmin_new();
                ?>
			 <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_mediaelement_video" class="activate-player"><?php 
                echo __('Activate and Configure Now', 'powerpress');
                ?>
</a></strong>
		</li>
		<li style="margin-left: 30px; margin-bottom:16px;">
			<p>
<?php 
                echo powerpressplayer_build_mediaelementvideo($Video['mediaelement-video']);
                ?>
			</p>
			<?php 
                powerpressplayer_mediaelement_info();
                ?>
		</li>
<?php 
            }
            ?>
		<li><label><input type="radio" name="VideoPlayer[video_player]" id="player_flow_player_classic_player" value="flow-player-classic" <?php 
            if ($General['video_player'] == 'flow-player-classic') {
                echo 'checked';
            }
            ?>
 />
		<?php 
            echo __('Flow Player Classic', 'powerpress');
            ?>
</label>
			 <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_flow_player_classic_player" class="activate-player"><?php 
            echo __('Activate and Configure Now', 'powerpress');
            ?>
</a></strong>
		</li>
		<li style="margin-left: 30px; margin-bottom:16px;">
			<p>
<?php 
            echo powerpressplayer_build_flowplayerclassic($Video['flow-player-classic']);
            ?>
			</p>
<?php 
            powerpressplayer_flowplayer_info();
            ?>
		</li>
		
		<li><label><input type="radio" name="VideoPlayer[video_player]" id="player_html5video" value="html5video" <?php 
            if ($General['video_player'] == 'html5video') {
                echo 'checked';
            }
            ?>
 /> <?php 
            echo __('HTML5 Video Player', 'powerpress');
            ?>
  </label>
			<strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_html5video" class="activate-player"><?php 
            echo __('Activate and Configure Now', 'powerpress');
            ?>
</a></strong>
		</li>
		<li style="margin-left: 30px; margin-bottom:16px;">
			<p>
            <?php 
            echo powerpressplayer_build_html5video($Video['html5video']);
            ?>
			</p>
			<p>
				<?php 
            echo __('HTML5 Video is an element introduced in the latest HTML specification (HTML5) for the purpose of playing videos.', 'powerpress');
            ?>
			</p>
			<p>
				<?php 
            echo __('HTML5 Video Player is not format specific. See table below for a list of browsers and supported formats.', 'powerpress');
            ?>
			</p>
			<table class="html5formats" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<th><?php 
            echo __('Browser', 'powerpress');
            ?>
</th>
					<th>H.264 (.mp4/.m4v)</th>
					<th>WebM (.webm)</th>
					<th>Theora (.ogg/.ogv)</th>
				</tr>
				<tr>
					<td><i><?php 
            echo __('Internet Explorer', 'powerpress');
            ?>
</i></td>
					<td><strong>9.0+</strong></td>
					<td>-</td>
					<td>-</td>
				</tr>
				<tr>
					<td><i><?php 
            echo __('Firefox', 'powerpress');
            ?>
</i></td>
					<td><strong>22.0+</strong></td>
					<td><strong>4.0+</strong></td>
					<td><strong>3.5+</strong></td>
				</tr>
				<tr>
					<td><i><?php 
            echo __('Chrome', 'powerpress');
            ?>
 <sup>1</sup></i></td>
					<td>-</td>
					<td><strong>6.0+</strong></td>
					<td><strong>5.0+</strong></td>
				</tr>
				<tr>
					<td><i><?php 
            echo __('Opera', 'powerpress');
            ?>
</i></td>
					<td>-</td>
					<td><strong>10.6+</strong></td>
					<td><strong>10.5+</strong></td>
				</tr>
				<tr>
					<td><i><?php 
            echo __('Safari', 'powerpress');
            ?>
 <sup>2</sup></i></td>
					<td><strong>3.0+</strong></td>
					<td>-</td>
					<td>-</td>
				</tr>
			</table>
			<div><sup>1</sup> <?php 
            echo __('Chrome supported H.264 in previous versions, but no longer supports the format.', 'powerpress');
            ?>
</div>
			<div><sup>2</sup> <?php 
            echo __('Safari requires QuickTime installed for HTML5 playback.', 'powerpress');
            ?>
</div>
			<p>
				<?php 
            echo __('Flow Player Classic is used when HTML5 support is not available.', 'powerpress');
            ?>
			</p>
		</li>
		
		<!-- videojs-html5-video-player-for-wordpress -->
		<li><label><input type="radio" name="VideoPlayer[video_player]" id="player_videojs_html5_video_player_for_wordpress" value="videojs-html5-video-player-for-wordpress" <?php 
            if ($General['video_player'] == 'videojs-html5-video-player-for-wordpress') {
                echo 'checked';
            }
            ?>
 <?php 
            echo function_exists('add_videojs_header') ? '' : 'disabled';
            ?>
 />
		<?php 
            echo __('VideoJS', 'powerpress');
            ?>
</label> <?php 
            echo powerpressadmin_new();
            ?>
		<?php 
            if (function_exists('add_videojs_header')) {
                ?>
			 <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_videojs_html5_video_player_for_wordpress" class="activate-player"><?php 
                echo __('Activate and Configure Now', 'powerpress');
                ?>
</a></strong>
		<?php 
            }
            ?>
		</li>
		<li style="margin-left: 30px; margin-bottom:16px;">
			<p>
<?php 
            if (function_exists('add_videojs_header')) {
                echo powerpressplayer_build_videojs($Video['videojs-html5-video-player-for-wordpress']);
            }
            ?>
			</p>
<?php 
            powerpressplayer_videojs_info();
            ?>
		</li>
		
		
		
	</ul>

</td>
</tr>
</table>
<?php 
        } else {
            ?>
<table class="form-table">
<tr valign="top">
<th scope="row">&nbsp;</th>  
<td>
	<ul>

<?php 
            if (version_compare($GLOBALS['wp_version'], '3.6-alpha', '>')) {
                ?>
		<li><label><input type="radio" name="Player[player]" id="player_mediaelement_audio" value="mediaelement-audio" <?php 
                if ($General['player'] == 'mediaelement-audio') {
                    echo 'checked';
                }
                ?>
 />
		<?php 
                echo __('MediaElement.js Media Player (default)', 'powerpress');
                ?>
</label> <?php 
                echo powerpressadmin_new();
                ?>
			 <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_mediaelement_audio" class="activate-player"><?php 
                echo __('Activate and Configure Now', 'powerpress');
                ?>
</a></strong>
		</li>
		<li style="margin-left: 30px; margin-bottom:16px;">
			<p>
<?php 
                echo powerpressplayer_build_mediaelementaudio($Audio['mediaelement-audio']);
                ?>
			</p>
			<?php 
                powerpressplayer_mediaelement_info();
                ?>
		</li>
<?php 
            }
            ?>

		<li><label><input type="radio" name="Player[player]" id="player_default" value="default" <?php 
            if ($General['player'] == 'default') {
                echo 'checked';
            }
            ?>
 />
		<?php 
            echo __('Flow Player Classic', 'powerpress');
            ?>
</label>
			 <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_default" class="activate-player"><?php 
            echo __('Activate and Configure Now', 'powerpress');
            ?>
</a></strong>
		</li>
		<li style="margin-left: 30px; margin-bottom:16px;">
			<p>
<?php 
            echo powerpressplayer_build_flowplayerclassic($Audio['default']);
            ?>
			</p>
			<?php 
            powerpressplayer_flowplayer_info();
            ?>
		</li>
		
		<li><label><input type="radio" name="Player[player]" id="player_audio_player" value="audio-player" <?php 
            if ($General['player'] == 'audio-player') {
                echo 'checked';
            }
            ?>
 /> <?php 
            echo __('1 Pixel Out Audio Player', 'powerpress');
            ?>
</label>
			<strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_audio_player" class="activate-player"><?php 
            echo __('Activate and Configure Now', 'powerpress');
            ?>
</a></strong>
		</li>
		<li style="margin-left: 30px; margin-bottom:16px;">
			<p>
				<?php 
            echo powerpressplayer_build_1pxoutplayer($Audio['audio-player']);
            ?>
			</p>
			<p>
				<?php 
            echo __('1 Pixel Out Audio Player is a popular customizable audio (mp3 only) flash player. Features include an animated play/pause button, scroll-able position bar, elapsed/remaining time, volume control and color styling options.', 'powerpress');
            ?>
			</p>
		</li>
		
		<li><label><input type="radio" name="Player[player]" id="player_html5audio" value="html5audio" <?php 
            if ($General['player'] == 'html5audio') {
                echo 'checked';
            }
            ?>
 /> <?php 
            echo __('HTML5 Audio Player', 'powerpress');
            ?>
  </label>
			<strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_html5audio" class="activate-player"><?php 
            echo __('Activate and Configure Now', 'powerpress');
            ?>
</a></strong>
		</li>
		<li style="margin-left: 30px; margin-bottom:16px;">
			<p>
			<?php 
            echo powerpressplayer_build_html5audio($Audio['html5audio']);
            ?>
			</p>
			<p>
				<?php 
            echo __('HTML5 audio is an element introduced in the latest HTML specification (HTML5) for the purpose of playing audio.', 'powerpress');
            ?>
			</p>
			<p>
				<?php 
            echo __('HTML5 Audio Player is not format specific. See table below for a list of browsers and supported formats.', 'powerpress');
            ?>
			</p>
			<table class="html5formats" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<th><?php 
            echo __('Browser', 'powerpress');
            ?>
</th>
					<th>Mpeg3 (.mp3)</th>
					<th>AAC (.m4a)</th>
					<th>Vorbis (.ogg/.oga)</th>
				</tr>
				<tr>
					<td><i><?php 
            echo __('Internet Explorer', 'powerpress');
            ?>
</i></td>
					<td><strong>9.0+</strong></td>
					<td><strong>9.0+</strong></td>
					<td>-</td>
				</tr>
				<tr>
					<td><i><?php 
            echo __('Firefox', 'powerpress');
            ?>
</i></td>
					<td><strong>26.0+</strong></td>
					<td>-</td>
					<td><strong>3.5+</strong></td>
				</tr>
				<tr>
					<td><i><?php 
            echo __('Chrome', 'powerpress');
            ?>
 <sup>1</sup></i></td>
					<td><strong>5.0+</strong></td>
					<td>-</td>
					<td><strong>5.0+</strong></td>
				</tr>
				<tr>
					<td><i><?php 
            echo __('Opera', 'powerpress');
            ?>
</i></td>
					<td>-</td>
					<td>-</td>
					<td><strong>10.5+</strong></td>
				</tr>
				<tr>
					<td><i><?php 
            echo __('Safari', 'powerpress');
            ?>
 <sup>2</sup></i></td>
					<td><strong>3.0+</strong></td>
					<td><strong>3.0+</strong></td>
					<td>-</td>
				</tr>
			</table>
			<div><sup>1</sup> <?php 
            echo __('Chrome supported AAC in previous versions, but no longer supports the format.', 'powerpress');
            ?>
</div>
			<div><sup>2</sup> <?php 
            echo __('Safari requires QuickTime installed for HTML5 playback.', 'powerpress');
            ?>
</div>
			<p>
				<?php 
            echo __('Flow Player Classic is used when HTML5 support is not available.', 'powerpress');
            ?>
			</p>
		</li>
		
		<li>
			<div class="updated fade powerpress-notice inline">
			<?php 
            echo __('NOTICE: Due to limited use, the players below (Mp3 Player Maxi, Simple Flash MP3 Player, and AudioPlay) will be moved to a separate plugin starting with PowerPress version 6.0.', 'powerpress');
            ?>
			</div>
		</li>
		
		<li><label><input type="radio" name="Player[player]" id="player_flashmp3_maxi" value="flashmp3-maxi" <?php 
            if ($General['player'] == 'flashmp3-maxi') {
                echo 'checked';
            }
            ?>
 /> <?php 
            echo __('Mp3 Player Maxi', 'powerpress');
            ?>
</label>
			<strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_flashmp3_maxi" class="activate-player"><?php 
            echo __('Activate and Configure Now', 'powerpress');
            ?>
</a></strong>
		</li>
		<li style="margin-left: 30px; margin-bottom:16px;">
			<p>
				<?php 
            echo powerpressplayer_build_flashmp3maxi($Audio['flashmp3-maxi']);
            ?>
			</p>
			<p>
				<?php 
            echo __('Flash Mp3 Maxi Player is a customizable open source audio (mp3 only) flash player. Features include pause/play/stop/file info buttons, scroll-able position bar, volume control and color styling options.', 'powerpress');
            ?>
			</p>
		</li>
		
		<li><label><input type="radio" name="Player[player]" id="player_simple_flash" value="simple_flash" <?php 
            if ($General['player'] == 'simple_flash') {
                echo 'checked';
            }
            ?>
 /> <?php 
            echo __('Simple Flash MP3 Player', 'powerpress');
            ?>
</label>
			<strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_simple_flash" class="activate-player"><?php 
            echo __('Activate and Configure Now', 'powerpress');
            ?>
</a></strong>
		</li>
		<li style="margin-left: 30px; margin-bottom:16px;">
			<p>
			<?php 
            echo powerpressplayer_build_simpleflash($Audio['simple_flash']);
            ?>
			</p>
			<p>
				<?php 
            echo __('Simple Flash MP3 Player is a free and simple audio (mp3 only) flash player. Features include play/pause and stop buttons.', 'powerpress');
            ?>
			</p>
		</li>
		
		<li><label><input type="radio" name="Player[player]" id="player_audioplay" value="audioplay" <?php 
            if ($General['player'] == 'audioplay') {
                echo 'checked';
            }
            ?>
 /> <?php 
            echo __('AudioPlay', 'powerpress');
            ?>
</label>
			<strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_audioplay" class="activate-player"><?php 
            echo __('Activate and Configure Now', 'powerpress');
            ?>
</a></strong>
		</li>
		<li style="margin-left: 30px; margin-bottom:16px;">
			<p>
			<?php 
            echo powerpressplayer_build_audioplay($Audio['audioplay']);
            ?>
			</p>
			<p>
				<?php 
            echo __('AudioPlay is one button freeware audio (mp3 only) flash player. Features include a play/stop or play/pause button available in two sizes in either black or white.', 'powerpress');
            ?>
			</p>
		</li>
		
	</ul>

</td>
</tr>
</table>
<?php 
        }
        ?>
<h4 style="margin-bottom: 0;"><?php 
        echo __('Click \'Save Changes\' to activate and configure selected player.', 'powerpress');
        ?>
</h4>
<?php 
    } else {
        ?>
<h2><?php 
        echo __('Configure Player', 'powerpress');
        ?>
</h2>
<?php 
        if ($type == 'audio') {
            ?>
<p style="margin-bottom: 20px;"><strong><a href="<?php 
            echo admin_url("admin.php?page=powerpress/powerpressadmin_player.php&amp;sp=1");
            ?>
"><?php 
            echo __('Select a different audio player', 'powerpress');
            ?>
</a></strong></p>
<?php 
        } else {
            ?>
<p style="margin-bottom: 20px;"><strong><a href="<?php 
            echo admin_url("admin.php?page=powerpress/powerpressadmin_videoplayer.php&amp;sp=1");
            ?>
"><?php 
            echo __('Select a different video player', 'powerpress');
            ?>
</a></strong></p>
<?php 
        }
        // Start adding logic here to display options based on the player selected...
        if ($type == 'audio') {
            switch ($General['player']) {
                case 'audio-player':
                    $PlayerSettings = powerpress_get_settings('powerpress_audio-player');
                    if ($PlayerSettings == "") {
                        $PlayerSettings = array('width' => '290', 'transparentpagebg' => 'yes', 'lefticon' => '#333333', 'leftbg' => '#CCCCCC', 'bg' => '#E5E5E5', 'voltrack' => '#F2F2F2', 'volslider' => '#666666', 'rightbg' => '#B4B4B4', 'rightbghover' => '#999999', 'righticon' => '#333333', 'righticonhover' => '#FFFFFF', 'loader' => '#009900', 'track' => '#FFFFFF', 'tracker' => '#DDDDDD', 'border' => '#CCCCCC', 'skip' => '#666666', 'text' => '#333333', 'pagebg' => '', 'rtl' => 'no', 'initialvolume' => '60', 'animation' => 'yes', 'remaining' => 'no');
                    }
                    if (empty($PlayerSettings['remaining'])) {
                        $PlayerSettings['remaining'] = 'no';
                    }
                    // New default setting
                    if (!isset($PlayerSettings['buffer'])) {
                        $PlayerSettings['buffer'] = '';
                    }
                    // New default setting
                    if (!isset($PlayerSettings['titles'])) {
                        $PlayerSettings['titles'] = '';
                    }
                    ?>
<script type="text/javascript"><!--

function update_audio_player()
{
	var myParams = new Array("lefticon","leftbg", "bg", "voltrack", "rightbg", "rightbghover", "righticon", "righticonhover", "loader", "track", "tracker", "border", "skip", "text", "pagebg", "rtl", "animation", "titles", "initialvolume");
	var myWidth = document.getElementById('player_width').value;
	var myBackground = '';
	if( myWidth < 10 || myWidth > 900 )
		myWidth = 290;
	
	var out = '<object type="application/x-shockwave-flash" data="<?php 
                    echo powerpress_get_root_url();
                    ?>
/audio-player.swf" width="'+myWidth+'" height="24">'+"\n";
	out += '    <param name="movie" value="<?php 
                    echo powerpress_get_root_url();
                    ?>
/audio-player.swf" />'+"\n";
	out += '    <param name="FlashVars" value="playerID=1&amp;soundFile=<?php 
                    echo $Audio['audio-player'];
                    ?>
';
	
	var x = 0;
	for( x = 0; x < myParams.length; x++ )
	{
		if( myParams[ x ] == 'border' )
			var Element = document.getElementById( 'player_border' );
		else
			var Element = document.getElementById( myParams[ x ] );
		
		if( Element )
		{
			if( Element.value != '' )
			{
				out += '&amp;';
				out += myParams[ x ];
				out += '=';
				out += Element.value.replace(/^#/, '');
				if( myParams[ x ] == 'pagebg' )
				{
					myBackground = '<param name="bgcolor" value="'+ Element.value +'" />';
					out += '&amp;transparentpagebg=no';
				}
			}
			else
			{
				if( myParams[ x ] == 'pagebg' )
				{
					out += '&amp;transparentpagebg=yes';
					myBackground = '<param name="wmode" value="transparent" />';
				}
			}
		}
	}
	
	out += '" />'+"\n";
	out += '<param name="quality" value="high" />';
	out += '<param name="menu" value="false" />';
	out += myBackground;
	out += '</object>';
	
	var player = document.getElementById("player_preview");
	player.innerHTML = out;
}

function audio_player_defaults()
{
 	if( confirm('<?php 
                    echo __("Set defaults, are you sure?\\n\\nAll of the current settings will be overwritten!", 'powerpress');
                    ?>
') )
	{
		jQuery('#player_width').val('290');
		UpdatePlayerPreview('player_width',jQuery('#player_width').val() );
		
		jQuery('#transparentpagebg').val( 'yes');
		UpdatePlayerPreview('transparentpagebg',jQuery('#transparentpagebg').val() );
		
		jQuery('#lefticon').val( '#333333');
		UpdatePlayerPreview('lefticon',jQuery('#lefticon').val() );
		jQuery('#lefticon_prev'  ).css( { 'background-color' : '#333333' } );
		
		jQuery('#leftbg').val( '#CCCCCC');
		UpdatePlayerPreview('leftbg',jQuery('#leftbg').val() );
		jQuery('#leftbg_prev'  ).css( { 'background-color' : '#CCCCCC' } );
		
		jQuery('#bg').val( '#E5E5E5');
		UpdatePlayerPreview('bg',jQuery('#bg').val() );
		jQuery('#bg_prev'  ).css( { 'background-color' : '#E5E5E5' } );
		
		jQuery('#voltrack').val( '#F2F2F2');
		UpdatePlayerPreview('voltrack',jQuery('#voltrack').val() );
		jQuery('#voltrack_prev'  ).css( { 'background-color' : '#F2F2F2' } );
		
		jQuery('#volslider').val( '#666666');
		UpdatePlayerPreview('volslider',jQuery('#volslider').val() );
		jQuery('#volslider_prev'  ).css( { 'background-color' : '#666666' } );
		
		jQuery('#rightbg').val( '#B4B4B4');
		UpdatePlayerPreview('rightbg',jQuery('#rightbg').val() );
		jQuery('#rightbg_prev'  ).css( { 'background-color' : '#B4B4B4' } );
		
		jQuery('#rightbghover').val( '#999999');
		UpdatePlayerPreview('rightbghover',jQuery('#rightbghover').val() );
		jQuery('#rightbghover_prev'  ).css( { 'background-color' : '#999999' } );
		
		jQuery('#righticon').val( '#333333');
		UpdatePlayerPreview('righticon',jQuery('#righticon').val() );
		jQuery('#righticon_prev'  ).css( { 'background-color' : '#333333' } );
		
		jQuery('#righticonhover').val( '#FFFFFF');
		UpdatePlayerPreview('righticonhover',jQuery('#righticonhover').val() );
		jQuery('#righticonhover_prev'  ).css( { 'background-color' : '#FFFFFF' } );
		
		jQuery('#loader').val( '#009900');
		UpdatePlayerPreview('loader',jQuery('#loader').val() );
		jQuery('#loader_prev'  ).css( { 'background-color' : '#009900' } );
		
		jQuery('#track').val( '#FFFFFF');
		UpdatePlayerPreview('track',jQuery('#track').val() );
		jQuery('#track_prev'  ).css( { 'background-color' : '#FFFFFF' } );
		
		jQuery('#tracker').val( '#DDDDDD');
		UpdatePlayerPreview('tracker',jQuery('#tracker').val() );
		jQuery('#tracker_prev'  ).css( { 'background-color' : '#DDDDDD' } );
		
		jQuery('#player_border').val( '#CCCCCC');
		UpdatePlayerPreview('player_border',jQuery('#player_border').val() );
		jQuery('#player_border_prev'  ).css( { 'background-color' : '#CCCCCC' } );
		
		jQuery('#skip').val( '#666666');
		UpdatePlayerPreview('skip',jQuery('#skip').val() );
		jQuery('#skip_prev'  ).css( { 'background-color' : '#666666' } );
		
		jQuery('#text').val( '#333333');
		UpdatePlayerPreview('text',jQuery('#text').val() );
		jQuery('#text_prev'  ).css( { 'background-color' : '#333333' } );
		
		jQuery('#pagebg').val( '');
		UpdatePlayerPreview('pagebg',jQuery('#pagebg').val() );
		
		jQuery('#animation').val( 'yes');
		UpdatePlayerPreview('animation',jQuery('#animation').val() );
		
		jQuery('#remaining').val( 'no');
		UpdatePlayerPreview('remaining',jQuery('#remaining').val() );
		
		jQuery('#buffer').val( '');
		UpdatePlayerPreview('buffer',jQuery('#buffer').val() );
		
		jQuery('#rtl' ).val( 'no' );
		UpdatePlayerPreview('rtl',jQuery('#rtl').val() );
		
		jQuery('#initialvolume').val('60');
		UpdatePlayerPreview('initialvolume',jQuery('#initialvolume').val() );
		
		update_audio_player();
	}
}
//-->
</script>
	<input type="hidden" name="action" value="powerpress-audio-player" />
	<?php 
                    echo __('Configure the 1 pixel out Audio Player', 'powerpress');
                    ?>
	
	
<table class="form-table">
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Preview of Player', 'powerpress');
                    ?>
		</th>
		<td><div id="player_preview">
		<?php 
                    echo powerpressplayer_build_1pxoutplayer($Audio['audio-player'], array('nodiv' => true));
                    ?>
			</div>
		</td>
	</tr>
</table>

<div id="powerpress_settings_page" class="powerpress_tabbed_content" style="position: relative;">
	<div style="position: absolute; top: 6px; right:0px;">
		<a href="#" onclick="audio_player_defaults();return false;"><?php 
                    echo __('Set Defaults', 'powerpress');
                    ?>
</a>
	</div>
  <ul class="powerpress_settings_tabs"> 
		<li><a href="#tab_general"><span><?php 
                    echo __('Basic Settings', 'powerpress');
                    ?>
</span></a></li> 
		<li><a href="#tab_progress"><span><?php 
                    echo __('Progress Bar', 'powerpress');
                    ?>
</span></a></li> 
		<li><a href="#tab_volume"><span><?php 
                    echo __('Volume Button', 'powerpress');
                    ?>
</span></a></li>
		<li><a href="#tab_play"><span><?php 
                    echo __('Play / Pause Button', 'powerpress');
                    ?>
</span></a></li>
  </ul>
	
 <div id="tab_general" class="powerpress_tab">
 <h3><?php 
                    echo __('General Settings', 'powerpress');
                    ?>
</h3>
<table class="form-table">
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Page Background Color', 'powerpress');
                    ?>
                        
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="pagebg" name="Player[pagebg]" class="color_field" value="<?php 
                    echo $PlayerSettings['pagebg'];
                    ?>
" maxlength="20" />
				<img id="pagebg_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['pagebg'];
                    ?>
;" class="color_preview" />
			</div>
			<small>(<?php 
                    echo __('leave blank for transparent', 'powerpress');
                    ?>
)</small>
		</td>
	</tr>	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Player Background Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="bg" name="Player[bg]" class="color_field" value="<?php 
                    echo $PlayerSettings['bg'];
                    ?>
" maxlength="20" />
				<img id="bg_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['bg'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Width (in pixels)', 'powerpress');
                    ?>
		</th>
		<td>
          <input type="text" style="width: 50px;" id="player_width" name="Player[width]" class="other_field" value="<?php 
                    echo $PlayerSettings['width'];
                    ?>
" maxlength="20" />
				<?php 
                    echo __('width of the player. e.g. 290 (290 pixels) or 100%', 'powerpress');
                    ?>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Right-to-Left', 'powerpress');
                    ?>
		</th>
		<td>
			<select style="width: 102px;" id="rtl" name="Player[rtl]" class="other_field"> 
<?php 
                    $options = array('yes' => __('Yes', 'powerpress'), 'no' => __('No', 'powerpress'));
                    powerpress_print_options($options, $PlayerSettings['rtl']);
                    ?>
          </select>			<?php 
                    echo __('switches the layout to animate from the right to the left', 'powerpress');
                    ?>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Loading Bar Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="loader" name="Player[loader]" class="color_field" value="<?php 
                    echo $PlayerSettings['loader'];
                    ?>
" maxlength="20" />
				<img id="loader_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['loader'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Text Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
                <input type="text" style="width: 100px;" id="text" name="Player[text]" class="color_field" value="<?php 
                    echo $PlayerSettings['text'];
                    ?>
" maxlength="20" />
						<img id="text_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['text'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Text In Player', 'powerpress');
                    ?>
 
		</th>
		<td>
          <div><input type="text" style="width: 60%;" id="titles" name="Player[titles]" class="other_field" value="<?php 
                    echo $PlayerSettings['titles'];
                    ?>
" maxlength="100" /></div>
				<small><?php 
                    echo sprintf(__('Enter \'%s\' to display track name from mp3. Only works if media is hosted on same server as blog.', 'powerpress'), __('TRACK', 'powerpress'));
                    ?>
</small>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Play Animation', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
<select style="width: 102px;" id="animation" name="Player[animation]" class="other_field"> 
<?php 
                    $options = array('yes' => __('Yes', 'powerpress'), 'no' => __('No', 'powerpress'));
                    powerpress_print_options($options, $PlayerSettings['animation']);
                    ?>
                                </select>			<?php 
                    echo __('if no, player is always open', 'powerpress');
                    ?>
</div>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Display Remaining Time', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
<select style="width: 102px;" id="remaining" name="Player[remaining]" class="other_field">
<?php 
                    $options = array('yes' => __('Yes', 'powerpress'), 'no' => __('No', 'powerpress'));
                    powerpress_print_options($options, $PlayerSettings['remaining']);
                    ?>
                                </select>			<?php 
                    echo __('if yes, shows remaining track time rather than elapsed time (default: no)', 'powerpress');
                    ?>
</div>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Buffering Time', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
<select style="width: 200px;" id="buffer" name="Player[buffer]" class="other_field"> 
<?php 
                    $options = array('0' => __('No buffering', 'powerpress'), '' => __('Default (5 seconds)', 'powerpress'), '10' => __('10 seconds', 'powerpress'), '15' => __('15 seconds', 'powerpress'), '20' => __('20 seconds', 'powerpress'), '30' => __('30 seconds', 'powerpress'), '60' => __('60 seconds', 'powerpress'));
                    powerpress_print_options($options, $PlayerSettings['buffer']);
                    ?>
                                </select>		<?php 
                    echo __('buffering time in seconds', 'powerpress');
                    ?>
</div>
		</td>
	</tr>
	
	
</table>
</div>

 <div id="tab_progress" class="powerpress_tab">
	<h3><?php 
                    echo __('Progress Bar', 'powerpress');
                    ?>
</h3>
<table class="form-table">
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Progress Bar Background', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
										<input type="text" style="width: 100px;" id="track" name="Player[track]" class="color_field" value="<?php 
                    echo $PlayerSettings['track'];
                    ?>
" maxlength="20" />
										<img id="track_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['track'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Progress Bar Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
                            <input type="text" style="width: 100px;" id="tracker" name="Player[tracker]" class="color_field" value="<?php 
                    echo $PlayerSettings['tracker'];
                    ?>
" maxlength="20" />
											<img id="tracker_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['tracker'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Progress Bar Border', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
                            <input type="text" style="width: 100px;" id="player_border" name="Player[border]" class="color_field" value="<?php 
                    echo $PlayerSettings['border'];
                    ?>
" maxlength="20" />
											<img id="player_border_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['border'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>       
	</table>
	</div>
	
	
<div id="tab_volume" class="powerpress_tab">
	<h3><?php 
                    echo __('Volume Button Settings', 'powerpress');
                    ?>
</h3>
	<table class="form-table">	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Initial Volume', 'powerpress');
                    ?>
 
		</th>
		<td>
			<select style="width: 100px;" id="initialvolume" name="Player[initialvolume]" class="other_field">
<?php 
                    for ($x = 0; $x <= 100; $x += 5) {
                        echo '<option value="' . $x . '"' . ($PlayerSettings['initialvolume'] == $x ? ' selected' : '') . '>' . $x . '%</option>';
                    }
                    ?>
			</select> <?php 
                    echo __('initial volume level (default: 60)', 'powerpress');
                    ?>
		</td>
	</tr>
				
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Volumn Background Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="leftbg" name="Player[leftbg]" class="color_field" value="<?php 
                    echo $PlayerSettings['leftbg'];
                    ?>
" maxlength="20" />
				<img id="leftbg_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['leftbg'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Speaker Icon Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="lefticon" name="Player[lefticon]" class="color_field" value="<?php 
                    echo $PlayerSettings['lefticon'];
                    ?>
" maxlength="20" />
				<img id="lefticon_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['lefticon'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Volume Icon Background', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="voltrack" name="Player[voltrack]" class="color_field" value="<?php 
                    echo $PlayerSettings['voltrack'];
                    ?>
" maxlength="20" />
				<img id="voltrack_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['voltrack'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Volume Slider Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="volslider" name="Player[volslider]" class="color_field" value="<?php 
                    echo $PlayerSettings['volslider'];
                    ?>
" maxlength="20" />
				<img id="volslider_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['volslider'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
</table>
</div>

<div id="tab_play" class="powerpress_tab">
	<h3><?php 
                    echo __('Play / Pause Button Settings', 'powerpress');
                    ?>
</h3>
	<table class="form-table">	
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Play/Pause Background Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="rightbg" name="Player[rightbg]" class="color_field" value="<?php 
                    echo $PlayerSettings['rightbg'];
                    ?>
" maxlength="20" />
				<img id="rightbg_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['rightbg'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Play/Pause Hover Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="rightbghover" name="Player[rightbghover]" class="color_field" value="<?php 
                    echo $PlayerSettings['rightbghover'];
                    ?>
" maxlength="20" />
				<img id="rightbghover_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['rightbghover'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Play/Pause Icon Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="righticon" name="Player[righticon]" class="color_field" value="<?php 
                    echo $PlayerSettings['righticon'];
                    ?>
" maxlength="20" />
				<img id="righticon_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['righticon'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Play/Pause Icon Hover Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="righticonhover" name="Player[righticonhover]" class="color_field" value="<?php 
                    echo $PlayerSettings['righticonhover'];
                    ?>
" maxlength="20" />
				<img id="righticonhover_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['righticonhover'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>

</table>
</div> <!-- end tab -->
</div> <!-- end tab wrapper -->

<?php 
                    break;
                case 'simple_flash':
                    ?>
<table class="form-table">
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Preview of Player', 'powerpress');
                    ?>
		</th>
		<td><p>
		<?php 
                    // TODO
                    echo powerpressplayer_build_simpleflash($Audio['simple_flash']);
                    ?>
			</p>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			&nbsp;
		</th>
		<td>
			<p><?php 
                    echo __('Simple Flash Player has no additional settings.', 'powerpress');
                    ?>
</p>
		</td>
	</tr>
</table>                            
              <?php 
                    break;
                case 'flashmp3-maxi':
                    //get settings for Flash MP3 Maxi player
                    $PlayerSettings = powerpress_get_settings('powerpress_flashmp3-maxi');
                    //set array values for dropdown lists
                    $autoload = array('always' => 'Always', 'never' => 'Never', 'autohide' => 'Auto Hide');
                    $volume = array('0' => '0', '25' => '25', '50' => '50', '75' => '75', '100' => '100', '125' => '125', '150' => '150', '175' => '175', '200' => '200');
                    //set PlayerSettings as blank array for initial setup
                    //This keeps the foreach loop from returning an error
                    if (empty($PlayerSettings)) {
                        $PlayerSettings = array('bgcolor1' => '#7c7c7c', 'bgcolor2' => '#333333', 'bgcolor' => '', 'textcolor' => '#FFFFFF', 'buttoncolor' => '#FFFFFF', 'buttonovercolor' => '#FFFF00', 'showstop' => '0', 'showinfo' => '0', 'showvolume' => '1', 'height' => '20', 'width' => '200', 'showloading' => 'autohide', 'buttonwidth' => '26', 'volume' => '100', 'showslider' => '1', 'slidercolor1' => '#cccccc', 'slidercolor2' => '#888888', 'sliderheight' => '10', 'sliderwidth' => '20', 'loadingcolor' => '#FFFF00', 'volumeheight' => '6', 'volumewidth' => '30', 'sliderovercolor' => '#eeee00');
                    }
                    ?>
<script type="text/javascript"><!--

function audio_player_defaults()
{
	if( confirm('<?php 
                    echo __("Set defaults, are you sure?\\n\\nAll of the current settings will be overwritten!'", 'powerpress');
                    ?>
) )
	{
		jQuery('#bgcolor1').val('#7c7c7c');
		UpdatePlayerPreview('bgcolor1',jQuery('#bgcolor1').val() );
		jQuery('#bgcolor1_prev'  ).css( { 'background-color' : '#7c7c7c' } );
		
		jQuery('#bgcolor2').val('#333333' );
		UpdatePlayerPreview('bgcolor2',jQuery('#bgcolor2').val() );
		jQuery('#bgcolor2_prev'  ).css( { 'background-color' : '#333333' } );
		
		jQuery('#textcolor' ).val( '#FFFFFF' );
		UpdatePlayerPreview('textcolor',jQuery('#textcolor').val() );
		jQuery('#textcolor_prev'  ).css( { 'background-color' : '#FFFFFF' } );
		
		jQuery('#buttoncolor' ).val( '#FFFFFF' );
		UpdatePlayerPreview('buttoncolor',jQuery('#buttoncolor').val() );
		jQuery('#buttoncolor_prev'  ).css( { 'background-color' : '#FFFFFF' } );
		
		jQuery('#buttonovercolor' ).val( '#FFFF00' );
		UpdatePlayerPreview('buttonovercolor',jQuery('#buttonovercolor').val() );
		jQuery('#buttonovercolor_prev'  ).css( { 'background-color' : '#FFFF00' } );
		
		jQuery('#showstop' ).val( '0' );
		UpdatePlayerPreview('showstop',jQuery('#showstop').val() );
		jQuery('#showinfo' ).val( '0' );
		UpdatePlayerPreview('showinfo',jQuery('#showinfo').val() );
		jQuery('#showvolume' ).val( '1' );
		UpdatePlayerPreview('showvolume',jQuery('#showvolume').val() );
		
		jQuery('#player_height' ).val( '20' );
		UpdatePlayerPreview('height',jQuery('#player_height').val() );
		
		jQuery('#player_width' ).val( '200' );
		UpdatePlayerPreview('width',jQuery('#player_width').val() );
		
		jQuery('#showloading' ).val( 'autohide' );
		UpdatePlayerPreview('showloading',jQuery('#showloading').val() );
		
		
		jQuery('#slidercolor1').val('#cccccc' );
		UpdatePlayerPreview('slidercolor1',jQuery('#slidercolor1').val() );
		jQuery('#slidercolor1_prev'  ).css( { 'background-color' : '#cccccc' } );
		
		jQuery('#slidercolor2').val('#888888' );
		UpdatePlayerPreview('slidercolor2',jQuery('#slidercolor2').val() );
		jQuery('#slidercolor2_prev'  ).css( { 'background-color' : '#888888' } );
		
		jQuery('#sliderheight' ).val( '10' );
		UpdatePlayerPreview('sliderheight',jQuery('#sliderheight').val() );
		jQuery('#sliderwidth' ).val( '20' );
		UpdatePlayerPreview('sliderwidth',jQuery('#sliderwidth').val() );
		
		jQuery('#loadingcolor' ).val( '#FFFF00' );
		UpdatePlayerPreview('loadingcolor',jQuery('#loadingcolor').val() );
		jQuery('#loadingcolor_prev'  ).css( { 'background-color' : '#FFFF00' } );
		
		jQuery('#bgcolor').val('');
		UpdatePlayerPreview('bgcolor',jQuery('#bgcolor').val() );
		jQuery('#bgcolor_prev'  ).css( { 'background-color' : '' } );
		
		jQuery('#volumeheight' ).val( '6' );
		UpdatePlayerPreview('volumeheight',jQuery('#volumeheight').val() );
		jQuery('#volumewidth' ).val( '30' );
		UpdatePlayerPreview('volumewidth',jQuery('#volumewidth').val() );
		
		jQuery('#sliderovercolor' ).val( '#eeee00' );
		UpdatePlayerPreview('sliderovercolor',jQuery('#sliderovercolor').val() );
		jQuery('#sliderovercolor_prev'  ).css( { 'background-color' : '#eeee00' } );
		
		jQuery('#volume' ).val( '100' );
		UpdatePlayerPreview('volume',jQuery('#volume').val() );
		
		jQuery('#showslider' ).val( '1' );
		UpdatePlayerPreview('showslider',jQuery('#showslider').val() );
		
		jQuery('#buttonwidth' ).val( '26' );
		UpdatePlayerPreview('buttonwidth',jQuery('#buttonwidth').val() );
		
		//update_audio_player();
		generator.updatePlayer();
	}
}
//-->
</script>
	<input type="hidden" name="action" value="powerpress-flashmp3-maxi" />
	<p><?php 
                    echo __('Configure Flash Mp3 Maxi Player', 'powerpress');
                    ?>
</p>
<table class="form-table">
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Preview of Player', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div id="player_preview"></div>

<script type="text/javascript" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
3rdparty/maxi_player/generator.js"></script>
<input type="hidden" id="gen_mp3" name="gen_mp3" value="<?php 
                    echo $Audio['flashmp3-maxi'];
                    ?>
" />


		</td>
	</tr>
</table>

<div id="powerpress_settings_page" class="powerpress_tabbed_content" style="position: relative;">
	<div style="position: absolute; top: 6px; right:0px;">
		<a href="#" onclick="audio_player_defaults();return false;"><?php 
                    echo __('Set Defaults', 'powerpress');
                    ?>
</a>
	</div>
  <ul class="powerpress_settings_tabs"> 
		<li><a href="#tab_general"><span><?php 
                    echo __('Basic Settings', 'powerpress');
                    ?>
</span></a></li> 
		<li><a href="#tab_buttons"><span><?php 
                    echo __('Button Settings', 'powerpress');
                    ?>
</span></a></li> 
		<li><a href="#tab_volume"><span><?php 
                    echo __('Volume Settings', 'powerpress');
                    ?>
</span></a></li>
		<li><a href="#tab_slider"><span><?php 
                    echo __('Slider Settings', 'powerpress');
                    ?>
</span></a></li>
  </ul>
	
 <div id="tab_general" class="powerpress_tab">
		<h3><?php 
                    echo __('General Settings', 'powerpress');
                    ?>
</h3>
		<table class="form-table">
        <tr valign="top">
            <td colspan="2">
            
            <?php 
                    echo __('leave blank for default values', 'powerpress');
                    ?>
            </td>
        </tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Player Gradient Color Top', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="bgcolor1"  name="Player[bgcolor1]" class="color_field" value="<?php 
                    echo $PlayerSettings['bgcolor1'];
                    ?>
" maxlength="20" />
				<img id="bgcolor1_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['bgcolor1'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Player Gradient Color Bottom', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="bgcolor2" name="Player[bgcolor2]" class="color_field" value="<?php 
                    echo $PlayerSettings['bgcolor2'];
                    ?>
" maxlength="20" />
				<img id="bgcolor2_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['bgcolor2'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Background Color', 'powerpress');
                    ?>
                        
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="bgcolor" name="Player[bgcolor]" class="color_field" value="<?php 
                    echo $PlayerSettings['bgcolor'];
                    ?>
" maxlength="20" />
				<img id="bgcolor_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['bgcolor'];
                    ?>
;" class="color_preview" />
			</div>
			<small><?php 
                    echo __('leave blank for transparent', 'powerpress');
                    ?>
</small>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Text Color', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="textcolor" name="Player[textcolor]" class="color_field" value="<?php 
                    echo $PlayerSettings['textcolor'];
                    ?>
" maxlength="20" />
				<img id="textcolor_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['textcolor'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Player Height (in pixels)', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 50px;" id="player_height" name="Player[height]" value="<?php 
                    echo $PlayerSettings['height'];
                    ?>
" maxlength="20" />
			</div>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Player Width (in pixels)', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 50px;" id="player_width" name="Player[width]" value="<?php 
                    echo $PlayerSettings['width'];
                    ?>
" maxlength="20" />
			</div>
		</td>
	</tr>
</table>
</div>

 <div id="tab_buttons" class="powerpress_tab">
		<h3><?php 
                    echo __('Button Settings', 'powerpress');
                    ?>
</h3>
		<table class="form-table">
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Button Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="buttoncolor" name="Player[buttoncolor]" class="color_field" value="<?php 
                    echo $PlayerSettings['buttoncolor'];
                    ?>
" maxlength="20" />
				<img id="buttoncolor_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['buttoncolor'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Button Hover Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="buttonovercolor" name="Player[buttonovercolor]" class="color_field" value="<?php 
                    echo $PlayerSettings['buttonovercolor'];
                    ?>
" maxlength="20" />
				<img id="buttonovercolor_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['buttonovercolor'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Button Width (in pixels)', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 50px;" id="buttonwidth" name="Player[buttonwidth]" value="<?php 
                    echo $PlayerSettings['buttonwidth'];
                    ?>
" maxlength="20" />
			</div>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Show Stop Button', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
				<select style="width: 100px;" id="showstop" name="Player[showstop]">
<?php 
                    $options = array('1' => __('Yes', 'powerpress'), '0' => __('No', 'powerpress'));
                    powerpress_print_options($options, $PlayerSettings['showstop']);
                    ?>
                                </select>
			</div>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Show Info', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
				<select style="width: 100px;" id="showinfo" name="Player[showinfo]">
<?php 
                    $options = array('1' => __('Yes', 'powerpress'), '0' => __('No', 'powerpress'));
                    powerpress_print_options($options, $PlayerSettings['showinfo']);
                    ?>
                                </select>
			</div>
		</td>
	</tr>
</table>
</div>

 <div id="tab_volume" class="powerpress_tab">
		<h3><?php 
                    echo __('Volume Settings', 'powerpress');
                    ?>
</h3>
		<table class="form-table">
        
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Show Volume', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
				<select style="width: 100px;" id="showvolume" name="Player[showvolume]">
<?php 
                    $options = array('1' => __('Yes', 'powerpress'), '0' => __('No', 'powerpress'));
                    powerpress_print_options($options, $PlayerSettings['showvolume']);
                    ?>
                                </select>
			</div>
		</td>
	</tr>	
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Volume', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
				<select style="width: 100px;" id="volume" name="Player[volume]">
<?php 
                    powerpress_print_options($volume, $PlayerSettings['volume']);
                    ?>
                                </select>
			</div>
		</td>
	</tr>	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Volume Height (in pixels)', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 50px;" id="volumeheight" name="Player[volumeheight]" value="<?php 
                    echo $PlayerSettings['volumeheight'];
                    ?>
" maxlength="20" />
			</div>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Volume Width (in pixels)', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 50px;" id="volumewidth" name="Player[volumewidth]" value="<?php 
                    echo $PlayerSettings['volumewidth'];
                    ?>
" maxlength="20" />
			</div>
		</td>
	</tr>

</table>
</div>

 <div id="tab_slider" class="powerpress_tab">
		<h3><?php 
                    echo __('Slider Settings', 'powerpress');
                    ?>
</h3>
		<table class="form-table">
		
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Show Slider', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
				<select style="width: 100px;" id="showslider" name="Player[showslider]">
<?php 
                    $options = array('1' => __('Yes', 'powerpress'), '0' => __('No', 'powerpress'));
                    powerpress_print_options($options, $PlayerSettings['showslider']);
                    ?>
                                </select>
			</div>
		</td>
	</tr>	
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Slider Color Top', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="slidercolor1" name="Player[slidercolor1]" class="color_field" value="<?php 
                    echo $PlayerSettings['slidercolor1'];
                    ?>
" maxlength="20" />
				<img id="slidercolor1_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['slidercolor1'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Slider Color Bottom', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="slidercolor2" name="Player[slidercolor2]" class="color_field" value="<?php 
                    echo $PlayerSettings['slidercolor2'];
                    ?>
" maxlength="20" />
				<img id="slidercolor2_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['slidercolor2'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Slider Hover Color', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="sliderovercolor" name="Player[sliderovercolor]" class="color_field" value="<?php 
                    echo $PlayerSettings['sliderovercolor'];
                    ?>
" maxlength="20" />
				<img id="sliderovercolor_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['sliderovercolor'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Slider Height (in pixels)', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 50px;" id="sliderheight" name="Player[sliderheight]" value="<?php 
                    echo $PlayerSettings['sliderheight'];
                    ?>
" maxlength="20" />
			</div>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Slider Width (in pixels)', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 50px;" id="sliderwidth" name="Player[sliderwidth]" value="<?php 
                    echo $PlayerSettings['sliderwidth'];
                    ?>
" maxlength="20" />
			</div>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Show Loading Buffer', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
				<select style="width: 100px;" id="showloading" name="Player[showloading]">
<?php 
                    powerpress_print_options($autoload, $PlayerSettings['showloading']);
                    ?>
                                </select>
			</div>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Loading Buffer Color', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="loadingcolor" name="Player[loadingcolor]" class="color_field" value="<?php 
                    echo $PlayerSettings['loadingcolor'];
                    ?>
" maxlength="20" />
				<img id="loadingcolor_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['loadingcolor'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>

</table>
</div> <!-- end tab -->
</div><!-- end tab container -->

<script type="text/javascript"><!--

	generator.player = '<?php 
                    echo powerpress_get_root_url();
                    ?>
player_mp3_maxi.swf';
	generator.addParam("gen_mp3", "mp3", "url", '');
	generator.addParam("player_height", "height", "int", "20");
	generator.addParam("player_width", "width", "int", "200");
	generator.addParam("bgcolor1", "bgcolor1", "color", "#7c7c7c");
	generator.addParam("bgcolor2", "bgcolor2", "color", "#333333");
	generator.addParam("bgcolor", "bgcolor", "color", "");
	generator.addParam("textcolor", "textcolor", "color", "#FFFFFF");
	generator.addParam("loadingcolor", "loadingcolor", "color", "#FFFF00");
	generator.addParam("buttoncolor", "buttoncolor", "color", "#FFFFFF");
	generator.addParam("buttonovercolor", "buttonovercolor", "color", "#FFFF00");
	generator.addParam("showloading", "showloading", "text", "autohide");
	generator.addParam("showinfo", "showinfo", "bool", "0");
	generator.addParam("showstop", "showstop", "int", "0");
	generator.addParam("showvolume", "showvolume", "int", "0");
	generator.addParam("buttonwidth", "buttonwidth", "int", "26");
	generator.addParam("volume", "volume", "int", "100");
	generator.addParam("volumeheight", "volumeheight", "int", "6");
	generator.addParam("volumewidth", "volumewidth", "int", "30");
	generator.addParam("sliderovercolor", "sliderovercolor", "color", "#eeee00");
	generator.addParam("showslider", "showslider", "bool", "1");
	generator.addParam("slidercolor1", "slidercolor1", "color", "#cccccc");
	generator.addParam("slidercolor2", "slidercolor2", "color", "#888888");
	generator.addParam("sliderheight", "sliderheight", "int", "10");
	generator.addParam("sliderwidth", "sliderwidth", "int", "20");
	
	generator.updatePlayer();
//-->
</script>
<?php 
                    break;
                case 'audioplay':
                    $PlayerSettings = powerpress_get_settings('powerpress_audioplay');
                    if (empty($PlayerSettings)) {
                        $PlayerSettings = array('bgcolor' => '', 'buttondir' => 'negative', 'mode' => 'playpause');
                    }
                    ?>
        	<input type="hidden" name="action" value="powerpress-audioplay" />
	<?php 
                    echo __('Configure the AudioPlay Player', 'powerpress');
                    ?>
<br clear="all" />

<table class="form-table">
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Preview of Player', 'powerpress');
                    ?>
 
		</th>
		<td colspan="2">
			<div id="player_preview">
                        
<?php 
                    echo powerpressplayer_build_audioplay($Audio['audioplay']);
                    ?>
                </div>
            </td>
        </tr>
</table>
				
		<h2><?php 
                    echo __('General Settings', 'powerpress');
                    ?>
</h2>
	<table class="form-table">
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Background Color', 'powerpress');
                    ?>
                        
		</th>
		<td valign="top">
			<div class="color_control">
				<input type="text" style="width: 100px;" id="bgcolor" name="Player[bgcolor]" class="color_field" value="<?php 
                    echo $PlayerSettings['bgcolor'];
                    ?>
" maxlength="20" />
				<img id="bgcolor_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['bgcolor'];
                    ?>
;" class="color_preview" />
			</div>
			<small><?php 
                    echo __('leave blank for transparent', 'powerpress');
                    ?>
</small>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Player Mode', 'powerpress');
                    ?>
		</th>
		<td valign="top">
			<div class="color_control">
                            <select name="Player[mode]" id="mode">
<?php 
                    $options = array('playpause' => __('Play/Pause', 'powerpress'), 'playstop' => __('Play/Stop', 'powerpress'));
                    powerpress_print_options($options, $PlayerSettings['mode']);
                    ?>
     
                            </select>
			</div>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Player Button', 'powerpress');
                    ?>
		</th>
		<td valign="top">
			<div class="color_control">
                        <table cellpadding="0" cellspacing="0">
                                <?php 
                    $options = array('classic', 'classic_small', 'negative', 'negative_small');
                    foreach ($options as $option) {
                        if ($PlayerSettings['buttondir'] == $option) {
                            $selected = " CHECKED";
                        } else {
                            $selected = "";
                        }
                        if ($option == "classic" || $option == "classic_small") {
                            $td = '<td style="background: #999;" align="center">';
                            $warning = "(ideal for dark backgrounds)";
                            if ($option == "classic_small") {
                                $name = __('Small White', 'powerpress');
                            } else {
                                $name = __('Large White', 'powerpress');
                            }
                        } else {
                            $td = '<td align="center">';
                            $warning = "";
                            if ($option == "negative_small") {
                                $name = __('Small Black', 'powerpress');
                            } else {
                                $name = __('Large Black', 'powerpress');
                            }
                        }
                        echo '<tr><td><input type="radio" name="Player[buttondir]" value="' . $option . '"' . $selected . ' /></td>' . $td . '<img src="' . powerpress_get_root_url() . 'buttons/' . $option . '/playup.png" /></td><td>' . $name . ' Button ' . $warning . '</td></tr>';
                    }
                    ?>
                                
                            </table>
			</div>
		</td>
	</tr>

</table>
<?php 
                    break;
                case 'html5audio':
                    $SupportUploads = powerpressadmin_support_uploads();
                    ?>
<p><?php 
                    echo __('Configure HTML5 Audio Player', 'powerpress');
                    ?>
</p>
<table class="form-table">
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Preview of Player', 'powerpress');
                    ?>
 
		</th>
		<td>
			<p>
<?php 
                    echo powerpressplayer_build_html5audio($Audio['default']);
                    ?>
			</p>
		</td>
	</tr>

	
	<tr>
	<th scope="row">
	<?php 
                    echo __('Play Icon', 'powerpress');
                    ?>
</th>
	<td>

	<input type="text" id="audio_custom_play_button" name="General[audio_custom_play_button]" style="width: 60%;" value="<?php 
                    echo $General['audio_custom_play_button'];
                    ?>
" maxlength="250" />
	<a href="#" onclick="javascript: window.open( document.getElementById('audio_custom_play_button').value ); return false;"><?php 
                    echo __('preview', 'powerpress');
                    ?>
</a>

	<p><?php 
                    echo __('Place the URL to the play icon above.', 'powerpress');
                    ?>
 <?php 
                    echo __('Example', 'powerpress');
                    ?>
: http://example.com/images/audio_play_icon.jpg<br /><br />
	<?php 
                    echo __('Leave blank to use default play icon image.', 'powerpress');
                    ?>
</p>

	<?php 
                    if ($SupportUploads) {
                        ?>
	<p><input name="audio_custom_play_button_checkbox" type="checkbox" onchange="powerpress_show_field('audio_custom_play_button_upload', this.checked)" value="1" /> <?php 
                        echo __('Upload new image', 'powerpress');
                        ?>
 </p>
	<div style="display:none" id="audio_custom_play_button_upload">
		<label for="audio_custom_play_button_file"><?php 
                        echo __('Choose file', 'powerpress');
                        ?>
:</label><input type="file" name="audio_custom_play_button_file"  />
	</div>
	<?php 
                    }
                    ?>
	</td>
	</tr>
</table>

<?php 
                    break;
                case 'mediaelement-audio':
                    $SupportUploads = powerpressadmin_support_uploads();
                    // TODO!
                    ?>
<p><?php 
                    echo __('Configure MediaElement.js Audio Player', 'powerpress');
                    ?>
</p>
<table class="form-table">
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Preview of Player', 'powerpress');
                    ?>
		</th>
		<td><p>
		<?php 
                    // TODO
                    echo powerpressplayer_build_mediaelementaudio($Audio['mediaelement-audio']);
                    ?>
			</p>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			&nbsp;
		</th>
		<td>
			<p><?php 
                    echo __('MediaElement.js Player has no additional settings at this time.', 'powerpress');
                    ?>
</p>
		</td>
	</tr>
</table>  

<?php 
                    break;
                default:
                    if (empty($General['player_width_audio'])) {
                        $General['player_width_audio'] = '';
                    }
                    ?>
<p><?php 
                    echo __('Configure Flow Player Classic', 'powerpress');
                    ?>
</p>
<table class="form-table">
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Preview of Player', 'powerpress');
                    ?>
 
		</th>
		<td>
			<p>
<?php 
                    echo powerpressplayer_build_flowplayerclassic($Audio['default']);
                    ?>
			</p>
		</td>
	</tr>
</table>

<h2><?php 
                    echo __('General Settings', 'powerpress');
                    ?>
</h2>
	<table class="form-table">
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Width', 'powerpress');
                    ?>
   
		</th>
		<td valign="top">
				<input type="text" style="width: 50px;" id="player_width" name="General[player_width_audio]" class="player-width" value="<?php 
                    echo $General['player_width_audio'];
                    ?>
" maxlength="4" />
			<?php 
                    echo __('Width of Audio mp3 player (leave blank for 320 default)', 'powerpress');
                    ?>
		</td>
	</tr>
</table>
<?php 
                    break;
            }
        } else {
            switch ($General['video_player']) {
                case 'flow-player-classic':
                    ?>
					<p><?php 
                    echo __('Configure Flow Player Classic', 'powerpress');
                    ?>
</p>
<table class="form-table">
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Preview of Player', 'powerpress');
                    ?>
 
		</th>
		<td>
			<p>
<?php 
                    echo powerpressplayer_build_flowplayerclassic($Video['flow-player-classic']);
                    ?>
			</p>
		</td>
	</tr>
</table>

					<?php 
                    break;
                case 'html5video':
                    ?>
					<p><?php 
                    echo __('Configure HTML5 Video Player', 'powerpress');
                    ?>
</p>
<table class="form-table">
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Preview of Player', 'powerpress');
                    ?>
 
		</th>
		<td>
			<p>
<?php 
                    echo powerpressplayer_build_html5video($Video['html5video']);
                    ?>
			</p>
		</td>
	</tr>
</table>

					<?php 
                    break;
                case 'videojs-html5-video-player-for-wordpress':
                    ?>
					<p><?php 
                    echo __('Configure VideoJS', 'powerpress');
                    ?>
</p>
<table class="form-table">
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Preview of Player', 'powerpress');
                    ?>
 
		</th>
		<td>
			<p>
<?php 
                    echo powerpressplayer_build_videojs($Video['videojs-html5-video-player-for-wordpress']);
                    ?>
			</p>
		</td>
	</tr>
</table>
<h3><?php 
                    echo __('VideoJS Settings', 'powerpress');
                    ?>
</h3>
<table class="form-table">
<tr valign="top">
<th scope="row">
<?php 
                    echo __('VideoJS CSS Class', 'powerpress');
                    ?>
</th>
<td>
<p>
<input type="text" name="General[videojs_css_class]" style="width: 150px;" value="<?php 
                    echo empty($General['videojs_css_class']) ? '' : htmlspecialchars($General['videojs_css_class']);
                    ?>
" /> 
<?php 
                    echo __('Apply specific CSS styling to your Video JS player.', 'powerpress');
                    ?>
</p>
</td>
</tr>
</table>
					<?php 
                    break;
                case 'mediaelement-video':
                    ?>
					<p><?php 
                    echo __('Configure MediaElement.js Video Player', 'powerpress');
                    ?>
</p>
<table class="form-table">
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Preview of Player', 'powerpress');
                    ?>
 
		</th>
		<td>
			<p>
<?php 
                    echo powerpressplayer_build_mediaelementvideo($Video['mediaelement-video']);
                    ?>
			</p>
		</td>
	</tr>
</table>

					<?php 
                    break;
            }
            if (!isset($General['poster_play_image'])) {
                $General['poster_play_image'] = 1;
            }
            if (!isset($General['poster_image_audio'])) {
                $General['poster_image_audio'] = 0;
            }
            if (!isset($General['player_width'])) {
                $General['player_width'] = '';
            }
            if (!isset($General['player_height'])) {
                $General['player_height'] = '';
            }
            if (!isset($General['poster_image'])) {
                $General['poster_image'] = '';
            }
            if (!isset($General['video_custom_play_button'])) {
                $General['video_custom_play_button'] = '';
            }
            ?>
<!-- Global Video Player settings (Appy to all video players -->
<input type="hidden" name="action" value="powerpress-save-videocommon" />
<h3><?php 
            echo __('Common Settings', 'powerpress');
            ?>
</h3>
<p><?php 
            echo __('The following video settings apply to the video player above as well as to classic video &lt;embed&gt; formats such as Microsoft Windows Media (.wmv), QuickTime (.mov) and RealPlayer.', 'powerpress');
            ?>
</p>
<table class="form-table">
<tr valign="top">
<th scope="row">
<?php 
            echo __('Player Width', 'powerpress');
            ?>
</th>
<td>
<input type="text" name="General[player_width]" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9%]/g, '');" value="<?php 
            echo $General['player_width'];
            ?>
" maxlength="4" />
<?php 
            echo __('Width of player (leave blank for 400 default)', 'powerpress');
            ?>
</td>
</tr>

<tr valign="top">
<th scope="row">
<?php 
            echo __('Player Height', 'powerpress');
            ?>
</th>
<td>
<input type="text" name="General[player_height]" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9%]/g, '');" value="<?php 
            echo $General['player_height'];
            ?>
" maxlength="4" />
<?php 
            echo __('Height of player (leave blank for 225 default)', 'powerpress');
            ?>
</td>
</tr>
<?php 
            $SupportUploads = powerpressadmin_support_uploads();
            // Play icon, only applicable to HTML5/FlowPlayerClassic
            if (in_array($General['video_player'], array('flow-player-classic', 'html5video'))) {
                ?>
<tr valign="top">
<th scope="row">
<?php 
                echo __('QuickTime Scale', 'powerpress');
                ?>
</th>
<td>
	<select name="General[player_scale]" class="bpp_input_sm" onchange="javascript:jQuery('#player_scale_custom').css('display', (this.value=='tofit'||this.value=='aspect'? 'none':'inline' ))">
<?php 
                $scale_options = array('tofit' => __('ToFit (default)', 'powerpress'), 'aspect' => __('Aspect', 'powerpress'));
                if (!isset($General['player_scale'])) {
                    $General['player_scale'] = 'tofit';
                }
                // Tofit works in almost all cases
                if (is_numeric($General['player_scale'])) {
                    $scale_options[$General['player_scale']] = __('Custom', 'powerpress');
                } else {
                    $scale_options['custom'] = __('Custom', 'powerpress');
                }
                while (list($value, $desc) = each($scale_options)) {
                    echo "\t<option value=\"{$value}\"" . ($General['player_scale'] == $value ? ' selected' : '') . ">{$desc}</option>\n";
                }
                ?>
</select>
<span id="player_scale_custom" style="display: <?php 
                echo is_numeric($General['player_scale']) ? 'inline' : 'none';
                ?>
">
	<?php 
                echo __('Scale:', 'powerpress');
                ?>
 <input type="text" name="PlayerScaleCustom" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9.]/g, '');" value="<?php 
                echo is_numeric($General['player_scale']) ? $General['player_scale'] : '';
                ?>
" maxlength="4" /> <?php 
                echo __('e.g.', 'powerpress');
                ?>
 1.5
</span>
<p style="margin-top: 5px; margin-bottom: 0;">
	<?php 
                echo __('If you do not see video, adjust the width, height and scale settings above.', 'powerpress');
                ?>
</p>
</td>
</tr>
<?php 
            }
            ?>
<tr>
<th scope="row">
<?php 
            echo __('Default Poster Image', 'powerpress');
            ?>
</th>
<td>

<input type="text" id="poster_image" name="General[poster_image]" style="width: 60%;" value="<?php 
            echo $General['poster_image'];
            ?>
" maxlength="250" />
<a href="#" onclick="javascript: window.open( document.getElementById('poster_image').value ); return false;"><?php 
            echo __('preview', 'powerpress');
            ?>
</a>

<p><?php 
            echo __('Place the URL to the poster image above.', 'powerpress');
            ?>
 <?php 
            echo __('Example', 'powerpress');
            ?>
: http://example.com/images/poster.jpg<br /><br />
<?php 
            echo __('Image should be at minimum the same width/height as the player above. Leave blank to use default black background image.', 'powerpress');
            ?>
</p>

<?php 
            if ($SupportUploads) {
                ?>
<p><input name="poster_image_checkbox" type="checkbox" onchange="powerpress_show_field('poster_image_upload', this.checked)" value="1" /> <?php 
                echo __('Upload new image', 'powerpress');
                ?>
 </p>
<div style="display:none" id="poster_image_upload">
	<label for="poster_image_file"><?php 
                echo __('Choose file', 'powerpress');
                ?>
:</label><input type="file" name="poster_image_file"  />
</div>
<?php 
            }
            if (in_array($General['video_player'], array('flow-player-classic', 'html5video'))) {
                ?>
<p><input name="General[poster_play_image]" type="checkbox" value="1" <?php 
                echo $General['poster_play_image'] ? 'checked' : '';
                ?>
 /> <?php 
                echo __('Include play icon over poster image when applicable', 'powerpress');
                ?>
 </p>
<p><input name="General[poster_image_audio]" type="checkbox" value="1" <?php 
                echo $General['poster_image_audio'] ? 'checked' : '';
                ?>
 /> <?php 
                echo __('Use poster image, player width and height above for audio (Flow Player only)', 'powerpress');
                ?>
 </p>
<?php 
            }
            ?>
</td>
</tr>

<?php 
            // Play icon, only applicable to HTML5/FlowPlayerClassic
            if (in_array($General['video_player'], array('flow-player-classic', 'html5video'))) {
                ?>
<tr>
<th scope="row">
<?php 
                echo __('Play Icon', 'powerpress');
                ?>
</th>
<td>

<input type="text" id="video_custom_play_button" name="General[video_custom_play_button]" style="width: 60%;" value="<?php 
                echo $General['video_custom_play_button'];
                ?>
" maxlength="250" />
<a href="#" onclick="javascript: window.open( document.getElementById('video_custom_play_button').value ); return false;"><?php 
                echo __('preview', 'powerpress');
                ?>
</a>

<p><?php 
                echo __('Place the URL to the play icon above.', 'powerpress');
                ?>
 <?php 
                echo __('Example', 'powerpress');
                ?>
: http://example.com/images/video_play_icon.jpg<br /><br />
<?php 
                echo __('Image should 60 pixels by 60 pixels. Leave blank to use default play icon image.', 'powerpress');
                ?>
</p>

<?php 
                if ($SupportUploads) {
                    ?>
<p><input name="video_custom_play_button_checkbox" type="checkbox" onchange="powerpress_show_field('video_custom_play_button_upload', this.checked)" value="1" /> <?php 
                    echo __('Upload new image', 'powerpress');
                    ?>
 </p>
<div style="display:none" id="video_custom_play_button_upload">
	<label for="video_custom_play_button_file"><?php 
                    echo __('Choose file', 'powerpress');
                    ?>
:</label><input type="file" name="video_custom_play_button_file"  />
</div>
<?php 
                }
                ?>
</td>
</tr>
<?php 
            }
            ?>
</table>
<?php 
        }
        ?>

<?php 
    }
}
    function css()
    {
        ?>

<style type="text/css">

/*
PowerPress subscribe sidebar widget
*/
.widget-area .widget_powerpress_subscribe h2,
.widget-area .widget_powerpress_subscribe h3,
.widget-area .widget_powerpress_subscribe h4,
.widget_powerpress_subscribe h2,
.widget_powerpress_subscribe h3,
.widget_powerpress_subscribe h4 {
	margin-bottom: 0;
	padding-bottom: 0;
}

.pp-ssb-widget {
	width: 100%;
	margin: 0 auto;
	font-family: Sans-serif;
	color: #FFFFFF;
}
body .pp-ssb-widget a.pp-ssb-btn {
	width: 100% !important;
	height: 48px;
	padding: 0;
	color: #FFFFFF;
	display: inline-block;
	margin: 10px 0 10px 0;
	text-decoration: none;
	text-align:left;
	vertical-align: middle;
	line-height: 48px;
	font-size: 90% !important;
	font-weight: bold !important;
	overflow: hidden;
	border-radius: 1px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); 
}

body .sidebar .widget .pp-ssb-widget a:link,
body .sidebar .widget .pp-ssb-widget a:visited,
body .sidebar .widget .pp-ssb-widget a:active,
body .sidebar .widget .pp-ssb-widget a:hover,
body .pp-ssb-widget a.pp-ssb-btn:link,
body .pp-ssb-widget a.pp-ssb-btn:visited,
body .pp-ssb-widget a.pp-ssb-btn:active,
body .pp-ssb-widget a.pp-ssb-btn:hover {
	text-decoration: none !important;
	color: #FFFFFF !important;
}
.pp-ssb-widget-dark a,
.pp-ssb-widget-modern a {
	background-color: #222222;
}
.pp-ssb-widget-modern a.pp-ssb-itunes {
	background-color: #732BBE;
}
.pp-ssb-widget-modern a.pp-ssb-email {
	background-color: #337EC9;
}
.pp-ssb-widget-modern a.pp-ssb-android {
	background-color: #6AB344;
}
.pp-ssb-widget-modern a.pp-ssb-rss {
	background-color: #FF8800;
}
.pp-ssb-ic {
	width: 48px;
   height: 48px;
	border: 0;
	display: inline-block;
	vertical-align: middle;
	margin-right: 2px;
	background-image: url(<?php 
        echo powerpress_get_root_url();
        ?>
images/spriteStandard.png);
	background-repeat: no-repeat;
	background-size: 294px;
}
.pp-ssb-itunes .pp-ssb-ic {
    background-position: -49px 0;
}
.pp-ssb-rss .pp-ssb-ic {
   background-position: 0 -49px;
}
.pp-ssb-email .pp-ssb-ic {
  background-position: -196px -49px;
}
.pp-ssb-android .pp-ssb-ic {
	background-position: -98px -98px;
}
.pp-ssb-more .pp-ssb-ic {
  background-position: -49px -49px;
}
/* Retina-specific stuff here */
@media only screen and (-webkit-min-device-pixel-ratio: 2.0),
       only screen and (min--moz-device-pixel-ratio: 2.0),
       only screen and (-o-min-device-pixel-ratio: 200/100),
       only screen and (min-device-pixel-ratio: 2.0) {
	.pp-sub-ic {
		background-image: url(<?php 
        echo powerpress_get_root_url();
        ?>
images/spriteRetina.png);
	}
}
</style>
<?php 
    }
Exemplo n.º 8
0
function powerpressplayer_build_1pxoutplayer($media_url, $EpisodeData = array())
{
    $content = '';
    $autoplay = false;
    if (isset($EpisodeData['autoplay']) && $EpisodeData['autoplay']) {
        $autoplay = true;
    }
    // TODO: We need to handle this
    $PlayerSettings = get_option('powerpress_audio-player');
    if (!$PlayerSettings) {
        $PlayerSettings = array('width' => '290', 'transparentpagebg' => 'yes', 'lefticon' => '#333333', 'leftbg' => '#CCCCCC', 'bg' => '#E5E5E5', 'voltrack' => '#F2F2F2', 'volslider' => '#666666', 'rightbg' => '#B4B4B4', 'rightbghover' => '#999999', 'righticon' => '#333333', 'righticonhover' => '#FFFFFF', 'loader' => '#009900', 'track' => '#FFFFFF', 'tracker' => '#DDDDDD', 'border' => '#CCCCCC', 'skip' => '#666666', 'text' => '#333333', 'pagebg' => '', 'noinfo' => 'yes', 'rtl' => 'no');
    }
    if (empty($PlayerSettings['titles'])) {
        $PlayerSettings['titles'] = 'Blubrry PowerPress';
    } else {
        if (strtoupper($PlayerSettings['titles']) == __('TRACK', 'powerpress')) {
            unset($PlayerSettings['titles']);
        }
    }
    // Set player width
    if (!isset($PlayerSettings['width'])) {
        $PlayerSettings['width'] = 290;
    }
    if (!empty($EpisodeData['width']) && is_numeric($EpisodeData['width'])) {
        $PlayerSettings['width'] = $EpisodeData['width'];
    }
    $transparency = '<param name="wmode" value="transparent" />';
    $PlayerSettings['transparentpagebg'] = 'yes';
    if (!empty($PlayerSettings['pagebg'])) {
        $transparency = '<param name="bgcolor" value="' . $PlayerSettings['pagebg'] . '" />';
        $PlayerSettings['transparentpagebg'] = 'no';
    }
    $flashvars = '';
    while (list($key, $value) = each($PlayerSettings)) {
        $flashvars .= '&amp;' . $key . '=' . preg_replace('/\\#/', '', $value);
    }
    if ($autoplay) {
        $flashvars .= '&amp;autostart=yes';
    }
    // TODO: Add 1 px out audio-player player here
    $player_id = powerpressplayer_get_next_id();
    if (empty($EpisodeData['nodiv'])) {
        $content .= '<div class="powerpress_player" id="powerpress_player_' . $player_id . '">';
    }
    $content .= '<object type="application/x-shockwave-flash" data="' . powerpress_get_root_url() . 'audio-player.swf" id="' . $player_id . '" height="24" width="' . $PlayerSettings['width'] . '">' . PHP_EOL;
    $content .= '<param name="movie" value="' . powerpress_get_root_url() . 'audio-player.swf" />' . PHP_EOL;
    $content .= '<param name="FlashVars" value="playerID=' . $player_id . '&amp;soundFile=' . urlencode($media_url) . $flashvars . '" />' . PHP_EOL;
    $content .= '<param name="quality" value="high" />' . PHP_EOL;
    $content .= '<param name="menu" value="false" />' . PHP_EOL;
    $content .= '<param name="wmode" value="transparent" />' . PHP_EOL;
    // $content .= powerpressplayer_build_html5audio($media_url, $EpisodeData, true); // Feature removed since it causes double players to be insrted in Safari/Firefox
    $content .= powerpressplayer_build_playimageaudio($media_url);
    $content .= '</object>' . PHP_EOL;
    if (empty($EpisodeData['nodiv'])) {
        $content .= '</div>' . PHP_EOL;
    }
    return $content;
}
Exemplo n.º 9
0
function powerpress_do_subscribe_widget($settings)
{
    if (empty($settings['feed_url'])) {
        return '';
    }
    if (isset($settings['title']) && empty($settings['title'])) {
        $settings['title'] = get_bloginfo('name');
    }
    if (empty($settings['itunes_url'])) {
        $settings['itunes_url'] = powerpresssubscribe_get_itunes_url($settings);
    }
    if (empty($settings['style'])) {
        $settings['style'] = 'modern';
    }
    if (empty($settings['image_url'])) {
        $settings['image_url'] = powerpress_get_root_url() . 'itunes_default.jpg';
        // Default PowerPress image used in this case.
    }
    $PowerPressSettings = get_option('powerpress_general');
    $htmlX = '';
    $html = '';
    $html .= '<div class="pp-sub-widget pp-sub-widget-' . esc_attr($settings['style']) . '">';
    if (!empty($settings['title'])) {
        if (!isset($settings['heading'])) {
            // If not specified in the shortcode
            $settings['heading'] = __('Subscribe to', 'powerpress');
        }
        if (!empty($settings['heading'])) {
            // If there is a value set for the heading, lets use it
            $html .= '<div class="pp-sub-h">' . esc_html($settings['heading']) . '</div>';
        }
        $html .= '<h2 class="pp-sub-t">' . esc_html($settings['title']) . '</h2>';
    } else {
        $settings['title'] = '';
        // Make sure it's an empty string
    }
    if (!empty($settings['subtitle'])) {
        $html .= '<p class="pp-sub-st">' . esc_html($settings['subtitle']) . '</p>';
    }
    // Lets build the subscribe box...
    $html .= '<div class="pp-sub-bx">';
    $html .= '<img class="pp-sub-l" src="' . esc_url($settings['image_url']) . '" ' . (!empty($settings['title']) ? ' title="' . esc_attr($settings['title']) . '" ' : '') . '/>';
    $html .= '<div class="pp-sub-btns">';
    if (!empty($settings['itunes_url'])) {
        $html .= '<a href="' . esc_url($settings['itunes_url']) . '" class="pp-sub-btn pp-sub-itunes" title="' . esc_attr(__('Subscribe on iTunes', 'powerpress')) . '"><span class="pp-sub-ic"></span>' . esc_html(__('on iTunes', 'powerpress')) . '</a>';
    }
    if (preg_match('/^(https?:\\/\\/)(.*)$/i', $settings['feed_url'], $matches)) {
        $android_url = $matches[1] . 'subscribeonandroid.com/' . $matches[2];
        $html .= '<a href="' . esc_url($android_url) . '" class="pp-sub-btn pp-sub-android" title="' . esc_attr(__('Subscribe on Android', 'powerpress')) . '"><span class="pp-sub-ic"></span>' . esc_html(__('on Android', 'powerpress')) . '</a>';
        if (!empty($PowerPressSettings['subscribe_feature_email'])) {
            $email_url = $matches[1] . 'subscribebyemail.com/' . $matches[2];
            $html .= '<a href="' . esc_url($email_url) . '" class="pp-sub-btn pp-sub-email" title="' . esc_attr(__('Subscribe by Email', 'powerpress')) . '"><span class="pp-sub-ic"></span>' . esc_html(__('by Email', 'powerpress')) . '</a>';
        }
    }
    $html .= '<a href="' . esc_url($settings['feed_url']) . '" class="pp-sub-btn pp-sub-rss" title="' . esc_attr(__('Subscribe via RSS', 'powerpress')) . '"><span class="pp-sub-ic"></span>' . esc_html(__('via RSS', 'powerpress')) . '</a>';
    // May want these back, not sure.
    //$html .= '<a href="'.  esc_url( $settings['feed_url'] ) .'" class="pp-sub-btn pp-sub-bp"><span class="pp-sub-ic"></span>'.  esc_html( __('BeyondPod for Android', 'powerpress') ) .'</a>';
    //$html .= '<a href="'.  esc_url( $settings['feed_url'] ) .'" class="pp-sub-btn pp-sub-pr"><span class="pp-sub-ic"></span>'.  esc_html( __('Podcast Republic for Android', 'powerpress') ) .'</a>';
    $html .= '</div>';
    $html .= '</div>';
    $html .= '<div class="pp-sub-m">';
    $html .= '<p class="pp-sub-m-p">' . esc_html(__('Or subscribe with your favorite app by using the address below', 'powerpress')) . '</p>';
    $html .= '<input class="pp-sub-m-i" type="text" name="NULL' . rand(0, 9999) . '" value="' . esc_attr($settings['feed_url']) . '" onclick="this.focus();this.select();" />';
    $html .= '</div>';
    $html .= '</div>';
    return $html;
}
function powerpress_dashboard_head()
{
    echo "<script type=\"text/javascript\" src=\"" . powerpress_get_root_url() . "player.min.js\"></script>\n";
    ?>
<style type="text/css">
#blubrry_stats_summary {
	
}
#blubrry_stats_summary label {
	width: 40%;
	max-width: 150px;
	float: left;
}
#blubrry_stats_summary h2 {
	font-size: 14px;
	margin: 0;
	padding: 0;
}
.blubrry_stats_ul {
	padding-left: 20px;
	margin-top: 5px;
	margin-bottom: 10px;
}
.blubrry_stats_ul li {
	list-style-type: none;
	margin: 0px;
	padding: 0px;
}
#blubrry_stats_media {
	display: none;
}
#blubrry_stats_media_show {
	text-align: right;
	font-size: 85%;
}
#blubrry_stats_media h4 {
	margin-bottom: 10px;
}
.blubrry_stats_title {
	margin-left: 10px;
}
.blubrry_stats_updated {
	font-size: 80%;
}
.powerpress-news-dashboard {
/*	background-image:url(http://images.blubrry.com/powerpress/blubrry_logo.png);
	background-repeat: no-repeat;
	background-position: top right; */
}
.powerpress-news-dashboard .powerpressNewsPlayer {
	margin-top: 5px;
}
</style>
<script type="text/javascript"><!--
jQuery(document).ready(function($) {
	jQuery('.powerpress-dashboard-notice').click( function(e) {
		e.preventDefault();
		var dash_id = jQuery(this).parents('.postbox').attr('id');
		jQuery( '#' + dash_id + '-hide' ).prop('checked', false).triggerHandler('click');
	
		jQuery.ajax( {
				type: 'POST',
				url: '<?php 
    echo admin_url();
    ?>
admin-ajax.php', 
				data: { action: 'powerpress_dashboard_dismiss', dismiss_dash_id : dash_id },
				success: function(response) {
				}
			});
	});
});
// --></script>
<?php 
}
function powerpress_admin_players($type = 'audio')
{
    $General = powerpress_get_settings('powerpress_general');
    $select_player = false;
    if (isset($_GET['sp'])) {
        $select_player = true;
    } else {
        if ($type == 'video') {
            if (empty($General['video_player'])) {
                $select_player = true;
            } else {
                switch ($General['video_player']) {
                    case 'mediaelement-video':
                    case 'videojs-html5-video-player-for-wordpress':
                    case 'html5video':
                        break;
                    default:
                        $select_player = true;
                }
            }
        } else {
            if (empty($General['player'])) {
                $select_player = true;
            } else {
                switch ($General['player']) {
                    case 'mediaelement-audio':
                    case 'html5audio':
                    case 'audio-player':
                        break;
                    default:
                        $select_player = true;
                }
            }
        }
    }
    if (empty($General['player'])) {
        $General['player'] = 'mediaelement-audio';
    }
    if (empty($General['player'])) {
        $General['video_player'] = 'mediaelement-video';
    }
    if (empty($General['audio_custom_play_button'])) {
        $General['audio_custom_play_button'] = '';
    }
    $Audio = array();
    $Audio['audio-player'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/1_Pixel_Out_Flash_Player.mp3';
    $Audio['html5audio'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/html5.mp3';
    $Audio['mediaelement-audio'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/MediaElement_audio.mp3';
    $Video = array();
    $Video['html5video'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/html5.mp4';
    $Video['videojs-html5-video-player-for-wordpress'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/videojs.mp4';
    $Video['mediaelement-video'] = 'http://media.blubrry.com/blubrry/content.blubrry.com/blubrry/MediaElement_video.mp4';
    wp_enqueue_style('wp-color-picker');
    if ($type == 'video' && function_exists('add_videojs_header')) {
        add_videojs_header();
    }
    ?>
<link rel="stylesheet" href="<?php 
    echo powerpress_get_root_url();
    ?>
3rdparty/colorpicker/css/colorpicker.css" type="text/css" />
<script type="text/javascript" src="<?php 
    echo powerpress_get_root_url();
    ?>
3rdparty/colorpicker/js/colorpicker.js"></script>
<script type="text/javascript" src="<?php 
    echo powerpress_get_root_url();
    ?>
player.min.js"></script>
<script type="text/javascript"><!--

function rgb2hex(rgb) {
 
 rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
 function hex(x) {
  hexDigits = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
  return isNaN(x) ? "00" : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16];
 }
 
 if( rgb )
	return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
 return '';
}

function UpdatePlayerPreview(name, value)
{
	if( typeof(generator) != "undefined" ) // Update the Maxi player...
	{
		generator.updateParam(name, value);
		generator.updatePlayer();
	}
	
	if( typeof(update_audio_player) != "undefined" ) // Update the 1 px out player...
		update_audio_player();
}
				
jQuery(document).ready(function($) {
	
	jQuery('.color_preview').ColorPicker({
		onSubmit: function(hsb, hex, rgb, el) {
			jQuery(el).css({ 'background-color' : '#' + hex });
			jQuery(el).ColorPickerHide();
			var Id = jQuery(el).attr('id');
			Id = Id.replace(/_prev/, '');
			jQuery('#'+ Id  ).val( '#' + hex );
			UpdatePlayerPreview(Id, '#'+hex );
		},
		onBeforeShow: function () {
			jQuery(this).ColorPickerSetColor( rgb2hex( jQuery(this).css("background-color") ) );
		}
	})
	.bind('keyup', function(){
		jQuery(this).ColorPickerSetColor( rgb2hex( jQuery(this).css("background-color") ) );
	});
	
	jQuery('.color_field').bind('change', function () {
		var Id = jQuery(this).attr('id');
		jQuery('#'+ Id + '_prev'  ).css( { 'background-color' : jQuery(this).val() } );
		if( typeof(update_audio_player) != "undefined" ) // Update the 1 px out player...
			update_audio_player();
	});
	
	jQuery('.other_field').bind('change', function () {
		if( typeof(update_audio_player) != "undefined" ) // Update the 1 px out player...
			update_audio_player();
	});

});
//-->
</script>


<!-- special page styling goes here -->
<style type="text/css">
div.color_control { display: block; float:left; width: 100%; padding:  0; }
div.color_control input { display: inline; float: left; }
div.color_control div.color_picker { display: inline; float: left; margin-top: 3px; }
#player_preview { margin-bottom: 0px; height: 50px; margin-top: 8px;}
input#colorpicker-value-input {
	width: 60px;
	height: 16px;
	padding: 0;
	margin: 0;
	font-size: 12px;
	border-spacing: 0;
	border-width: 0;
}
table.html5formats {
	width: 600px;
	margin: 0;
	padding: 0;
}
table.html5formats tr {
	margin: 0;
	padding: 0;
}
table.html5formats tr th {
	font-weight: bold;
	border-bottom: 1px solid #000000;
	margin: 0;
	padding: 0 5px;
	width: 25%;
}
table.html5formats tr td {
	
	border-right: 1px solid #000000;
	border-bottom: 1px solid #000000;
	margin: 0;
	padding: 0 10px;
}
table.html5formats tr > td:first-child {
	border-left: 1px solid #000000;
}
</style>
<?php 
    // mainly 2 pages, first page selects a player, second configures the player, if there are optiosn to configure for that player. If the user is on the second page,
    // a link should be provided to select a different player.
    if ($select_player) {
        ?>
<input type="hidden" name="action" value="powerpress-select-player" />
<h2><?php 
        echo __('Blubrry PowerPress Player Options', 'powerpress');
        ?>
</h2>
<p style="margin-bottom: 0;"><?php 
        echo __('Select the media player you would like to use.', 'powerpress');
        ?>
</p>

<?php 
        if ($type == 'video') {
            if (empty($General['video_player'])) {
                $General['video_player'] = '';
            }
            ?>
<table class="form-table">
<tr valign="top">
<th scope="row">&nbsp;</th>  
<td>
	<ul>
		<li><label><input type="radio" name="VideoPlayer[video_player]" id="player_mediaelement_video" value="mediaelement-video" <?php 
            if ($General['video_player'] == 'mediaelement-video') {
                echo 'checked';
            }
            ?>
 />
		<?php 
            echo __('MediaElement.js Media Player (default)', 'powerpress');
            ?>
</label>
			 <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_mediaelement_video" class="activate-player"><?php 
            echo __('Activate and Configure Now', 'powerpress');
            ?>
</a></strong>
		</li>
		<li style="margin-left: 30px; margin-bottom:16px;">
			<div style="max-width: 70%;">
				<div class="powerpressadmin-mejs-video">
<?php 
            echo powerpressplayer_build_mediaelementvideo($Video['mediaelement-video']);
            ?>
				</div>
			</div>
			<?php 
            powerpressplayer_mediaelement_info();
            ?>
		</li>

		<li><label><input type="radio" name="VideoPlayer[video_player]" id="player_html5video" value="html5video" <?php 
            if ($General['video_player'] == 'html5video') {
                echo 'checked';
            }
            ?>
 /> <?php 
            echo __('HTML5 Video Player', 'powerpress');
            ?>
  </label>
			<strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_html5video" class="activate-player"><?php 
            echo __('Activate and Configure Now', 'powerpress');
            ?>
</a></strong>
		</li>
		<li style="margin-left: 30px; margin-bottom:16px;">
			<p>
            <?php 
            echo powerpressplayer_build_html5video($Video['html5video']);
            ?>
			</p>
			<p>
				<?php 
            echo __('HTML5 Video is an element introduced in the latest HTML specification (HTML5) for the purpose of playing videos.', 'powerpress');
            ?>
			</p>
		</li>
		
		<!-- videojs-html5-video-player-for-wordpress -->
		<li><label><input type="radio" name="VideoPlayer[video_player]" id="player_videojs_html5_video_player_for_wordpress" value="videojs-html5-video-player-for-wordpress" <?php 
            if ($General['video_player'] == 'videojs-html5-video-player-for-wordpress') {
                echo 'checked';
            }
            ?>
 <?php 
            echo function_exists('add_videojs_header') ? '' : 'disabled';
            ?>
 />
		<?php 
            echo __('VideoJS', 'powerpress');
            ?>
</label> 
		<?php 
            if (function_exists('add_videojs_header')) {
                ?>
			 <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_videojs_html5_video_player_for_wordpress" class="activate-player"><?php 
                echo __('Activate and Configure Now', 'powerpress');
                ?>
</a></strong>
		<?php 
            }
            ?>
		</li>
		<li style="margin-left: 30px; margin-bottom:16px;">
			<p>
<?php 
            if (function_exists('add_videojs_header')) {
                echo powerpressplayer_build_videojs($Video['videojs-html5-video-player-for-wordpress']);
            }
            ?>
			</p>
<?php 
            powerpressplayer_videojs_info();
            ?>
		</li>
		
	</ul>

</td>
</tr>
</table>
<?php 
        } else {
            ?>
<table class="form-table">
<tr valign="top">
<th scope="row">&nbsp;</th>  
<td>
	<ul>

		<li><label><input type="radio" name="Player[player]" id="player_mediaelement_audio" value="mediaelement-audio" <?php 
            if ($General['player'] == 'mediaelement-audio') {
                echo 'checked';
            }
            ?>
 />
		<?php 
            echo __('MediaElement.js Media Player (default)', 'powerpress');
            ?>
</label> 
			 <strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_mediaelement_audio" class="activate-player"><?php 
            echo __('Activate and Configure Now', 'powerpress');
            ?>
</a></strong>
		</li>
		<li style="margin-left: 30px; margin-bottom:16px;">
			<p>
<?php 
            echo powerpressplayer_build_mediaelementaudio($Audio['mediaelement-audio']);
            ?>
			</p>
			<?php 
            powerpressplayer_mediaelement_info();
            ?>
			<div style="margin: 30px 0;">
			<?php 
            powerpresspartner_clammr_info(false);
            ?>
			</div>
		</li>
	
		<li><label><input type="radio" name="Player[player]" id="player_html5audio" value="html5audio" <?php 
            if ($General['player'] == 'html5audio') {
                echo 'checked';
            }
            ?>
 /> <?php 
            echo __('HTML5 Audio Player', 'powerpress');
            ?>
  </label>
			<strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_html5audio" class="activate-player"><?php 
            echo __('Activate and Configure Now', 'powerpress');
            ?>
</a></strong>
		</li>
		<li style="margin-left: 30px; margin-bottom:16px;">
			<p>
			<?php 
            echo powerpressplayer_build_html5audio($Audio['html5audio']);
            ?>
			</p>
			<p>
				<?php 
            echo __('HTML5 audio is an element introduced in the latest HTML specification (HTML5) for the purpose of playing audio.', 'powerpress');
            ?>
			</p>
		</li>
				
		<li><label><input type="radio" name="Player[player]" id="player_audio_player" value="audio-player" <?php 
            if ($General['player'] == 'audio-player') {
                echo 'checked';
            }
            ?>
 /> <?php 
            echo __('1 Pixel Out Audio Player', 'powerpress');
            ?>
</label>
			<strong style="padding-top: 8px; margin-left: 20px;"><a href="#" id="activate_audio_player" class="activate-player"><?php 
            echo __('Activate and Configure Now', 'powerpress');
            ?>
</a></strong>
		</li>
		<li>
			<div class="updated fade powerpress-notice inline">
			<?php 
            echo __('NOTICE: Flash based players are no longer recommended. We highly recommend picking an HTM5 based player.', 'powerpress');
            ?>
			</div>
		</li>
		<li style="margin-left: 30px; margin-bottom:16px;">
			<p>
				<?php 
            echo powerpressplayer_build_1pxoutplayer($Audio['audio-player']);
            ?>
			</p>
			<p>
				<?php 
            echo __('1 Pixel Out Audio Player is a popular customizable audio (mp3 only) flash player. Features include an animated play/pause button, scroll-able position bar, elapsed/remaining time, volume control and color styling options.', 'powerpress');
            ?>
			</p>
		</li>
		
	</ul>

</td>
</tr>
</table>
<?php 
        }
        ?>
<h4 style="margin-bottom: 0;"><?php 
        echo __('Click \'Save Changes\' to activate and configure selected player.', 'powerpress');
        ?>
</h4>
<?php 
    } else {
        ?>
<h2><?php 
        echo __('Configure Player', 'powerpress');
        ?>
</h2>
<?php 
        if ($type == 'audio') {
            ?>
<p style="margin-bottom: 20px;"><strong>&#8592;  <a href="<?php 
            echo admin_url("admin.php?page=powerpress/powerpressadmin_player.php&amp;sp=1");
            ?>
"><?php 
            echo __('Select a different audio player', 'powerpress');
            ?>
</a></strong></p>
<?php 
        } else {
            if ($type == 'video') {
                ?>
<p style="margin-bottom: 20px;"><strong>&#8592;  <a href="<?php 
                echo admin_url("admin.php?page=powerpress/powerpressadmin_videoplayer.php&amp;sp=1");
                ?>
"><?php 
                echo __('Select a different video player', 'powerpress');
                ?>
</a></strong></p>
<?php 
            } else {
                ?>
<p style="margin-bottom: 20px;"><strong>&#8592;  <a href="<?php 
                echo admin_url("admin.php?page=powerpress/powerpressadmin_mobileplayer.php&amp;sp=1");
                ?>
"><?php 
                echo __('Select a different mobile player', 'powerpress');
                ?>
</a></strong></p>
<?php 
            }
        }
        // Start adding logic here to display options based on the player selected...
        if ($type == 'audio') {
            if (empty($General['player'])) {
                $General['player'] = '';
            }
            switch ($General['player']) {
                case 'audio-player':
                    $PlayerSettings = powerpress_get_settings('powerpress_audio-player');
                    if ($PlayerSettings == "") {
                        $PlayerSettings = array('width' => '290', 'transparentpagebg' => 'yes', 'lefticon' => '#333333', 'leftbg' => '#CCCCCC', 'bg' => '#E5E5E5', 'voltrack' => '#F2F2F2', 'volslider' => '#666666', 'rightbg' => '#B4B4B4', 'rightbghover' => '#999999', 'righticon' => '#333333', 'righticonhover' => '#FFFFFF', 'loader' => '#009900', 'track' => '#FFFFFF', 'tracker' => '#DDDDDD', 'border' => '#CCCCCC', 'skip' => '#666666', 'text' => '#333333', 'pagebg' => '', 'rtl' => 'no', 'initialvolume' => '60', 'animation' => 'yes', 'remaining' => 'no');
                    }
                    if (empty($PlayerSettings['remaining'])) {
                        $PlayerSettings['remaining'] = 'no';
                    }
                    // New default setting
                    if (!isset($PlayerSettings['buffer'])) {
                        $PlayerSettings['buffer'] = '';
                    }
                    // New default setting
                    if (!isset($PlayerSettings['titles'])) {
                        $PlayerSettings['titles'] = '';
                    }
                    ?>
<script type="text/javascript"><!--

function update_audio_player()
{
	var myParams = new Array("lefticon","leftbg", "bg", "voltrack", "rightbg", "rightbghover", "righticon", "righticonhover", "loader", "track", "tracker", "border", "skip", "text", "pagebg", "rtl", "animation", "titles", "initialvolume");
	var myWidth = document.getElementById('player_width').value;
	var myBackground = '';
	if( myWidth < 10 || myWidth > 900 )
		myWidth = 290;
	
	var out = '<object type="application/x-shockwave-flash" data="<?php 
                    echo powerpress_get_root_url();
                    ?>
audio-player.swf" width="'+myWidth+'" height="24">'+"\n";
	out += '    <param name="movie" value="<?php 
                    echo powerpress_get_root_url();
                    ?>
audio-player.swf" />'+"\n";
	out += '    <param name="FlashVars" value="playerID=1&amp;soundFile=<?php 
                    echo $Audio['audio-player'];
                    ?>
';
	
	var x = 0;
	for( x = 0; x < myParams.length; x++ )
	{
		if( myParams[ x ] == 'border' )
			var Element = document.getElementById( 'player_border' );
		else
			var Element = document.getElementById( myParams[ x ] );
		
		if( Element )
		{
			if( Element.value != '' )
			{
				out += '&amp;';
				out += myParams[ x ];
				out += '=';
				out += Element.value.replace(/^#/, '');
				if( myParams[ x ] == 'pagebg' )
				{
					myBackground = '<param name="bgcolor" value="'+ Element.value +'" />';
					out += '&amp;transparentpagebg=no';
				}
			}
			else
			{
				if( myParams[ x ] == 'pagebg' )
				{
					out += '&amp;transparentpagebg=yes';
					myBackground = '<param name="wmode" value="transparent" />';
				}
			}
		}
	}
	
	out += '" />'+"\n";
	out += '<param name="quality" value="high" />';
	out += '<param name="menu" value="false" />';
	out += myBackground;
	out += '</object>';
	
	var player = document.getElementById("player_preview");
	player.innerHTML = out;
}

function audio_player_defaults()
{
 	if( confirm('<?php 
                    echo __("Set defaults, are you sure?\\n\\nAll of the current settings will be overwritten!", 'powerpress');
                    ?>
') )
	{
		jQuery('#player_width').val('290');
		UpdatePlayerPreview('player_width',jQuery('#player_width').val() );
		
		jQuery('#transparentpagebg').val( 'yes');
		UpdatePlayerPreview('transparentpagebg',jQuery('#transparentpagebg').val() );
		
		jQuery('#lefticon').val( '#333333');
		UpdatePlayerPreview('lefticon',jQuery('#lefticon').val() );
		jQuery('#lefticon_prev'  ).css( { 'background-color' : '#333333' } );
		
		jQuery('#leftbg').val( '#CCCCCC');
		UpdatePlayerPreview('leftbg',jQuery('#leftbg').val() );
		jQuery('#leftbg_prev'  ).css( { 'background-color' : '#CCCCCC' } );
		
		jQuery('#bg').val( '#E5E5E5');
		UpdatePlayerPreview('bg',jQuery('#bg').val() );
		jQuery('#bg_prev'  ).css( { 'background-color' : '#E5E5E5' } );
		
		jQuery('#voltrack').val( '#F2F2F2');
		UpdatePlayerPreview('voltrack',jQuery('#voltrack').val() );
		jQuery('#voltrack_prev'  ).css( { 'background-color' : '#F2F2F2' } );
		
		jQuery('#volslider').val( '#666666');
		UpdatePlayerPreview('volslider',jQuery('#volslider').val() );
		jQuery('#volslider_prev'  ).css( { 'background-color' : '#666666' } );
		
		jQuery('#rightbg').val( '#B4B4B4');
		UpdatePlayerPreview('rightbg',jQuery('#rightbg').val() );
		jQuery('#rightbg_prev'  ).css( { 'background-color' : '#B4B4B4' } );
		
		jQuery('#rightbghover').val( '#999999');
		UpdatePlayerPreview('rightbghover',jQuery('#rightbghover').val() );
		jQuery('#rightbghover_prev'  ).css( { 'background-color' : '#999999' } );
		
		jQuery('#righticon').val( '#333333');
		UpdatePlayerPreview('righticon',jQuery('#righticon').val() );
		jQuery('#righticon_prev'  ).css( { 'background-color' : '#333333' } );
		
		jQuery('#righticonhover').val( '#FFFFFF');
		UpdatePlayerPreview('righticonhover',jQuery('#righticonhover').val() );
		jQuery('#righticonhover_prev'  ).css( { 'background-color' : '#FFFFFF' } );
		
		jQuery('#loader').val( '#009900');
		UpdatePlayerPreview('loader',jQuery('#loader').val() );
		jQuery('#loader_prev'  ).css( { 'background-color' : '#009900' } );
		
		jQuery('#track').val( '#FFFFFF');
		UpdatePlayerPreview('track',jQuery('#track').val() );
		jQuery('#track_prev'  ).css( { 'background-color' : '#FFFFFF' } );
		
		jQuery('#tracker').val( '#DDDDDD');
		UpdatePlayerPreview('tracker',jQuery('#tracker').val() );
		jQuery('#tracker_prev'  ).css( { 'background-color' : '#DDDDDD' } );
		
		jQuery('#player_border').val( '#CCCCCC');
		UpdatePlayerPreview('player_border',jQuery('#player_border').val() );
		jQuery('#player_border_prev'  ).css( { 'background-color' : '#CCCCCC' } );
		
		jQuery('#skip').val( '#666666');
		UpdatePlayerPreview('skip',jQuery('#skip').val() );
		jQuery('#skip_prev'  ).css( { 'background-color' : '#666666' } );
		
		jQuery('#text').val( '#333333');
		UpdatePlayerPreview('text',jQuery('#text').val() );
		jQuery('#text_prev'  ).css( { 'background-color' : '#333333' } );
		
		jQuery('#pagebg').val( '');
		UpdatePlayerPreview('pagebg',jQuery('#pagebg').val() );
		
		jQuery('#animation').val( 'yes');
		UpdatePlayerPreview('animation',jQuery('#animation').val() );
		
		jQuery('#remaining').val( 'no');
		UpdatePlayerPreview('remaining',jQuery('#remaining').val() );
		
		jQuery('#buffer').val( '');
		UpdatePlayerPreview('buffer',jQuery('#buffer').val() );
		
		jQuery('#rtl' ).val( 'no' );
		UpdatePlayerPreview('rtl',jQuery('#rtl').val() );
		
		jQuery('#initialvolume').val('60');
		UpdatePlayerPreview('initialvolume',jQuery('#initialvolume').val() );
		
		update_audio_player();
	}
}
//-->
</script>
	<input type="hidden" name="action" value="powerpress-audio-player" />
	<div class="updated fade powerpress-notice inline">
		<?php 
                    echo __('NOTICE: Flash based players are no longer recommended. We highly recommend picking an HTM5 based player.', 'powerpress');
                    ?>
	</div>
	<?php 
                    echo __('Configure the 1 pixel out Audio Player', 'powerpress');
                    ?>
	
	
<table class="form-table">
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Preview of Player', 'powerpress');
                    ?>
		</th>
		<td><div id="player_preview">
		<?php 
                    echo powerpressplayer_build_1pxoutplayer($Audio['audio-player'], array('nodiv' => true));
                    ?>
			</div>
		</td>
	</tr>
</table>

<div id="powerpress_settings_page" class="powerpress_tabbed_content" style="position: relative;">
	<div style="position: absolute; top: 6px; right:0px;">
		<a href="#" onclick="audio_player_defaults();return false;"><?php 
                    echo __('Set Defaults', 'powerpress');
                    ?>
</a>
	</div>
  <ul class="powerpress_settings_tabs"> 
		<li><a href="#tab_general"><span><?php 
                    echo __('Basic Settings', 'powerpress');
                    ?>
</span></a></li> 
		<li><a href="#tab_progress"><span><?php 
                    echo __('Progress Bar', 'powerpress');
                    ?>
</span></a></li> 
		<li><a href="#tab_volume"><span><?php 
                    echo __('Volume Button', 'powerpress');
                    ?>
</span></a></li>
		<li><a href="#tab_play"><span><?php 
                    echo __('Play / Pause Button', 'powerpress');
                    ?>
</span></a></li>
  </ul>
	
 <div id="tab_general" class="powerpress_tab">
 <h3><?php 
                    echo __('General Settings', 'powerpress');
                    ?>
</h3>
<table class="form-table">
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Page Background Color', 'powerpress');
                    ?>
                        
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="pagebg" name="Player[pagebg]" class="color_field" value="<?php 
                    echo esc_attr($PlayerSettings['pagebg']);
                    ?>
" maxlength="20" />
				<img id="pagebg_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['pagebg'];
                    ?>
;" class="color_preview" />
			</div>
			<small>(<?php 
                    echo __('leave blank for transparent', 'powerpress');
                    ?>
)</small>
		</td>
	</tr>	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Player Background Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="bg" name="Player[bg]" class="color_field" value="<?php 
                    echo esc_attr($PlayerSettings['bg']);
                    ?>
" maxlength="20" />
				<img id="bg_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['bg'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Width (in pixels)', 'powerpress');
                    ?>
		</th>
		<td>
          <input type="text" style="width: 50px;" id="player_width" name="Player[width]" class="other_field" value="<?php 
                    echo esc_attr($PlayerSettings['width']);
                    ?>
" maxlength="20" />
				<?php 
                    echo __('width of the player. e.g. 290 (290 pixels) or 100%', 'powerpress');
                    ?>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Right-to-Left', 'powerpress');
                    ?>
		</th>
		<td>
			<select style="width: 102px;" id="rtl" name="Player[rtl]" class="other_field"> 
<?php 
                    $options = array('yes' => __('Yes', 'powerpress'), 'no' => __('No', 'powerpress'));
                    powerpress_print_options($options, $PlayerSettings['rtl']);
                    ?>
          </select>			<?php 
                    echo __('switches the layout to animate from the right to the left', 'powerpress');
                    ?>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Loading Bar Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="loader" name="Player[loader]" class="color_field" value="<?php 
                    echo esc_attr($PlayerSettings['loader']);
                    ?>
" maxlength="20" />
				<img id="loader_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['loader'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Text Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
                <input type="text" style="width: 100px;" id="text" name="Player[text]" class="color_field" value="<?php 
                    echo esc_attr($PlayerSettings['text']);
                    ?>
" maxlength="20" />
						<img id="text_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['text'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Text In Player', 'powerpress');
                    ?>
 
		</th>
		<td>
          <div><input type="text" style="width: 60%;" id="titles" name="Player[titles]" class="other_field" value="<?php 
                    echo esc_attr($PlayerSettings['titles']);
                    ?>
" maxlength="100" /></div>
				<small><?php 
                    echo sprintf(__('Enter \'%s\' to display track name from mp3. Only works if media is hosted on same server as blog.', 'powerpress'), __('TRACK', 'powerpress'));
                    ?>
</small>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Play Animation', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
<select style="width: 102px;" id="animation" name="Player[animation]" class="other_field"> 
<?php 
                    $options = array('yes' => __('Yes', 'powerpress'), 'no' => __('No', 'powerpress'));
                    powerpress_print_options($options, $PlayerSettings['animation']);
                    ?>
                                </select>			<?php 
                    echo __('if no, player is always open', 'powerpress');
                    ?>
</div>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Display Remaining Time', 'powerpress');
                    ?>
 
		</th>
		<td>
			<div class="color_control">
<select style="width: 102px;" id="remaining" name="Player[remaining]" class="other_field">
<?php 
                    $options = array('yes' => __('Yes', 'powerpress'), 'no' => __('No', 'powerpress'));
                    powerpress_print_options($options, $PlayerSettings['remaining']);
                    ?>
                                </select>			<?php 
                    echo __('if yes, shows remaining track time rather than elapsed time (default: no)', 'powerpress');
                    ?>
</div>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Buffering Time', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
<select style="width: 200px;" id="buffer" name="Player[buffer]" class="other_field"> 
<?php 
                    $options = array('0' => __('No buffering', 'powerpress'), '' => __('Default (5 seconds)', 'powerpress'), '10' => __('10 seconds', 'powerpress'), '15' => __('15 seconds', 'powerpress'), '20' => __('20 seconds', 'powerpress'), '30' => __('30 seconds', 'powerpress'), '60' => __('60 seconds', 'powerpress'));
                    powerpress_print_options($options, $PlayerSettings['buffer']);
                    ?>
                                </select>		<?php 
                    echo __('buffering time in seconds', 'powerpress');
                    ?>
</div>
		</td>
	</tr>
	
	
</table>
</div>

 <div id="tab_progress" class="powerpress_tab">
	<h3><?php 
                    echo __('Progress Bar', 'powerpress');
                    ?>
</h3>
<table class="form-table">
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Progress Bar Background', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
										<input type="text" style="width: 100px;" id="track" name="Player[track]" class="color_field" value="<?php 
                    echo esc_attr($PlayerSettings['track']);
                    ?>
" maxlength="20" />
										<img id="track_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['track'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Progress Bar Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
                            <input type="text" style="width: 100px;" id="tracker" name="Player[tracker]" class="color_field" value="<?php 
                    echo esc_attr($PlayerSettings['tracker']);
                    ?>
" maxlength="20" />
											<img id="tracker_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['tracker'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Progress Bar Border', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
                            <input type="text" style="width: 100px;" id="player_border" name="Player[border]" class="color_field" value="<?php 
                    echo esc_attr($PlayerSettings['border']);
                    ?>
" maxlength="20" />
											<img id="player_border_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['border'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>       
	</table>
	</div>
	
	
<div id="tab_volume" class="powerpress_tab">
	<h3><?php 
                    echo __('Volume Button Settings', 'powerpress');
                    ?>
</h3>
	<table class="form-table">	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Initial Volume', 'powerpress');
                    ?>
 
		</th>
		<td>
			<select style="width: 100px;" id="initialvolume" name="Player[initialvolume]" class="other_field">
<?php 
                    for ($x = 0; $x <= 100; $x += 5) {
                        echo '<option value="' . $x . '"' . ($PlayerSettings['initialvolume'] == $x ? ' selected' : '') . '>' . $x . '%</option>';
                    }
                    ?>
			</select> <?php 
                    echo __('initial volume level (default: 60)', 'powerpress');
                    ?>
		</td>
	</tr>
				
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Volumn Background Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="leftbg" name="Player[leftbg]" class="color_field" value="<?php 
                    echo esc_attr($PlayerSettings['leftbg']);
                    ?>
" maxlength="20" />
				<img id="leftbg_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['leftbg'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Speaker Icon Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="lefticon" name="Player[lefticon]" class="color_field" value="<?php 
                    echo esc_attr($PlayerSettings['lefticon']);
                    ?>
" maxlength="20" />
				<img id="lefticon_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['lefticon'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Volume Icon Background', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="voltrack" name="Player[voltrack]" class="color_field" value="<?php 
                    echo esc_attr($PlayerSettings['voltrack']);
                    ?>
" maxlength="20" />
				<img id="voltrack_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['voltrack'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Volume Slider Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="volslider" name="Player[volslider]" class="color_field" value="<?php 
                    echo esc_attr($PlayerSettings['volslider']);
                    ?>
" maxlength="20" />
				<img id="volslider_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['volslider'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
</table>
</div>

<div id="tab_play" class="powerpress_tab">
	<h3><?php 
                    echo __('Play / Pause Button Settings', 'powerpress');
                    ?>
</h3>
	<table class="form-table">	
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Play/Pause Background Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="rightbg" name="Player[rightbg]" class="color_field" value="<?php 
                    echo esc_attr($PlayerSettings['rightbg']);
                    ?>
" maxlength="20" />
				<img id="rightbg_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['rightbg'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Play/Pause Hover Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="rightbghover" name="Player[rightbghover]" class="color_field" value="<?php 
                    echo esc_attr($PlayerSettings['rightbghover']);
                    ?>
" maxlength="20" />
				<img id="rightbghover_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['rightbghover'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Play/Pause Icon Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="righticon" name="Player[righticon]" class="color_field" value="<?php 
                    echo esc_attr($PlayerSettings['righticon']);
                    ?>
" maxlength="20" />
				<img id="righticon_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['righticon'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Play/Pause Icon Hover Color', 'powerpress');
                    ?>
		</th>
		<td>
			<div class="color_control">
				<input type="text" style="width: 100px;" id="righticonhover" name="Player[righticonhover]" class="color_field" value="<?php 
                    echo esc_attr($PlayerSettings['righticonhover']);
                    ?>
" maxlength="20" />
				<img id="righticonhover_prev" src="<?php 
                    echo powerpress_get_root_url();
                    ?>
images/color_preview.gif" width="14" height="14" style="background-color: <?php 
                    echo $PlayerSettings['righticonhover'];
                    ?>
;" class="color_preview" />
			</div>
		</td>
	</tr>

</table>
</div> <!-- end tab -->
</div> <!-- end tab wrapper -->

<?php 
                    break;
                case 'html5audio':
                    $SupportUploads = powerpressadmin_support_uploads();
                    ?>
<p><?php 
                    echo __('Configure HTML5 Audio Player', 'powerpress');
                    ?>
</p>
<table class="form-table">
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Preview of Player', 'powerpress');
                    ?>
 
		</th>
		<td>
			<p>
<?php 
                    echo powerpressplayer_build_html5audio($Audio['html5audio']);
                    ?>
			</p>
		</td>
	</tr>

	
	<tr>
	<th scope="row">
	<?php 
                    echo __('Play Icon', 'powerpress');
                    ?>
</th>
	<td>

	<input type="text" id="audio_custom_play_button" name="General[audio_custom_play_button]" style="width: 60%;" value="<?php 
                    echo esc_attr($General['audio_custom_play_button']);
                    ?>
" maxlength="255" />
	<a href="#" onclick="javascript: window.open( document.getElementById('audio_custom_play_button').value ); return false;"><?php 
                    echo __('preview', 'powerpress');
                    ?>
</a>

	<p><?php 
                    echo __('Place the URL to the play icon above.', 'powerpress');
                    ?>
 <?php 
                    echo __('Example', 'powerpress');
                    ?>
: http://example.com/images/audio_play_icon.jpg<br /><br />
	<?php 
                    echo __('Leave blank to use default play icon image.', 'powerpress');
                    ?>
</p>

	<?php 
                    if ($SupportUploads) {
                        ?>
	<p><input name="audio_custom_play_button_checkbox" type="checkbox" onchange="powerpress_show_field('audio_custom_play_button_upload', this.checked)" value="1" /> <?php 
                        echo __('Upload new image', 'powerpress');
                        ?>
 </p>
	<div style="display:none" id="audio_custom_play_button_upload">
		<label for="audio_custom_play_button_file"><?php 
                        echo __('Choose file', 'powerpress');
                        ?>
:</label><input type="file" name="audio_custom_play_button_file"  />
	</div>
	<?php 
                    }
                    ?>
	</td>
	</tr>
</table>

<?php 
                    break;
                case 'mediaelement-audio':
                    $SupportUploads = powerpressadmin_support_uploads();
                    if (!isset($General['audio_player_max_width'])) {
                        $General['audio_player_max_width'] = '';
                    }
                    ?>
<p><?php 
                    echo __('Configure MediaElement.js Audio Player', 'powerpress');
                    ?>
</p>
<table class="form-table">
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Preview of Player', 'powerpress');
                    ?>
		</th>
		<td><p>
		<?php 
                    // TODO
                    echo powerpressplayer_build_mediaelementaudio($Audio['mediaelement-audio']);
                    ?>
			</p>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Max Width', 'powerpress');
                    ?>
   
		</th>
		<td valign="top">
				<input type="text" style="width: 50px;" id="audio_player_max_width" name="General[audio_player_max_width]" class="player-width" value="<?php 
                    echo esc_attr($General['audio_player_max_width']);
                    ?>
" maxlength="4" />
			<?php 
                    echo __('Width of Audio mp3 player (leave blank for max width)', 'powerpress');
                    ?>
			<?php 
                    powerpresspartner_clammr_info();
                    ?>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row">
			&nbsp;
		</th>
		<td>
			<p><?php 
                    echo __('MediaElement.js Player has no additional settings at this time.', 'powerpress');
                    ?>
</p>
		</td>
	</tr>
</table>  

<?php 
                    break;
                    // TODO:
                // TODO:
                default:
                    if (empty($General['player_width_audio'])) {
                        $General['player_width_audio'] = '';
                    }
                    ?>

<h2><?php 
                    echo __('General Settings', 'powerpress');
                    ?>
</h2>
	<table class="form-table">
        <tr valign="top">
		<th scope="row">
			<?php 
                    echo __('Width', 'powerpress');
                    ?>
   
		</th>
		<td valign="top">
				<input type="text" style="width: 50px;" id="player_width" name="General[player_width_audio]" class="player-width" value="<?php 
                    echo esc_attr($General['player_width_audio']);
                    ?>
" maxlength="4" />
			<?php 
                    echo __('Width of Audio mp3 player (leave blank for 320 default)', 'powerpress');
                    ?>
		</td>
	</tr>
</table>
<?php 
                    break;
            }
        } else {
            if ($type == 'video') {
                $player_to_configure = !empty($General['video_player']) ? $General['video_player'] : '';
                switch ($player_to_configure) {
                    case 'html5':
                    case 'html5video':
                        echo '<p>' . __('Configure HTML5 Video Player', 'powerpress') . '</p>';
                        ?>
<table class="form-table">
	<tr valign="top">
		<th scope="row">
			<?php 
                        echo __('Preview of Player', 'powerpress');
                        ?>
 
		</th>
		<td>
		<?php 
                        if ($type == 'mobile') {
                            echo '<p>' . __('Audio:', 'powerpress') . ' ';
                            echo powerpressplayer_build_html5audio($Audio['html5audio']);
                            echo '</p>';
                        }
                        ?>
			<p>
<?php 
                        if ($type == 'mobile') {
                            echo __('Video:', 'powerpress') . ' ';
                        }
                        echo powerpressplayer_build_html5video($Video['html5video']);
                        ?>
			</p>
		</td>
	</tr>
</table>

					<?php 
                        break;
                    case 'videojs-html5-video-player-for-wordpress':
                        ?>
					<p><?php 
                        echo __('Configure VideoJS', 'powerpress');
                        ?>
</p>
<table class="form-table">
	<tr valign="top">
		<th scope="row">
			<?php 
                        echo __('Preview of Player', 'powerpress');
                        ?>
 
		</th>
		<td>
			<p>
<?php 
                        echo powerpressplayer_build_videojs($Video['videojs-html5-video-player-for-wordpress']);
                        ?>
			</p>
		</td>
	</tr>
</table>
<h3><?php 
                        echo __('VideoJS Settings', 'powerpress');
                        ?>
</h3>
<table class="form-table">
<tr valign="top">
<th scope="row">
<?php 
                        echo __('VideoJS CSS Class', 'powerpress');
                        ?>
</th>
<td>
<p>
<input type="text" name="General[videojs_css_class]" style="width: 150px;" value="<?php 
                        echo empty($General['videojs_css_class']) ? '' : esc_attr($General['videojs_css_class']);
                        ?>
" /> 
<?php 
                        echo __('Apply specific CSS styling to your Video JS player.', 'powerpress');
                        ?>
</p>
</td>
</tr>
</table>
					<?php 
                        break;
                    case 'mejs':
                        // $player_to_configure
                    // $player_to_configure
                    case 'mediaelement-video':
                    default:
                        ?>
					<p><?php 
                        echo __('Configure MediaElement.js Player', 'powerpress');
                        ?>
</p>
<table class="form-table">
	<tr valign="top">
		<th scope="row">
			<?php 
                        echo __('Preview of Player', 'powerpress');
                        ?>
 
		</th>
		<td>
			<p>
			<?php 
                        if ($type == 'mobile') {
                            echo '<p>' . __('Audio:', 'powerpress') . ' ';
                            echo powerpressplayer_build_mediaelementaudio($Audio['mediaelement-audio']);
                            echo '</p>';
                        }
                        ?>
			</p>
			<div style="max-width: 70%;">
				<div class="powerpressadmin-mejs-video">
<?php 
                        if ($type == 'mobile') {
                            echo __('Video:', 'powerpress') . ' ';
                        }
                        echo powerpressplayer_build_mediaelementvideo($Video['mediaelement-video']);
                        ?>
				</div>
			</div>
		</td>
	</tr>
</table>

					<?php 
                        break;
                }
                if (!isset($General['poster_play_image'])) {
                    $General['poster_play_image'] = 1;
                }
                if (!isset($General['poster_image_audio'])) {
                    $General['poster_image_audio'] = 0;
                }
                if (!isset($General['player_width'])) {
                    $General['player_width'] = '';
                }
                if (!isset($General['player_height'])) {
                    $General['player_height'] = '';
                }
                if (!isset($General['poster_image'])) {
                    $General['poster_image'] = '';
                }
                if (!isset($General['video_player_max_width'])) {
                    $General['video_player_max_width'] = '';
                }
                if (!isset($General['video_player_max_height'])) {
                    $General['video_player_max_height'] = '';
                }
                if (!isset($General['video_custom_play_button'])) {
                    $General['video_custom_play_button'] = '';
                }
                ?>
<!-- Global Video Player settings (Appy to all video players -->
<input type="hidden" name="action" value="powerpress-save-videocommon" />
<h3><?php 
                echo __('Common Video Settings', 'powerpress');
                ?>
</h3>

<p><?php 
                echo __('The following video settings apply to the video player above as well as to classic video &lt;embed&gt; formats such as Microsoft Windows Media (.wmv), QuickTime (.mov) and RealPlayer.', 'powerpress');
                ?>
</p>
<table class="form-table">
<?php 
                if ($player_to_configure == 'mediaelement-video' || $player_to_configure == 'mejs') {
                    ?>
<tr valign="top">
<th scope="row">
<?php 
                    echo __('Player Width', 'powerpress');
                    ?>
</th>
<td>
<input type="text" name="General[player_width]" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9%]/g, '');" value="<?php 
                    echo esc_attr($General['player_width']);
                    ?>
" maxlength="4" />
<?php 
                    echo __('Width of player (leave blank for default width)', 'powerpress');
                    ?>
</td>
</tr>

<tr valign="top">
<th scope="row">
<?php 
                    echo __('Player Height', 'powerpress');
                    ?>
</th>
<td>
<input type="text" name="General[player_height]" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9%]/g, '');" value="<?php 
                    echo esc_attr($General['player_height']);
                    ?>
" maxlength="4" />
<?php 
                    echo __('Height of player (leave blank for default height)', 'powerpress');
                    ?>
</td>
</tr>
<?php 
                } else {
                    ?>
<tr valign="top">
<th scope="row">
<?php 
                    echo __('Player Width', 'powerpress');
                    ?>
</th>
<td>
<input type="text" name="General[player_width]" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9%]/g, '');" value="<?php 
                    echo esc_attr($General['player_width']);
                    ?>
" maxlength="4" />
<?php 
                    echo __('Width of player (leave blank for 400 default)', 'powerpress');
                    ?>
</td>
</tr>

<tr valign="top">
<th scope="row">
<?php 
                    echo __('Player Height', 'powerpress');
                    ?>
</th>
<td>
<input type="text" name="General[player_height]" style="width: 50px;" onkeyup="javascript:this.value=this.value.replace(/[^0-9%]/g, '');" value="<?php 
                    echo esc_attr($General['player_height']);
                    ?>
" maxlength="4" />
<?php 
                    echo __('Height of player (leave blank for 225 default)', 'powerpress');
                    ?>
</td>
</tr>
<?php 
                }
                $SupportUploads = powerpressadmin_support_uploads();
                ?>
<tr>
<th scope="row">
<?php 
                echo __('Default Poster Image', 'powerpress');
                ?>
</th>
<td>

<input type="text" id="poster_image" name="General[poster_image]" style="width: 60%;" value="<?php 
                echo esc_attr($General['poster_image']);
                ?>
" maxlength="255" />
<a href="#" onclick="javascript: window.open( document.getElementById('poster_image').value ); return false;"><?php 
                echo __('preview', 'powerpress');
                ?>
</a>

<p><?php 
                echo __('Place the URL to the poster image above.', 'powerpress');
                ?>
 <?php 
                echo __('Example', 'powerpress');
                ?>
: http://example.com/images/poster.jpg<br /><br />
<?php 
                echo __('Image should be at minimum the same width/height as the player above. Leave blank to use default black background image.', 'powerpress');
                ?>
</p>

<?php 
                if ($SupportUploads) {
                    ?>
<p><input name="poster_image_checkbox" type="checkbox" onchange="powerpress_show_field('poster_image_upload', this.checked)" value="1" /> <?php 
                    echo __('Upload new image', 'powerpress');
                    ?>
 </p>
<div style="display:none" id="poster_image_upload">
	<label for="poster_image_file"><?php 
                    echo __('Choose file', 'powerpress');
                    ?>
:</label><input type="file" name="poster_image_file"  />
</div>
<?php 
                }
                if (in_array($General['video_player'], array('html5video'))) {
                    ?>
<p><input name="General[poster_play_image]" type="checkbox" value="1" <?php 
                    echo $General['poster_play_image'] ? 'checked' : '';
                    ?>
 /> <?php 
                    echo __('Include play icon over poster image when applicable', 'powerpress');
                    ?>
 </p>
	<?php 
                    if ($type == 'video') {
                        ?>
<p><input name="General[poster_image_audio]" type="checkbox" value="1" <?php 
                        echo $General['poster_image_audio'] ? 'checked' : '';
                        ?>
 /> <?php 
                        echo __('Use poster image, player width and height above for audio (Flow Player only)', 'powerpress');
                        ?>
 </p>
	<?php 
                    }
                }
                ?>
</td>
</tr>

<?php 
                // Play icon, only applicable to HTML5/FlowPlayerClassic
                if (in_array($General['video_player'], array('html5video'))) {
                    ?>
<tr>
<th scope="row">
<?php 
                    echo __('Video Play Icon', 'powerpress');
                    ?>
</th>
<td>

<input type="text" id="video_custom_play_button" name="General[video_custom_play_button]" style="width: 60%;" value="<?php 
                    echo esc_attr($General['video_custom_play_button']);
                    ?>
" maxlength="255" />
<a href="#" onclick="javascript: window.open( document.getElementById('video_custom_play_button').value ); return false;"><?php 
                    echo __('preview', 'powerpress');
                    ?>
</a>

<p><?php 
                    echo __('Place the URL to the play icon above.', 'powerpress');
                    ?>
 <?php 
                    echo __('Example', 'powerpress');
                    ?>
: http://example.com/images/video_play_icon.jpg<br /><br />
<?php 
                    echo __('Image should 60 pixels by 60 pixels. Leave blank to use default play icon image.', 'powerpress');
                    ?>
</p>

<?php 
                    if ($SupportUploads) {
                        ?>
<p><input name="video_custom_play_button_checkbox" type="checkbox" onchange="powerpress_show_field('video_custom_play_button_upload', this.checked)" value="1" /> <?php 
                        echo __('Upload new image', 'powerpress');
                        ?>
 </p>
<div style="display:none" id="video_custom_play_button_upload">
	<label for="video_custom_play_button_file"><?php 
                        echo __('Choose file', 'powerpress');
                        ?>
:</label><input type="file" name="video_custom_play_button_file"  />
</div>
<?php 
                    }
                    ?>
</td>
</tr>
<?php 
                }
                ?>
</table>
<?php 
            }
        }
        ?>

<?php 
    }
}
Exemplo n.º 12
0
function powerpressadmin_community_news($items = 3)
{
    require_once POWERPRESS_ABSPATH . '/powerpress-player.php';
    // Include, if not included already
    $rss_items = powerpress_get_news(POWERPRESS_FEED_NEWS, $items);
    echo '<div class="powerpress-news-dashboard">';
    echo '<ul>';
    if (!$rss_items) {
        echo '<li>' . __('Error occurred retrieving news.', 'powerpress') . '</li>';
    } else {
        $first_item = true;
        while (list($null, $item) = each($rss_items)) {
            $enclosure = $item->get_enclosure();
            echo '<li>';
            echo '<a class="rsswidget" href="' . esc_url($item->get_permalink(), $protocolls = null, 'display') . '" target="_blank">' . esc_html($item->get_title()) . '</a>';
            echo ' <span class="rss-date">' . $item->get_date('F j, Y') . '</span>';
            echo '<div class="rssSummary">' . esc_html(powerpress_feed_text_limit(strip_tags($item->get_description()), 150)) . '</div>';
            if ($enclosure && !empty($enclosure->link)) {
                $poster_image = '';
                $poster_tag = $item->get_item_tags('http://www.rawvoice.com/rawvoiceRssModule/', 'poster');
                if ($poster_tag && !empty($poster_tag[0]['attribs']['']['url'])) {
                    $poster_image = $item->sanitize($poster_tag[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_TEXT);
                }
                $embed = '';
                $embed_tag = $item->get_item_tags('http://www.rawvoice.com/rawvoiceRssModule/', 'embed');
                if ($embed_tag && !empty($embed_tag[0]['data'])) {
                    $embed = $embed_tag[0]['data'];
                }
                // Only show an episode with the latest item
                if ($first_item && $embed) {
                    if (preg_match('/width="(\\d{1,4})"/i', $embed, $matches) && count($matches) > 1) {
                        $max_width = $matches[1];
                        $embed = preg_replace('/width="/i', 'style="max-width: ' . $max_width . 'px;" width="', $embed);
                    }
                    $embed = preg_replace('/width="(\\d{1,4})"/i', 'width="100%"', $embed);
                    echo '<div class="powerpressNewsPlayer">';
                    echo $embed;
                    echo '</div>';
                } else {
                    if ($first_item) {
                        $EpisodeData = array();
                        $EpisodeData['type'] = $enclosure->type;
                        $EpisodeData['duration'] = $enclosure->duration;
                        $EpisodeData['poster'] = $poster_image;
                        $EpisodeData['width'] = '100%';
                        $EpisodeData['custom_play_button'] = powerpress_get_root_url() . 'play_audio.png';
                        $ext = powerpressplayer_get_extension($enclosure->link);
                        switch ($ext) {
                            case 'mp4':
                            case 'm4v':
                            case 'webm':
                                echo '<div class="powerpressNewsPlayer powerpressadmin-mejs-video">';
                                echo powerpressplayer_build_mediaelementvideo($enclosure->link, $EpisodeData);
                                echo '</div>';
                                break;
                            case 'mp3':
                            case 'm4a':
                                echo '<div class="powerpressNewsPlayer">';
                                echo powerpressplayer_build_mediaelementaudio($enclosure->link, $EpisodeData);
                                echo '</div>';
                                break;
                        }
                    }
                }
                //echo '<div style="clear: both;"></div>';
            }
            echo '</li>';
            $first_item = false;
        }
    }
    echo '</ul>';
    echo '<br class="clear"/>';
    echo '<div style="margin-top:10px;border-top: 1px solid #ddd; padding-top: 10px; text-align:center;">';
    echo __('Subscribe:', 'powerpress');
    echo ' &nbsp; ';
    echo '<a href="http://www.powerpresspodcast.com/feed/"><img src="' . get_bloginfo('wpurl') . '/wp-includes/images/rss.png" alt="' . __('Blog', 'powerpress') . '" /> ' . __('Blog', 'powerpress') . '</a>';
    echo ' &nbsp; ';
    echo '<a href="http://www.powerpresspodcast.com/feed/podcast/"><img src="' . get_bloginfo('wpurl') . '/wp-includes/images/rss.png" alt="' . __('Podcast', 'powerpress') . '" /> ' . __('Podcast', 'powerpress') . '</a>';
    echo ' &nbsp; ';
    echo '<a href="https://itunes.apple.com/us/podcast/blubrry-powerpress-community/id430248099/"><img src="' . powerpress_get_root_url() . '/images/itunes_modern.png" alt="' . __('iTunes', 'powerpress') . '" /> ' . __('iTunes', 'powerpress') . '</a>';
    //echo ' &nbsp; &nbsp; ';
    echo '</div>';
    echo '</div>';
}
Exemplo n.º 13
0
function powerpress_init()
{
    $GeneralSettings = get_option('powerpress_general');
    if (empty($GeneralSettings['disable_appearance']) || $GeneralSettings['disable_appearance'] == false) {
        require_once POWERPRESS_ABSPATH . '/powerpress-player.php';
        powerpressplayer_init($GeneralSettings);
    }
    // Enable the playlist feature for PowerPress
    if (!empty($GeneralSettings['playlist_player'])) {
        require_once POWERPRESS_ABSPATH . '/powerpress-playlist.php';
    }
    if (defined('PODPRESS_VERSION') || isset($GLOBALS['podcasting_player_id']) || isset($GLOBALS['podcast_channel_active']) || defined('PODCASTING_VERSION')) {
        return false;
    }
    // Another podcasting plugin is enabled...
    // If we are to process podpress data..
    if (!empty($GeneralSettings['process_podpress'])) {
        powerpress_podpress_redirect_check();
    }
    // Add the podcast feeds;
    if (!defined('POWERPRESS_NO_PODCAST_FEED')) {
        add_feed('podcast', 'powerpress_do_podcast_feed');
    }
    if ($GeneralSettings && isset($GeneralSettings['custom_feeds']) && is_array($GeneralSettings['custom_feeds'])) {
        while (list($feed_slug, $feed_title) = each($GeneralSettings['custom_feeds'])) {
            if ($feed_slug != 'podcast') {
                add_feed($feed_slug, 'powerpress_do_podcast_feed');
            }
        }
    }
    if (!empty($GeneralSettings['posttype_podcasting'])) {
        // Loop through the posttype podcasting settings and set the feeds for the custom post type slugs...
        global $wp_rewrite;
        $FeedSlugPostTypesArray = get_option('powerpress_posttype-podcasting');
        // Changed field slightly so it does not conflict with a post type "podcasting"
        if ($FeedSlugPostTypesArray === false) {
            // Simple one-time fix...
            $FeedSlugPostTypesArray = get_option('powerpress_posttype_podcasting');
            if (empty($FeedSlugPostTypesArray)) {
                $FeedSlugPostTypesArray = array();
            }
            update_option('powerpress_posttype-podcasting', $FeedSlugPostTypesArray);
            if (!array_key_exists('title', $FeedSlugPostTypesArray)) {
                // AS long as it doesn't have post type specific settings...
                delete_option('powerpress_posttype_podcasting');
            }
        }
        if (empty($FeedSlugPostTypesArray)) {
            $FeedSlugPostTypesArray = array();
        }
        while (list($feed_slug, $FeedSlugPostTypes) = each($FeedSlugPostTypesArray)) {
            if (!in_array($feed_slug, $wp_rewrite->feeds)) {
                add_feed($feed_slug, 'powerpress_do_podcast_feed');
            }
        }
    }
    if (defined('GAWP_VERSION')) {
        add_filter('the_content', 'powerpress_yoast_gawp_fix', 120);
    }
    if (!empty($GeneralSettings['subscribe_links'])) {
        // 2 Subscribe page shortocde [powerpress_subscribe feedslug="podcast"]
        // 3 Subscribe sidebar widget: iTunes, RSS
        add_filter('powerpress_player_subscribe_links', 'powerpressplayer_link_subscribe_pre', 1, 3);
        add_filter('powerpress_player_subscribe_links', 'powerpressplayer_link_subscribe_post', 1000, 3);
    }
    wp_register_style('powerpress-subscribe-style', powerpress_get_root_url() . 'css/subscribe.css', array(), '20141021', 'all');
}
Exemplo n.º 14
0
function powerpress_rss2_head()
{
    global $powerpress_feed;
    if (!powerpress_is_podcast_feed()) {
        return;
    }
    // Not a feed we manage
    $feed_slug = get_query_var('feed');
    $cat_ID = get_query_var('cat');
    $Feed = get_option('powerpress_feed');
    // Get the main feed settings
    if (!empty($powerpress_feed['category'])) {
        $CustomFeed = get_option('powerpress_cat_feed_' . $powerpress_feed['category']);
        // Get the custom podcast feed settings saved in the database
        if ($CustomFeed) {
            $Feed = powerpress_merge_empty_feed_settings($CustomFeed, $Feed);
        }
    } else {
        if (!empty($powerpress_feed['term_taxonomy_id'])) {
            $CustomFeed = get_option('powerpress_taxonomy_' . $powerpress_feed['term_taxonomy_id']);
            // Get the taxonomy podcast settings saved in the database
            if ($CustomFeed) {
                $Feed = powerpress_merge_empty_feed_settings($CustomFeed, $Feed);
            }
        } else {
            if (powerpress_is_custom_podcast_feed()) {
                $CustomFeed = get_option('powerpress_feed_' . $feed_slug);
                // Get the custom podcast feed settings saved in the database
                $Feed = powerpress_merge_empty_feed_settings($CustomFeed, $Feed);
            }
        }
    }
    if (!isset($Feed['url']) || trim($Feed['url']) == '') {
        if (is_category()) {
            $Feed['url'] = get_category_link($cat_ID);
        } else {
            $Feed['url'] = get_bloginfo('url');
        }
    }
    $General = get_option('powerpress_general');
    // We made it this far, lets write stuff to the feed!
    echo '<!-- podcast_generator="Blubrry PowerPress/' . POWERPRESS_VERSION . '" ';
    if (isset($General['advanced_mode_2']) && empty($General['advanced_mode_2'])) {
        echo 'mode="simple" ';
    } else {
        echo 'mode="advanced" ';
    }
    echo '-->' . PHP_EOL;
    // add the itunes:new-feed-url tag to feed
    if (powerpress_is_custom_podcast_feed()) {
        if (!empty($Feed['itunes_new_feed_url'])) {
            $Feed['itunes_new_feed_url'] = str_replace('&amp;', '&', $Feed['itunes_new_feed_url']);
            echo "\t<itunes:new-feed-url>" . htmlspecialchars(trim($Feed['itunes_new_feed_url'])) . '</itunes:new-feed-url>' . PHP_EOL;
        }
    } else {
        if (!empty($Feed['itunes_new_feed_url']) && ($feed_slug == 'feed' || $feed_slug == 'rss2')) {
            $Feed['itunes_new_feed_url'] = str_replace('&amp;', '&', $Feed['itunes_new_feed_url']);
            echo "\t<itunes:new-feed-url>" . htmlspecialchars(trim($Feed['itunes_new_feed_url'])) . '</itunes:new-feed-url>' . PHP_EOL;
        }
    }
    if (!empty($Feed['itunes_summary'])) {
        echo "\t" . '<itunes:summary>' . powerpress_format_itunes_value($Feed['itunes_summary'], 'summary') . '</itunes:summary>' . PHP_EOL;
    } else {
        echo "\t" . '<itunes:summary>' . powerpress_format_itunes_value(get_bloginfo('description'), 'summary') . '</itunes:summary>' . PHP_EOL;
    }
    if (!empty($powerpress_feed['itunes_talent_name'])) {
        echo "\t<itunes:author>" . esc_html($powerpress_feed['itunes_talent_name']) . '</itunes:author>' . PHP_EOL;
    }
    if (!empty($powerpress_feed['explicit'])) {
        echo "\t" . '<itunes:explicit>' . $powerpress_feed['explicit'] . '</itunes:explicit>' . PHP_EOL;
    }
    if (!empty($Feed['itunes_block'])) {
        echo "\t<itunes:block>yes</itunes:block>" . PHP_EOL;
    }
    if (!empty($Feed['itunes_complete'])) {
        echo "\t<itunes:complete>yes</itunes:complete>" . PHP_EOL;
    }
    if (!empty($Feed['itunes_image'])) {
        echo "\t" . '<itunes:image href="' . esc_html(str_replace(' ', '+', $Feed['itunes_image']), 'double') . '" />' . PHP_EOL;
    } else {
        echo "\t" . '<itunes:image href="' . powerpress_get_root_url() . 'itunes_default.jpg" />' . PHP_EOL;
    }
    if (!empty($Feed['email'])) {
        echo "\t" . '<itunes:owner>' . PHP_EOL;
        echo "\t\t" . '<itunes:name>' . esc_html($powerpress_feed['itunes_talent_name']) . '</itunes:name>' . PHP_EOL;
        echo "\t\t" . '<itunes:email>' . esc_html($Feed['email']) . '</itunes:email>' . PHP_EOL;
        echo "\t" . '</itunes:owner>' . PHP_EOL;
        echo "\t" . '<managingEditor>' . esc_html($Feed['email'] . ' (' . $powerpress_feed['itunes_talent_name'] . ')') . '</managingEditor>' . PHP_EOL;
    }
    if (!empty($Feed['copyright'])) {
        // In case the user entered the copyright html version or the copyright UTF-8 or ASCII symbol or just (c)
        $Feed['copyright'] = str_replace(array('&copy;', '(c)', '(C)', chr(194) . chr(169), chr(169)), '&#xA9;', $Feed['copyright']);
        echo "\t" . '<copyright>' . esc_html($Feed['copyright']) . '</copyright>' . PHP_EOL;
    }
    if (!empty($Feed['itunes_subtitle'])) {
        echo "\t" . '<itunes:subtitle>' . powerpress_format_itunes_value($Feed['itunes_subtitle'], 'subtitle') . '</itunes:subtitle>' . PHP_EOL;
    } else {
        echo "\t" . '<itunes:subtitle>' . powerpress_format_itunes_value(get_bloginfo('description'), 'subtitle') . '</itunes:subtitle>' . PHP_EOL;
    }
    if (!empty($Feed['itunes_keywords'])) {
        echo "\t" . '<itunes:keywords>' . powerpress_format_itunes_value($Feed['itunes_keywords'], 'keywords') . '</itunes:keywords>' . PHP_EOL;
    }
    if (!empty($Feed['rss2_image']) || !empty($Feed['itunes_image'])) {
        if (!empty($Feed['rss2_image'])) {
            // If the RSS image is set, use it, otherwise use the iTunes image...
            $rss_image = $Feed['rss2_image'];
        } else {
            $rss_image = $Feed['itunes_image'];
        }
        echo "\t" . '<image>' . PHP_EOL;
        if (is_category() && !empty($Feed['title'])) {
            echo "\t\t" . '<title>' . esc_html(get_bloginfo_rss('name')) . '</title>' . PHP_EOL;
        } else {
            echo "\t\t" . '<title>' . esc_html(get_bloginfo_rss('name') . get_wp_title_rss()) . '</title>' . PHP_EOL;
        }
        echo "\t\t" . '<url>' . esc_html(str_replace(' ', '+', $rss_image)) . '</url>' . PHP_EOL;
        echo "\t\t" . '<link>' . $Feed['url'] . '</link>' . PHP_EOL;
        echo "\t" . '</image>' . PHP_EOL;
    } else {
        echo "\t" . '<image>' . PHP_EOL;
        if ((is_category() || is_tax() || is_tag()) && !empty($Feed['title'])) {
            echo "\t\t" . '<title>' . esc_html(get_bloginfo_rss('name')) . '</title>' . PHP_EOL;
        } else {
            echo "\t\t" . '<title>' . esc_html(get_bloginfo_rss('name') . get_wp_title_rss()) . '</title>' . PHP_EOL;
        }
        echo "\t\t" . '<url>' . powerpress_get_root_url() . 'rss_default.jpg</url>' . PHP_EOL;
        echo "\t\t" . '<link>' . $Feed['url'] . '</link>' . PHP_EOL;
        echo "\t" . '</image>' . PHP_EOL;
    }
    // Handle iTunes categories
    $Categories = powerpress_itunes_categories();
    $Cat1 = false;
    $Cat2 = false;
    $Cat3 = false;
    if (!empty($Feed['itunes_cat_1'])) {
        list($Cat1, $SubCat1) = explode('-', $Feed['itunes_cat_1']);
    }
    if (!empty($Feed['itunes_cat_2'])) {
        list($Cat2, $SubCat2) = explode('-', $Feed['itunes_cat_2']);
    }
    if (!empty($Feed['itunes_cat_3'])) {
        list($Cat3, $SubCat3) = explode('-', $Feed['itunes_cat_3']);
    }
    if ($Cat1) {
        $CatDesc = $Categories[$Cat1 . '-00'];
        $SubCatDesc = $Categories[$Cat1 . '-' . $SubCat1];
        if ($Cat1 != $Cat2 && $SubCat1 == '00') {
            echo "\t" . '<itunes:category text="' . esc_html($CatDesc) . '" />' . PHP_EOL;
        } else {
            echo "\t" . '<itunes:category text="' . esc_html($CatDesc) . '">' . PHP_EOL;
            if ($SubCat1 != '00') {
                echo "\t\t" . '<itunes:category text="' . esc_html($SubCatDesc) . '" />' . PHP_EOL;
            }
            // End this category set
            if ($Cat1 != $Cat2) {
                echo "\t" . '</itunes:category>' . PHP_EOL;
            }
        }
    }
    if ($Cat2) {
        $CatDesc = $Categories[$Cat2 . '-00'];
        $SubCatDesc = $Categories[$Cat2 . '-' . $SubCat2];
        // It's a continuation of the last category...
        if ($Cat1 == $Cat2) {
            if ($SubCat2 != '00') {
                echo "\t\t" . '<itunes:category text="' . esc_html($SubCatDesc) . '" />' . PHP_EOL;
            }
            // End this category set
            if ($Cat2 != $Cat3) {
                echo "\t" . '</itunes:category>' . PHP_EOL;
            }
        } else {
            if ($Cat2 != $Cat3 && $SubCat2 == '00') {
                echo "\t" . '<itunes:category text="' . esc_html($CatDesc) . '" />' . PHP_EOL;
            } else {
                if ($Cat1 != $Cat2) {
                    // Start a new category set
                    echo "\t" . '<itunes:category text="' . esc_html($CatDesc) . '">' . PHP_EOL;
                }
                if ($SubCat2 != '00') {
                    echo "\t\t" . '<itunes:category text="' . esc_html($SubCatDesc) . '" />' . PHP_EOL;
                }
                if ($Cat2 != $Cat3) {
                    // End this category set
                    echo "\t" . '</itunes:category>' . PHP_EOL;
                }
            }
        }
    }
    if ($Cat3) {
        $CatDesc = $Categories[$Cat3 . '-00'];
        $SubCatDesc = $Categories[$Cat3 . '-' . $SubCat3];
        // It's a continuation of the last category...
        if ($Cat2 == $Cat3) {
            if ($SubCat3 != '00') {
                echo "\t\t" . '<itunes:category text="' . esc_html($SubCatDesc) . '" />' . PHP_EOL;
            }
            // End this category set
            echo "\t" . '</itunes:category>' . PHP_EOL;
        } else {
            if ($Cat2 != $Cat3 && $SubCat3 == '00') {
                echo "\t" . '<itunes:category text="' . esc_html($CatDesc) . '" />' . PHP_EOL;
            } else {
                if ($Cat2 != $Cat3) {
                    // Start a new category set
                    echo "\t" . '<itunes:category text="' . esc_html($CatDesc) . '">' . PHP_EOL;
                }
                if ($SubCat3 != '00') {
                    echo "\t\t" . '<itunes:category text="' . esc_html($SubCatDesc) . '" />' . PHP_EOL;
                }
                // End this category set
                echo "\t" . '</itunes:category>' . PHP_EOL;
            }
        }
    }
    // End Handle iTunes categories
    // RawVoice RSS Tags
    if (!defined('POWERPRESS_RAWVOICE_RSS') || POWERPRESS_RAWVOICE_RSS != false) {
        if (!empty($Feed['parental_rating'])) {
            echo "\t\t<rawvoice:rating>" . $Feed['parental_rating'] . "</rawvoice:rating>" . PHP_EOL;
        }
        if (!empty($Feed['location'])) {
            echo "\t\t<rawvoice:location>" . htmlspecialchars($Feed['location']) . "</rawvoice:location>" . PHP_EOL;
        }
        if (!empty($Feed['frequency'])) {
            echo "\t\t<rawvoice:frequency>" . htmlspecialchars($Feed['frequency']) . "</rawvoice:frequency>" . PHP_EOL;
        }
    }
}
Exemplo n.º 15
0
function powerpresspartner_clammr_info($Settings = true)
{
    if (defined('POWERPRESS_DISABLE_PARTNERS') && POWERPRESS_DISABLE_PARTNERS == true) {
        return;
    }
    $ClammrPluginEnabled = false;
    if (!empty($GLOBALS['ClammrPlayer'])) {
        $ClammrPluginEnabled = is_object($GLOBALS['ClammrPlayer']);
    }
    ?>
<h3 style="position: relative;margin-left: 30px; margin-bottom: 5px;">
<img src="<?php 
    echo powerpress_get_root_url();
    ?>
images/clammr.png" style="width: 30px; height: 30px; position: absolute; top: 0; left: -34px;" />
<?php 
    echo __('Clammr Player PowerPress Add-on', 'powerpress');
    ?>
  <?php 
    echo powerpressadmin_new();
    ?>
</h3> 
<p style="margin-left: 50px;">
	<?php 
    echo __('Blubrry has partnered with Clammr to enable a social-themed audio player for your site. As visitors listen to your podcast, they can tap the integrated Clammr Button to tag their favorite highlights and share them to Facebook and Twitter. The shared highlights contain links back to your full audio and site, driving additional audience and traffic to you.', 'powerpress');
    ?>
</p>
<?php 
    if ($Settings) {
        if ($ClammrPluginEnabled == false) {
            $plugin_link = '<a href="' . esc_url(network_admin_url('plugin-install.php?tab=plugin-information&plugin=' . 'audio-player-by-clammr' . '&TB_iframe=true&width=640&height=662')) . '" class="thickbox" title="' . esc_attr__('Install Plugin') . '">' . __('Install Clammr Audio Player add-on plugin', 'powerpress') . '</a>';
            ?>
<p style="margin-left: 50px;"><strong><?php 
            echo $plugin_link;
            ?>
</strong></p><?php 
        } else {
            $PowerPressClammr = get_option('powerpress_clammr');
            ?>
<p style="margin-bottom: 20px; margin-left: 50px;">
	<input type="hidden" name="PowerPressClammr" value="0" />
	<input type="checkbox" name="PowerPressClammr" value="1" <?php 
            if (!empty($PowerPressClammr)) {
                echo 'checked';
            }
            ?>
 /> 
	<strong><?php 
            echo __('Enable Clammr Audio Player with PowerPress', 'powerpress');
            ?>
</strong>
</p>
<?php 
        }
    }
}