コード例 #1
0
 public function render()
 {
     $field = $this->field;
     $args = wp_parse_args($this->args, array('value' => $field->escaped_value(), 'desc' => $this->_desc(true), 'text_datetime_timestamp' => array(), 'select_timezone' => array()));
     $args['value'] = $field->escaped_value();
     if (is_array($args['value'])) {
         $args['value'] = '';
     }
     $datetime = maybe_unserialize($args['value']);
     $value = $tzstring = '';
     if ($datetime && $datetime instanceof DateTime) {
         $tz = $datetime->getTimezone();
         $tzstring = $tz->getName();
         $value = $datetime->getTimestamp();
     }
     $timestamp_args = wp_parse_args($args['text_datetime_timestamp'], array('desc' => '', 'value' => $value, 'rendered' => true));
     $datetime_timestamp = $this->types->text_datetime_timestamp($timestamp_args);
     $timezone_select_args = wp_parse_args($args['select_timezone'], array('class' => 'cmb2_select cmb2-select-timezone', 'name' => $this->_name('[timezone]'), 'id' => $this->_id('_timezone'), 'options' => wp_timezone_choice($tzstring), 'desc' => $args['desc'], 'rendered' => true));
     $select = $this->types->select($timezone_select_args);
     return $this->rendered($datetime_timestamp . "\n" . $select);
 }
コード例 #2
0
$tout = '';
$tout .= '<div class="spColumnSection spProfileLeftCol">';
$tout .= '<p class="spProfileLabel">' . sp_text('Select your Timezone') . ':</p>';
$tout .= '</div>';
$tout .= '<div class="spColumnSection spProfileSpacerCol"></div>';
$tout .= '<div class="spColumnSection spProfileRightCol">';
$tz = get_option('timezone_string');
if (empty($tz) || substr($tz, 0, 3) == 'UTC') {
    $tz = 'UTC';
}
$tzUser = !empty($spProfileUser->timezone_string) ? $spProfileUser->timezone_string : $tz;
if (substr($tzUser, 0, 3) == 'UTC') {
    $tzUser = '******';
}
$tout .= '<p class="spProfileLabel"><select class="spControl" id="timezone" name="timezone">';
$wptz = explode('<optgroup label=', wp_timezone_choice($tzUser));
unset($wptz[count($wptz) - 1]);
$tout .= implode('<optgroup label=', $wptz);
$tout .= '</select></p>';
$tout .= '<p><small>' . sp_text('Server Timezone set to') . ': <b>' . $tz . '</b></small></p>';
# timezone message
date_default_timezone_set($tz);
$now = localtime(time(), true);
if ($now['tm_isdst']) {
    $tout .= '<p><small>' . sp_text('This timezone is currently in daylight savings time') . '</small></p>';
} else {
    $tout .= '<p><small>' . sp_text('This timezone is currently in standard time') . '</small></p>';
}
$tout .= '<p><small>' . sp_text('Server Time is') . ': <b>' . date('Y-m-d G:i:s') . '</b></small></p>';
date_default_timezone_set($tzUser);
$tout .= '<p><small>' . sp_text('Local Time is') . ': <b>' . date('Y-m-d G:i:s') . '</b></small></p>';
コード例 #3
0
ファイル: functions.php プロジェクト: TyRichards/ty_the_band
/**
 * Gives a nicely formatted list of timezone strings.
 *
 * Strips the manual offsets from the default WordPress list.
 *
 * @since 1.0.0
 * @uses wp_timezone_choice()
 *
 * @param string $selected_zone Selected Zone.
 * @return string
 */
function audiotheme_timezone_choice($selected_zone = null)
{
    $selected = empty($selected_zone) ? get_option('timezone_string') : $selected_zone;
    $choices = wp_timezone_choice($selected);
    // Remove the manual offsets optgroup.
    $pos = strrpos($choices, '<optgroup');
    if (false !== $pos) {
        $choices = substr($choices, 0, $pos);
    }
    return apply_filters('audiotheme_timezone_dropdown', $choices, $selected);
}
コード例 #4
0
        /**
         * Timezone settings
         *
         * @access public
         * @return void
         */
        public function timezone_setting()
        {
            $current_offset = get_option('gmt_offset');
            $tzstring = get_option('timezone_string');
            $check_zone_info = true;
            // Remove old Etc mappings. Fallback to gmt_offset.
            if (false !== strpos($tzstring, 'Etc/GMT')) {
                $tzstring = '';
            }
            if (empty($tzstring)) {
                // Create a UTC+- zone if no timezone string exists
                $check_zone_info = false;
                if (0 == $current_offset) {
                    $tzstring = 'UTC+0';
                } elseif ($current_offset < 0) {
                    $tzstring = 'UTC' . $current_offset;
                } else {
                    $tzstring = 'UTC+' . $current_offset;
                }
            }
            $class = 'chosen-select' . (is_rtl() ? ' chosen-rtl' : '');
            ?>
		<tr valign="top">
			<th scope="row" class="titledesc">
				<label for="timezone_string"><?php 
            _e('Timezone', 'sportspress');
            ?>
 <i class="dashicons dashicons-editor-help sp-desc-tip" title="<?php 
            _e('Choose a city in the same timezone as you.', 'sportspress');
            ?>
"></i></label>
			</th>
            <td class="forminp">
				<legend class="screen-reader-text"><span><?php 
            _e('Timezone', 'sportspress');
            ?>
</span></legend>
				<select id="timezone_string" name="timezone_string" class="<?php 
            echo $class;
            ?>
">
					<?php 
            echo wp_timezone_choice($tzstring);
            ?>
				</select>
       		</td>
       	</tr>
       	<?php 
        }
コード例 #5
0
    /**
     * Output the about screen.
     */
    public function about_screen()
    {
        include_once 'class-sp-admin-settings.php';
        $class = 'chosen-select' . (is_rtl() ? ' chosen-rtl' : '');
        ?>
		<div class="wrap about-wrap about-sportspress-wrap">

			<?php 
        $this->intro();
        ?>

			<?php 
        // Save settings
        if (isset($_POST['timezone_string'])) {
            update_option('timezone_string', $_POST['timezone_string']);
            update_option('sportspress_basic_setup', 1);
        }
        if (isset($_POST['sportspress_sport']) && !empty($_POST['sportspress_sport'])) {
            $sport = $_POST['sportspress_sport'];
            SP_Admin_Sports::apply_preset($sport);
            update_option('sportspress_sport', $_POST['sportspress_sport']);
            update_option('sportspress_installed', 1);
            ?>
				<div id="message" class="updated sportspress-message">
					<p><strong><?php 
            _e('Your settings have been saved.', 'sportspress');
            ?>
</strong></p>
				</div>
			<?php 
        }
        if (isset($_POST['add_sample_data'])) {
            SP_Admin_Sample_Data::delete_posts();
            SP_Admin_Sample_Data::insert_posts();
        }
        ?>
			<?php 
        if (get_option('sportspress_installed')) {
            ?>

				<div class="headline-feature feature-video sp-fitvids" style="background-color:#191E23;">
					<iframe width="990" height="557" src="https://www.youtube.com/embed/KQyga_C5a6M?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>
				</div>

				<hr>

				<div class="feature-section three-col">
					<h2>Event Organization</h2>
					<div class="col">
						<img src="https://cdn-themeboy.netdna-ssl.com/wp-content/uploads/match-days.png" alt="Match Days"/>
						<h3>Match Days</h3>
						<p>A match day can be added to any event and displayed directly inside the event details section. It can also be used as a filter for shortcodes and widgets.</p>
					</div>
					<div class="col">
						<img src="https://cdn-themeboy.netdna-ssl.com/wp-content/uploads/event-status.gif" alt="Event Status"/>
						<h3>Event Status</h3>
						<p>For undecided, postponed, and cancelled events, a status can be displayed in place of the time. Leave the status alone to display the actual time of the event.</p>
					</div>
					<div class="col">
						<img src="https://cdn-themeboy.netdna-ssl.com/wp-content/uploads/box-score-minutes.png" alt="Box Score Minutes"/>
						<h3>Box Score Minutes</h3>
						<p>You can now can enter the time of goals or any other statistic for each player, and display them directly within the box score section of event pages.</p>
					</div>
				</div>

				<hr>

				<div class="feature-section three-col">
					<h2>Layout Enhancements</h2>
					<div class="col">
						<img src="https://cdn-themeboy.netdna-ssl.com/wp-content/uploads/template-tabs.gif" alt=""/>
						<h3>Template Tabs</h3>
						<p>Simply drag and drop any of the layout items to automatically group them into tabs. This will make your templates more compact and intuitive.</p>
					</div>
					<div class="col">
						<img src="https://cdn-themeboy.netdna-ssl.com/wp-content/uploads/event-logo-options.png" alt=""/>
						<h3>Event Logo Options</h3>
						<p>Display the teams playing using an inline layout or as a block section, with logos on either side and the date and time/results in the middle.</p>
					</div>
					<div class="col">
						<img src="https://cdn-themeboy.netdna-ssl.com/wp-content/uploads/player-profile-switching.png" alt=""/>
						<h3>Player Profile Switching</h3>
						<p>We also added a dropdown above the player details box which allows your visitors to quickly switch to another player's profile.</p>
					</div>
				</div>

				<hr />

				<div class="changelog">
					<h2>Under the Hood</h2>
					<div class="under-the-hood three-col">
						<div class="col">
							<h3>Fixtures Importer</h3>
							<p>A new, simpler importer has been added for quickly scheduling events. Supports CSV files generated by <a href="http://tboy.co/leaguelobster" target="_blank">LeagueLobster</a>.</p>
						</div>
						<div class="col">
							<h3>Tutorials for Everyone</h3>
							<p>If you've enabled the Tutorials module, all SportsPress users will now be able to access them from the dashboard.</p>
						</div>
						<div class="col">
							<h3>REST API Improvements</h3>
							<p>The REST API has been updated to support meta query vars, allowing you to retrieve data for a specific team or player.</p>
						</div>
					</div>
				</div>

				<a href="<?php 
            echo esc_url(admin_url(add_query_arg(array('page' => 'sportspress', 'tab' => 'general'), 'admin.php')));
            ?>
"><?php 
            _e('Go to SportsPress Settings', 'sportspress');
            ?>
</a>

			<?php 
        } else {
            ?>

				<div class="sp-feature feature-section col two-col">
					<div>
						<form method="post" id="mainform" action="" enctype="multipart/form-data">
							<h4><?php 
            _e('Basic Setup', 'sportspress');
            ?>
</h4>
							<p><?php 
            _e('Select your timezone and sport to get started.', 'sportspress');
            ?>
</p>
							<table class="form-table">
								<tbody>
									<tr valign="top">
										<th scope="row" class="titledesc">
											<label for="timezone_string"><?php 
            _e('Timezone', 'sportspress');
            ?>
 <i class="dashicons dashicons-editor-help sp-desc-tip" title="<?php 
            _e('Choose a city in the same timezone as you.', 'sportspress');
            ?>
"></i></label>
										</th>
										<td>
											<select id="timezone_string" name="timezone_string" class="<?php 
            echo $class;
            ?>
">
												<?php 
            $current_offset = get_option('gmt_offset');
            $tzstring = get_option('timezone_string');
            $check_zone_info = true;
            // Remove old Etc mappings. Fallback to gmt_offset.
            if (false !== strpos($tzstring, 'Etc/GMT')) {
                $tzstring = '';
            }
            if (empty($tzstring)) {
                // Create a UTC+- zone if no timezone string exists
                $check_zone_info = false;
                if (0 == $current_offset) {
                    $tzstring = 'UTC+0';
                } elseif ($current_offset < 0) {
                    $tzstring = 'UTC' . $current_offset;
                } else {
                    $tzstring = 'UTC+' . $current_offset;
                }
            }
            echo wp_timezone_choice($tzstring);
            ?>
											</select>
										</td>
									</tr>
									<?php 
            $sport_options = SP_Admin_Sports::get_preset_options();
            $settings = array(array('id' => 'sportspress_sport', 'default' => 'custom', 'type' => 'sport', 'title' => __('Sport', 'sportspress'), 'welcome' => true, 'class' => $class, 'options' => $sport_options));
            SP_Admin_Settings::output_fields($settings);
            ?>
								</tbody>
							</table>
					        <p class="submit sportspress-actions">
					        	<input name="save" class="button-primary" type="submit" value="<?php 
            _e('Save Changes', 'sportspress');
            ?>
" />
					        	<input type="hidden" name="subtab" id="last_tab" />
					        	<?php 
            wp_nonce_field('sportspress-settings');
            ?>
					        </p>
						</form>
					</div>
					<?php 
            if (current_user_can('install_themes') && !current_theme_supports('sportspress')) {
                ?>
						<div class="last-feature">
							<h4><?php 
                _e('Free SportsPress Theme', 'sportspress');
                ?>
</h4>
							<a href="<?php 
                echo add_query_arg(array('theme' => 'rookie'), network_admin_url('theme-install.php'));
                ?>
" class="sp-theme-screenshot"><img src="<?php 
                echo plugin_dir_url(SP_PLUGIN_FILE);
                ?>
/assets/images/modules/rookie.png"></a>
							<p><?php 
                _e('Have you tried the free Rookie theme yet?', 'sportspress');
                ?>
</p>
							<p><?php 
                _e('Rookie is a free starter theme for SportsPress designed by ThemeBoy.', 'sportspress');
                ?>
</p>
							<p class="sp-module-actions">
								<a class="button button-large" href="<?php 
                echo add_query_arg(array('theme' => 'rookie'), network_admin_url('theme-install.php'));
                ?>
"><?php 
                _e('Install Now', 'sportspress');
                ?>
</a>
							</p>
						</div>
					<?php 
            }
            ?>
				</div>
			
			<?php 
        }
        ?>

		</div>
		<?php 
    }
コード例 #6
0
    } elseif ($current_offset < 0) {
        $tzstring = 'UTC' . $current_offset;
    } else {
        $tzstring = 'UTC+' . $current_offset;
    }
}
?>
<th scope="row"><label for="timezone_string"><?php 
_e('Timezone');
?>
</label></th>
<td>

<select id="timezone_string" name="timezone_string">
<?php 
echo wp_timezone_choice($tzstring);
?>
</select>

	<span id="utc-time"><?php 
printf(__('<abbr title="Coordinated Universal Time">UTC</abbr> time is <code>%s</code>'), date_i18n($timezone_format, false, 'gmt'));
?>
</span>
<?php 
if (get_option('timezone_string') || !empty($current_offset)) {
    ?>
	<span id="local-time"><?php 
    printf(__('Local time is <code>%1$s</code>'), date_i18n($timezone_format));
    ?>
</span>
<?php 
コード例 #7
0
    /**
     * Print the advanced settings panel.
     *
     * @since  3.0.0
     * @access private
     *
     * @param  \WP_Post $post
     */
    private static function advanced_settings_panel($post)
    {
        ?>
		<table>
			<thead>
				<tr><th colspan="2"><?php 
        _e('Date and Time', 'google-calendar-events');
        ?>
</th></tr>
			</thead>
			<tbody class="simcal-panel-section simcal-panel-datetime-formatting">
				<tr class="simcal-panel-field">
					<th><label for="_calendar_timezone_setting"><?php 
        _e('Timezone', 'google-calendar-events');
        ?>
</label></th>
					<td>
						<?php 
        $timezone_wordpress = simcal_get_wp_timezone();
        $timezone_default = $timezone_wordpress ? $timezone_wordpress : 'UTC';
        $timezone_setting = esc_attr(get_post_meta($post->ID, '_feed_timezone_setting', true));
        $timezone = esc_attr(get_post_meta($post->ID, '_feed_timezone', true));
        $timezone = $timezone ? $timezone : $timezone_default;
        ?>
						<select name="_feed_timezone_setting"
						        id="_feed_timezone_setting"
						        class="simcal-field simcal-field-select simcal-field-inline simcal-field-show-next"
						        data-show-next-if-value="use_custom">
							<option value="use_calendar" <?php 
        selected('use_calendar', $timezone_setting, true);
        ?>
><?php 
        _ex('Events source default', 'Use the calendar default setting', 'google-calendar-events');
        ?>
</option>
							<option value="use_site" <?php 
        selected('use_site', $timezone_setting, true);
        ?>
><?php 
        printf(_x('Site default', 'Use this site default setting', 'google-calendar-events') . ' (%s)', $timezone_default);
        ?>
</option>
							<option value="use_custom" <?php 
        selected('use_custom', $timezone_setting, true);
        ?>
><?php 
        _ex('Custom', 'Use a custom setting', 'google-calendar-events');
        ?>
</option>
						</select>
						<select name="_feed_timezone"
						        id="_feed_timezone"
						        class="simcal-field simcal-field-select simcal-field-inline"
							<?php 
        echo 'use_custom' != $timezone_setting ? 'style="display: none;"' : '';
        ?>
>
							<?php 
        echo wp_timezone_choice($timezone);
        ?>
						</select>
						<i class="simcal-icon-help simcal-help-tip" data-tip="<?php 
        _e('Using a different timezone may alter the date and time display of your calendar events. It is recommended to keep the calendar default timezone.', 'google-calendar-events');
        ?>
"></i>
					</td>
				</tr>
				<tr class="simcal-panel-field">
					<th><label for="_calendar_date_format_setting"><?php 
        _e('Date format', 'google-calendar-events');
        ?>
</label></th>
					<td>
						<?php 
        $date_format_setting = esc_attr(get_post_meta($post->ID, '_calendar_date_format_setting', true));
        $date_format_default = esc_attr(get_option('date_format'));
        $date_format = esc_attr(get_post_meta($post->ID, '_calendar_date_format', true));
        $date_format_php = esc_attr(get_post_meta($post->ID, '_calendar_date_format_php', true));
        $date_format_php = $date_format_php ? $date_format_php : $date_format_default;
        ?>
						<select name="_calendar_date_format_setting"
						        id="_calendar_date_format_setting"
								class="simcal-field simcal-field-select simcal-field-show-other">
							<option value="use_site" data-show-field="_calendar_date_format_default" <?php 
        selected('use_site', $date_format_setting, true);
        ?>
><?php 
        _ex('Site default', 'Use this site default setting', 'google-calendar-events');
        ?>
</option>
							<option value="use_custom" data-show-field="_calendar_date_format" <?php 
        selected('use_custom', $date_format_setting, true);
        ?>
><?php 
        _ex('Custom', 'Use a custom setting', 'google-calendar-events');
        ?>
</option>
							<option value="use_custom_php" data-show-field="_calendar_date_format_php_field" <?php 
        selected('use_custom_php', $date_format_setting, true);
        ?>
><?php 
        _e('Custom (PHP format)', 'google-calendar-events');
        ?>
</option>
						</select>
						<i class="simcal-icon-help simcal-help-tip" data-tip="<?php 
        _e('This option sets how calendars display event dates. It is recommended to keep your site default setting.', 'google-calendar-events');
        ?>
"></i>
						<p id="_calendar_date_format_default" style="<?php 
        echo $date_format_setting != 'use_site' ? 'display: none;' : '';
        ?>
">
							<em><?php 
        _e('Preview', 'google-calendar-events');
        ?>
:</em>&nbsp;&nbsp;
							<code><?php 
        echo date_i18n($date_format_default, time());
        ?>
</code>
						</p>
						<?php 
        simcal_print_field(array('type' => 'datetime-format', 'subtype' => 'date', 'name' => '_calendar_date_format', 'id' => '_calendar_date_format', 'value' => $date_format, 'style' => $date_format_setting != 'use_custom' ? array('display' => 'none') : ''));
        ?>
						<div class="simcal-field-datetime-format-php" id="_calendar_date_format_php_field" style="<?php 
        echo $date_format_setting != 'use_custom_php' ? 'display: none;' : '';
        ?>
">
							<br>
							<label for="_calendar_date_format_php">
								<input type="text"
								       name="_calendar_date_format_php"
								       id="_calendar_date_format_php"
								       class="simcal-field simcal-field-text simcal-field-small"
								       value="<?php 
        echo $date_format_php;
        ?>
" />
								<?php 
        printf(__('Enter a date format using %s values.', 'google-calendar-events'), '<a href="//php.net/manual/en/function.date.php" target="_blank">PHP</a>');
        ?>
							</label>
							<p>
								<em><?php 
        _e('Preview', 'google-calendar-events');
        ?>
:</em>&nbsp;&nbsp;
								<code><?php 
        echo date_i18n($date_format_php, time());
        ?>
</code>
							</p>
						</div>
					</td>
				</tr>
				<tr class="simcal-panel-field">
					<th><label for="_calendar_datetime_separator"><?php 
        _e('Separator', 'google-calendar-events');
        ?>
</label></th>
					<td>
						<?php 
        $separator = get_post_meta($post->ID, '_calendar_datetime_separator', true);
        $separator = false == $separator ? '@' : $separator;
        simcal_print_field(array('type' => 'standard', 'subtype' => 'text', 'name' => '_calendar_datetime_separator', 'id' => '_calendar_datetime_separator', 'value' => $separator, 'tooltip' => __('Used to divide date and time when both are shown.', 'google-calendar-events'), 'class' => array('simcal-field-tiny')));
        ?>
					</td>
				</tr>
				<tr class="simcal-panel-field">
					<th><label for="_calendar_time_format_setting"><?php 
        _e('Time format', 'google-calendar-events');
        ?>
</label></th>
					<td>
						<?php 
        $time_format_setting = esc_attr(get_post_meta($post->ID, '_calendar_time_format_setting', true));
        $time_format_default = esc_attr(get_option('time_format'));
        $time_format = esc_attr(get_post_meta($post->ID, '_calendar_time_format', true));
        $time_format_php = esc_attr(get_post_meta($post->ID, '_calendar_time_format_php', true));
        $time_format_php = $time_format_php ? $time_format_php : $time_format_default;
        ?>
						<select name="_calendar_time_format_setting"
						        id="_calendar_time_format_setting"
						        class="simcal-field simcal-field-select simcal-field-show-other">
							<option value="use_site" data-show-field="_calendar_time_format_default" <?php 
        selected('use_site', $time_format_setting, true);
        ?>
><?php 
        _ex('Site default', 'Use this site default setting', 'google-calendar-events');
        ?>
</option>
							<option value="use_custom" data-show-field="_calendar_time_format" <?php 
        selected('use_custom', $time_format_setting, true);
        ?>
><?php 
        _ex('Custom', 'Use a custom setting', 'google-calendar-events');
        ?>
</option>
							<option value="use_custom_php" data-show-field="_calendar_time_format_php_field" <?php 
        selected('use_custom_php', $time_format_setting, true);
        ?>
><?php 
        _e('Custom (PHP format)', 'google-calendar-events');
        ?>
</option>
						</select>
						<i class="simcal-icon-help simcal-help-tip" data-tip="<?php 
        _e('This option sets how calendars display event times. It is recommended to keep your site default setting.', 'google-calendar-events');
        ?>
"></i>
						<p id="_calendar_time_format_default" style="<?php 
        echo $time_format_setting != 'use_site' ? 'display: none;' : '';
        ?>
">
							<em><?php 
        _e('Preview', 'google-calendar-events');
        ?>
:</em>&nbsp;&nbsp;
							<code><?php 
        echo date_i18n($time_format_default, time());
        ?>
</code>
						</p>
						<?php 
        simcal_print_field(array('type' => 'datetime-format', 'subtype' => 'time', 'name' => '_calendar_time_format', 'id' => '_calendar_time_format', 'value' => $time_format, 'style' => $time_format_setting != 'use_custom' ? array('display' => 'none') : ''));
        ?>
						<div class="simcal-field-datetime-format-php" id="_calendar_time_format_php_field" style="<?php 
        echo $time_format_setting != 'use_custom_php' ? 'display: none;' : '';
        ?>
">
							<br>
							<label for="_calendar_date_format_php">
								<input type="text"
								       name="_calendar_time_format_php"
								       id="_calendar_time_format_php"
								       class="simcal-field simcal-field-text simcal-field-small"
								       value="<?php 
        echo $time_format_php;
        ?>
"/>
								<?php 
        printf(__('Enter a time format using %s values.', 'google-calendar-events'), '<a href="//php.net/manual/en/function.date.php" target="_blank">PHP</a>');
        ?>
							</label>
							<p>
								<em><?php 
        _e('Preview', 'google-calendar-events');
        ?>
:</em>&nbsp;&nbsp;
								<code><?php 
        echo date_i18n($time_format_php, time());
        ?>
</code>
							</p>
						</div>
					</td>
				</tr>
				<tr class="simcal-panel-field">
					<th><label for="_calendar_week_starts_on_setting"><?php 
        _e('Week starts on', 'google-calendar-events');
        ?>
</label></th>
					<td>
						<?php 
        $week_starts_setting = esc_attr(get_post_meta($post->ID, '_calendar_week_starts_on_setting', true));
        $week_starts_default = esc_attr(get_option('start_of_week'));
        $week_starts = intval(get_post_meta($post->ID, '_calendar_week_starts_on', true));
        $week_starts = is_numeric($week_starts) ? strval($week_starts) : $week_starts_default;
        ?>
						<select
							name="_calendar_week_starts_on_setting"
							id="_calendar_week_starts_on_setting"
							class="simcal-field simcal-field-select simcal-field-inline simcal-field-show-next"
							data-show-next-if-value="use_custom">
							<option value="use_site" <?php 
        selected('use_site', $week_starts_setting, true);
        ?>
><?php 
        printf(_x('Site default', 'Use this site default setting', 'google-calendar-events') . ' (%s)', date_i18n('l', strtotime("Sunday + {$week_starts_default} Days")));
        ?>
</option>
							<option value="use_custom" <?php 
        selected('use_custom', $week_starts_setting, true);
        ?>
><?php 
        _ex('Custom', 'Use a custom setting', 'google-calendar-events');
        ?>
</option>
						</select>
						<select
							name="_calendar_week_starts_on"
							id="_calendar_week_starts_on"
							class="simcal-field simcal-field-select simcal-field-inline"
							<?php 
        echo 'use_custom' != $week_starts_setting ? 'style="display: none;"' : '';
        ?>
>
							<?php 
        $day_names = simcal_get_calendar_names_i18n('day', 'full');
        ?>
							<?php 
        for ($i = 0; $i <= 6; $i++) {
            ?>
								<option value="<?php 
            echo $i;
            ?>
" <?php 
            selected($i, $week_starts, true);
            ?>
><?php 
            echo $day_names[$i];
            ?>
</option>
							<?php 
        }
        ?>
						</select>
						<i class="simcal-icon-help simcal-help-tip" data-tip="<?php 
        _e('Some calendars may use this setting to display the start of the week. It is recommended to keep the site default setting.', 'google-calendar-events');
        ?>
"></i>
					</td>
				</tr>
			</tbody>
		</table>
		<table>
			<thead>
				<tr><th colspan="2"><?php 
        _e('Cache', 'google-calendar-events');
        ?>
</th></tr>
			</thead>
			<tbody class="simcal-panel-section simcal-panel-section-cache">
				<?php 
        $cache_freq = esc_attr(get_post_meta($post->ID, '_feed_cache_user_amount', true));
        $cache_unit = esc_attr(get_post_meta($post->ID, '_feed_cache_user_unit', true));
        $cache_freq = $cache_freq ? $cache_freq : '2';
        $cache_unit = $cache_unit ? $cache_unit : '3600';
        ?>
				<tr class="simcal-panel-field">
					<th><label for="_feed_cache_user_amount"><?php 
        _ex('Refresh interval', 'Cache maximum interval', 'google-calendar-events');
        ?>
</label></th>
					<td>
						<input type="number"
						       name="_feed_cache_user_amount"
						       id="_feed_cache_user_amount"
						       class="simcal-field simcal-field-number simcal-field-tiny simcal-field-inline"
						       value="<?php 
        echo $cache_freq;
        ?>
"
						       min="1" />
						<select name="_feed_cache_user_unit"
						        id="_feed_cache_user_unit"
						        class="simcal-field simcalfield-select simcal-field-inline">
							<option value="60" <?php 
        selected('60', $cache_unit, true);
        ?>
><?php 
        _e('Minute(s)', 'google-calendar-events');
        ?>
</option>
							<option value="3600" <?php 
        selected('3600', $cache_unit, true);
        ?>
><?php 
        _e('Hour(s)', 'google-calendar-events');
        ?>
</option>
							<option value="86400" <?php 
        selected('86400', $cache_unit, true);
        ?>
><?php 
        _e('Day(s)', 'google-calendar-events');
        ?>
</option>
							<option value="604800" <?php 
        selected('604800', $cache_unit, true);
        ?>
><?php 
        _e('Week(s)', 'google-calendar-events');
        ?>
</option>
						</select>
						<i class="simcal-icon-help simcal-help-tip" data-tip="<?php 
        _e('If you add, edit or remove events in your calendar very often, you can set a lower interval to refresh the events displayed. Set a higher interval for best performance.', 'google-calendar-events');
        ?>
"></i>
					</td>
				</tr>
			</tbody>
		</table>
		<?php 
    }
コード例 #8
0
    /**
     * @access public
     * @param string $timezone_string
     */
    public static function timezone_select_input($timezone_string = '')
    {
        // get WP date time format
        $datetime_format = get_option('date_format') . ' ' . get_option('time_format');
        // if passed a value, then use that, else get WP option
        $timezone_string = !empty($timezone_string) ? $timezone_string : get_option('timezone_string');
        // check if the timezone is valid but don't throw any errors if it isn't
        $timezone_string = EEH_DTT_Helper::validate_timezone($timezone_string, false);
        $gmt_offset = get_option('gmt_offset');
        $check_zone_info = true;
        if (empty($timezone_string)) {
            // Create a UTC+- zone if no timezone string exists
            $check_zone_info = false;
            if ($gmt_offset > 0) {
                $timezone_string = 'UTC+' . $gmt_offset;
            } elseif ($gmt_offset < 0) {
                $timezone_string = 'UTC' . $gmt_offset;
            } else {
                $timezone_string = 'UTC';
            }
        }
        ?>

		<p>
			<label for="timezone_string"><?php 
        _e('timezone');
        ?>
</label>
			<select id="timezone_string" name="timezone_string">
				<?php 
        echo wp_timezone_choice($timezone_string);
        ?>
			</select>
			<br />
			<span class="description"><?php 
        _e('Choose a city in the same timezone as the event.');
        ?>
</span>
		</p>

		<p>
			<span><?php 
        printf(__('%1$sUTC%2$s time is %3$s'), '<abbr title="Coordinated Universal Time">', '</abbr>', '<code>' . date_i18n($datetime_format, false, 'gmt') . '</code>');
        ?>
</span>
			<?php 
        if (!empty($timezone_string) || !empty($gmt_offset)) {
            ?>
				<br /><span><?php 
            printf(__('Local time is %1$s'), '<code>' . date_i18n($datetime_format) . '</code>');
            ?>
</span>
		<?php 
        }
        ?>

				<?php 
        if ($check_zone_info && $timezone_string) {
            ?>
				<br />
				<span>
					<?php 
            // Set TZ so localtime works.
            date_default_timezone_set($timezone_string);
            $now = localtime(time(), true);
            if ($now['tm_isdst']) {
                _e('This timezone is currently in daylight saving time.');
            } else {
                _e('This timezone is currently in standard time.');
            }
            ?>
					<br />
					<?php 
            if (function_exists('timezone_transitions_get')) {
                $found = false;
                $date_time_zone_selected = new DateTimeZone($timezone_string);
                $tz_offset = timezone_offset_get($date_time_zone_selected, date_create());
                $right_now = time();
                $tr['isdst'] = false;
                foreach (timezone_transitions_get($date_time_zone_selected) as $tr) {
                    if ($tr['ts'] > $right_now) {
                        $found = true;
                        break;
                    }
                }
                if ($found) {
                    $message = $tr['isdst'] ? __(' Daylight saving time begins on: %s.') : __(' Standard time begins  on: %s.');
                    // Add the difference between the current offset and the new offset to ts to get the correct transition time from date_i18n().
                    printf($message, '<code >' . date_i18n($datetime_format, $tr['ts'] + ($tz_offset - $tr['offset'])) . '</code >');
                } else {
                    _e('This timezone does not observe daylight saving time.');
                }
            }
            // Set back to UTC.
            date_default_timezone_set('UTC');
            ?>
				</span></p>
			<?php 
        }
    }
コード例 #9
0
    public static function ddtimezone($tz_event = '')
    {
        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
        $timezone_format = _x('Y-m-d G:i:s', 'timezone date format');
        $current_offset = get_option('gmt_offset');
        $tzstring = $tz_event != '' ? $tz_event : get_option('timezone_string');
        //echo $tzstring;
        $check_zone_info = true;
        // Remove old Etc mappings.  Fallback to gmt_offset.
        if (false !== strpos($tzstring, 'Etc/GMT')) {
            $tzstring = '';
        }
        if (empty($tzstring)) {
            // Create a UTC+- zone if no timezone string exists
            $check_zone_info = false;
            if (0 == $current_offset) {
                $tzstring = 'UTC';
            } elseif ($current_offset < 0) {
                $tzstring = 'UTC' . $current_offset;
            } else {
                $tzstring = 'UTC+' . $current_offset;
            }
        }
        ?>

		<p><select id="timezone_string" name="timezone_string">
		<?php 
        echo wp_timezone_choice($tzstring);
        ?>
			</select>
			<br />
			<span class="description"><?php 
        _e('Choose a city in the same timezone as the event.');
        ?>
</span>
		</p>

		<p><span><?php 
        printf(__('<abbr title="Coordinated Universal Time">UTC</abbr> time is <code>%s</code>'), date_i18n($timezone_format, false, 'gmt'));
        ?>
</span>
			<?php 
        if (get_option('timezone_string') || !empty($current_offset)) {
            ?>
				<br /><span><?php 
            printf(__('Local time is <code>%1$s</code>'), date_i18n($timezone_format));
            ?>
</span>
		<?php 
        }
        ?>

				<?php 
        if ($check_zone_info && $tzstring) {
            ?>
				<br />
				<span>
					<?php 
            // Set TZ so localtime works.
            date_default_timezone_set($tzstring);
            $now = localtime(time(), true);
            if ($now['tm_isdst']) {
                _e('This timezone is currently in daylight saving time.');
            } else {
                _e('This timezone is currently in standard time.');
            }
            ?>
					<br />
					<?php 
            if (function_exists('timezone_transitions_get')) {
                $found = false;
                $date_time_zone_selected = new DateTimeZone($tzstring);
                $tz_offset = timezone_offset_get($date_time_zone_selected, date_create());
                $right_now = time();
                foreach (timezone_transitions_get($date_time_zone_selected) as $tr) {
                    if ($tr['ts'] > $right_now) {
                        $found = true;
                        break;
                    }
                }
                if ($found) {
                    echo ' ';
                    $message = $tr['isdst'] ? __('Daylight saving time begins on: <code>%s</code>.') : __('Standard time begins  on: <code>%s</code>.');
                    // Add the difference between the current offset and the new offset to ts to get the correct transition time from date_i18n().
                    printf($message, date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $tr['ts'] + ($tz_offset - $tr['offset'])));
                } else {
                    _e('This timezone does not observe daylight saving time.');
                }
            }
            // Set back to UTC.
            date_default_timezone_set('UTC');
            ?>
				</span></p>
			<?php 
        }
    }
コード例 #10
0
    /**
     * Output the about screen.
     */
    public function about_screen()
    {
        include_once 'class-sp-admin-settings.php';
        $class = 'chosen-select' . (is_rtl() ? ' chosen-rtl' : '');
        ?>
		<div class="wrap about-wrap about-prosports-wrap">

			<h1>Welcome to ProSports1.0</h1>
			<div class="about-text sp-about-text">
			Thanks for installing! ProSports 1.0 has lots of refinements we think you’ll love.
		</div>

			<?php 
        // Save settings
        if (isset($_POST['timezone_string'])) {
            update_option('timezone_string', $_POST['timezone_string']);
            update_option('prosports_basic_setup', 1);
        }
        if (isset($_POST['prosports_sport']) && !empty($_POST['prosports_sport'])) {
            $sport = $_POST['prosports_sport'];
            SP_Admin_Sports::apply_preset($sport);
            update_option('prosports_sport', $_POST['prosports_sport']);
            update_option('_prosports_needs_welcome', 1);
            ?>
				<div id="message" class="updated prosports-message">
					<p><strong><?php 
            _e('Your settings have been saved.', 'prosports');
            ?>
</strong></p>
				</div>
			<?php 
        }
        if (isset($_POST['add_sample_data'])) {
            SP_Admin_Sample_Data::delete_posts();
            SP_Admin_Sample_Data::insert_posts();
        }
        ?>
			<div class="sp-feature feature-section col two-col">
				<div>
					<?php 
        if (get_option('prosports_basic_setup')) {
            ?>
						<h4><?php 
            _e('Sport', 'prosports');
            ?>
</h4>
						<?php 
            $sport = get_option('prosports_sport');
            $sport_options = SP_Admin_Sports::get_preset_options();
            foreach ($sport_options as $options) {
                foreach ($options as $slug => $name) {
                    if ($sport === $slug) {
                        $sport = $name;
                        break;
                    }
                }
            }
            echo $sport;
            ?>
						<a href="<?php 
            echo esc_url(admin_url(add_query_arg(array('page' => 'prosports'), 'admin.php')));
            ?>
"><div class="dashicons dashicons-edit"></div><?php 
            _e('Change', 'prosports');
            ?>
</a>
						<h4><?php 
            _e('Next Steps', 'prosports');
            ?>
</h4>
						<p><?php 
            _e('We&#8217;ve assembled some links to get you started:', 'prosports');
            ?>
</p>
						<div class="prosports-steps">
							<ul>
								<li><a href="<?php 
            echo esc_url(admin_url(add_query_arg(array('post_type' => 'sp_team'), 'edit.php')));
            ?>
" class="welcome-icon sp-welcome-icon dashicons-shield-alt"><?php 
            _e('Add New Team', 'prosports');
            ?>
</a></li>
								<li><a href="<?php 
            echo esc_url(admin_url(add_query_arg(array('post_type' => 'sp_player'), 'edit.php')));
            ?>
" class="welcome-icon sp-welcome-icon dashicons-groups"><?php 
            _e('Add New Player', 'prosports');
            ?>
</a></li>
								<li><a href="<?php 
            echo esc_url(admin_url(add_query_arg(array('post_type' => 'sp_event'), 'edit.php')));
            ?>
" class="welcome-icon sp-welcome-icon dashicons-calendar"><?php 
            _e('Add New Event', 'prosports');
            ?>
</a></li>
							</ul>
						</div>
						<div class="return-to-dashboard">
							<a href="<?php 
            echo esc_url(admin_url(add_query_arg(array('page' => 'prosports'), 'admin.php')));
            ?>
"><?php 
            _e('Go to ProSports Settings', 'prosports');
            ?>
</a>
						</div>
					<?php 
        } else {
            ?>
						<form method="post" id="mainform" action="" enctype="multipart/form-data">
							<h4><?php 
            _e('Basic Setup', 'prosports');
            ?>
</h4>
							<p><?php 
            _e('Select your timezone and sport to get started.', 'prosports');
            ?>
</p>
							<table class="form-table">
								<tbody>
									<tr valign="top">
										<th scope="row" class="titledesc">
											<label for="timezone_string"><?php 
            _e('Timezone', 'prosports');
            ?>
</label>
										</th>
										<td>
											<select id="timezone_string" name="timezone_string" class="<?php 
            echo $class;
            ?>
">
												<?php 
            $current_offset = get_option('gmt_offset');
            $tzstring = get_option('timezone_string');
            $check_zone_info = true;
            // Remove old Etc mappings. Fallback to gmt_offset.
            if (false !== strpos($tzstring, 'Etc/GMT')) {
                $tzstring = '';
            }
            if (empty($tzstring)) {
                // Create a UTC+- zone if no timezone string exists
                $check_zone_info = false;
                if (0 == $current_offset) {
                    $tzstring = 'UTC+0';
                } elseif ($current_offset < 0) {
                    $tzstring = 'UTC' . $current_offset;
                } else {
                    $tzstring = 'UTC+' . $current_offset;
                }
            }
            echo wp_timezone_choice($tzstring);
            ?>
											</select>
										</td>
									</tr>
									
								</tbody>
							</table>
					        <p class="submit prosports-actions">
					        	<input name="save" class="button-primary" type="submit" value="<?php 
            _e('Save changes', 'prosports');
            ?>
" />
					        	<input type="hidden" name="subtab" id="last_tab" />
					        	<?php 
            wp_nonce_field('prosports-settings');
            ?>
					        </p>
						</form>
					<?php 
        }
        ?>
				</div>
				
			</div>
		</div>
		<?php 
    }
コード例 #11
0
	 function cets_blog_defaults_management_page(){
	 	// Display the defaults that can be set by site admins
	 
	 	global $wpdb;
		
		// only allow site admins to come here.
		if( is_super_admin() == false ) {
			wp_die( __('You do not have permission to access this page.') );
		}
		
		/* translators: date and time format for exact current time, mainly about timezones, see http://php.net/date */
		$timezone_format = _x('Y-m-d G:i:s', 'timezone date format');
		
		
		// process form submission    	
    	if (isset($_POST['action']) && $_POST['action'] == 'update') {
			$this->update_defaults($_POST);
			$updated = true;
    	}
		
		// make sure we're using latest data
		$opt = get_site_option('cets_blog_defaults_options');
		
    	if (isset($updated) && $updated) { ?>
        <div id="message" class="updated fade"><p><?php _e('Options saved.') ?></p></div>
        <?php	} ?>
        
        <h1>New Blog Defaults</h1>
        <form name="blogdefaultsform" action="" method="post">
        <p>Set the defaults for new blog creation. Note that these defaults can still be over-ridden by blog owners.</p>
        <div class="wrap">
        <h2><?php _e('General Settings') ?></h2>
        <table class="form-table">
        <tr valign="top">
        <th scope="row"><?php _e('Blog Title') ?></th>
        <td><input name="blogname" type="text" id="blogname" value="<?php echo($opt['blogname']); ?>" size="40" /><br/>
        <input type="checkbox" name="blogname_flag" value="1" <?php checked('1', $opt[blogname_flag]) ?> /> <?php _e("I understand this will overwrite the user's chosen blog name from the setup page.") ?></td>
        </tr>
        <tr valign="top">
        <th scope="row"><?php _e('Tagline') ?></th>
        <td><input name="blogdescription" type="text" id="blogdescription" style="width: 95%" value="<?php echo($opt['blogdescription']); ?>" size="45" />
        <br />
        <?php _e('In a few words, explain what this blog is about.') ?></td>
        </tr>
		
<!-- Begin Time Zone -->
		<tr>
		<?php
		$current_offset = $opt['gmt_offset'];
		$tzstring = $opt['timezone_string'];
		
		$check_zone_info = true;
		
		// Remove old Etc mappings.  Fallback to gmt_offset.
		if ( false !== strpos($tzstring,'Etc/GMT') )
			$tzstring = '';
		
		if (empty($tzstring)) { // set the Etc zone if no timezone string exists
			$check_zone_info = false;
			if ( 0 == $current_offset )
				$tzstring = 'UTC+0';
			elseif ($current_offset < 0)
				$tzstring = 'UTC' . $current_offset;
			else
				$tzstring = 'UTC+' . $current_offset;
		}
		
		?>
		<th scope="row"><label for="timezone_string"><?php _e('Timezone') ?></label></th>
		<td>
		
		<select id="timezone_string" name="timezone_string">
		<?php echo wp_timezone_choice($tzstring); ?>
		</select>
		
		    <span id="utc-time"><?php printf(__('<abbr title="Coordinated Universal Time">UTC</abbr> time is <code>%s</code>'), date_i18n($timezone_format, false, 'gmt')); ?></span>
		<?php if ($opt['timezone_string']) : ?>
			<span id="local-time"><?php printf(__('Local time is <code>%1$s</code>'), date_i18n($timezone_format)); ?></span>
		<?php endif; ?>
		<br />
		<span class="description"><?php _e('Choose a city in the same timezone as you.'); ?></span>
		<br />
		<span>
		<?php if ($check_zone_info && $tzstring) : ?>
			<?php
			$now = localtime(time(),true);
			if ($now['tm_isdst']) _e('This timezone is currently in daylight savings time.');
			else _e('This timezone is currently in standard time.');
			?>
			<br />
			<?php
			
			if (function_exists('timezone_transitions_get')) {
				$dateTimeZoneSelected = new DateTimeZone($tzstring);
				foreach (timezone_transitions_get($dateTimeZoneSelected) as $tr) {
					if ($tr['ts'] > time()) {
					    $found = true;
						break;
					}
				}
		
				if ( isset($found) && $found === true ) {
					echo ' ';
					$message = $tr['isdst'] ?
						__('Daylight savings time begins on: <code>%s</code>.') :
						__('Standard time begins  on: <code>%s</code>.');
					printf( $message, date_i18n($opt['date_format'].' '. $opt['time_format'], $tr['ts'] ) );
				} else {
					_e('This timezone does not observe daylight savings time.');
				}
			}
			
			?>
			</span>
		<?php endif; ?>
		</td>
		
		
		</tr>

<!-- End Time Zone -->
	
	
	
		
        <tr>
        <th scope="row"><?php _e('Date Format') ?></th>
        <td>
			<fieldset><legend class="screen-reader-text"><span><?php _e('Date Format') ?></span></legend>
<?php

	$date_formats = apply_filters( 'date_formats', array(
		__('F j, Y'),
		'Y/m/d',
		'm/d/Y',
		'd/m/Y',
	) );

	$custom = TRUE;

	foreach ( $date_formats as $format ) {
		echo "\t<label title='" . esc_attr($format) . "'><input type='radio' name='date_format' value='" . esc_attr($format) . "'";
		if ( $opt['date_format'] === $format ) { // checked() uses "==" rather than "==="
			echo " checked='checked'";
			$custom = FALSE;
		}
		echo ' /> ' . date_i18n( $format ) . "</label><br />\n";
	}

	echo '	<label><input type="radio" name="date_format" id="date_format_custom_radio" value="custom"';
	checked( $custom );
	echo '/> ' . __('Custom:') . ' </label><input type="text" name="date_format_custom" value="' . esc_attr( $opt['date_format'] ) . '" class="small-text" /> ' . date_i18n( $opt['date_format'] ) . "\n";
	

	echo "\t<p>" . __('<a href="http://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date formatting</a>. Click &#8220;Save Changes&#8221; to update sample output.') . "</p>\n";
?>
	</fieldset>


		</td>
        </tr>
        <tr>
        <th scope="row"><?php _e('Time Format') ?></th>
        <td>
		<fieldset><legend class="screen-reader-text"><span><?php _e('Time Format') ?></span></legend>
		<?php
		 
			$time_formats = apply_filters( 'time_formats', array(
				__('g:i a'),
				'g:i A',
				'H:i',
			) );
		
			$custom = TRUE;
		
			foreach ( $time_formats as $format ) {
				echo "\t<label title='" . esc_attr($format) . "'><input type='radio' name='time_format' value='" . esc_attr($format) . "'";
				if ( $opt['time_format'] === $format ) { // checked() uses "==" rather than "==="
					echo " checked='checked'";
					$custom = FALSE;
				}
				echo ' /> ' . date_i18n( $format ) . "</label><br />\n";
			}
		
			echo '	<label><input type="radio" name="time_format" id="time_format_custom_radio" value="custom"';
			checked( $custom );
			echo '/> ' . __('Custom:') . ' </label><input type="text" name="time_format_custom" value="' . esc_attr( $opt['time_format'] ) . '" class="small-text" /> ' . date_i18n( $opt['time_format'] ) . "\n";
		?>
			</fieldset>



		</td>
        </tr>
        <tr>
        <th scope="row"><?php _e('Week Starts On') ?></th>
        <td>
        
        <select name="start_of_week" id="start_of_week">
        <?php
		global $wp_locale;
        for ($day_index = 0; $day_index <= 6; $day_index++) :
            $selected = ($opt['start_of_week'] == $day_index) ? 'selected="selected"' : '';
			
            echo "\n\t<option value='$day_index' $selected>" . $wp_locale->get_weekday($day_index) . '</option>';
        endfor;
        ?>
        </select></td>
        </tr>
        </table>
        </div>
        <p>&nbsp;</p>
        <div class="wrap">
        <h2><?php _e('Writing Settings') ?></h2>
        <table class="form-table">
        <tr valign="top">
        <th scope="row"> <?php _e('Size of the post box') ?></th>
        <td><input name="default_post_edit_rows" type="text" id="default_post_edit_rows" value="<?php echo($opt['default_post_edit_rows']); ?>" size="3" />
        <?php _e('lines') ?></td>
        </tr>
        <tr valign="top">
        <th scope="row"><?php _e('Formatting') ?></th>
        <td>
        <label for="use_smilies">
        <input name="use_smilies" type="checkbox" id="use_smilies" value="1" <?php checked('1', $opt['use_smilies']); ?> />
        <?php _e('Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display') ?></label><br />
        <label for="use_balanceTags"><input name="use_balanceTags" type="checkbox" id="use_balanceTags" value="1" <?php checked('1', $opt['use_balanceTags']); ?> /> <?php _e('WordPress should correct invalidly nested XHTML automatically') ?></label>
        </td>
        </tr>
        
        </table>
		
		<h3><?php _e('Remote Publishing') ?></h3>
		<p><?php printf(__('To post to WordPress from a desktop blogging client or remote website that uses the Atom Publishing Protocol or one of the XML-RPC publishing interfaces you must enable them below.')) ?></p>
		<table class="form-table">
		<tr valign="top">
		<th scope="row"><?php _e('Atom Publishing Protocol') ?></th>
		<td><fieldset><legend class="screen-reader-text"><span><?php _e('Atom Publishing Protocol') ?></span></legend>
		<label for="enable_app">
		<input name="enable_app" type="checkbox" id="enable_app" value="1" <?php checked('1', $opt['enable_app']); ?> />
		<?php _e('Enable the Atom Publishing Protocol.') ?></label><br />
		</fieldset></td>
		</tr>
		<tr valign="top">
		<th scope="row"><?php _e('XML-RPC') ?></th>
		<td><fieldset><legend class="screen-reader-text"><span><?php _e('XML-RPC') ?></span></legend>
		<label for="enable_xmlrpc">
		<input name="enable_xmlrpc" type="checkbox" id="enable_xmlrpc" value="1" <?php checked('1', $opt['enable_xmlrpc']); ?> />
		<?php _e('Enable the WordPress, Movable Type, MetaWeblog and Blogger XML-RPC publishing protocols.') ?></label><br />
		</fieldset></td>
		</tr>
		</table>
      </div>
      
      <p>&nbsp;</p>
      <div class="wrap">
        <h2><?php _e('Reading Settings') ?></h2>
        <table class="form-table">
        <tr valign="top">
        <th scope="row"><?php _e('Blog pages show at most') ?></th>
        <td>
        <input name="posts_per_page" type="text" id="posts_per_page" value="<?php echo($opt['posts_per_page']); ?>" size="3" /> <?php _e('posts') ?>
        </td>
        </tr>
        <tr valign="top">
        <th scope="row"><?php _e('Syndication feeds show the most recent') ?></th>
        <td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php echo($opt['posts_per_rss']); ?>" size="3" /> <?php _e('posts') ?></td>
        </tr>
        <tr valign="top">
        <th scope="row"><?php _e('For each article in a feed, show') ?> </th>
        <td>
        <p><label><input name="rss_use_excerpt"  type="radio" value="0" <?php checked(0, $opt['rss_use_excerpt']); ?>	/> <?php _e('Full text') ?></label><br />
        <label><input name="rss_use_excerpt" type="radio" value="1" <?php checked(1, $opt['rss_use_excerpt']); ?> /> <?php _e('Summary') ?></label></p>
        </td>
        </tr>
        
        <tr valign="top">
        <th scope="row"><?php _e('Encoding for pages and feeds') ?></th>
        <td><input name="blog_charset" type="text" id="blog_charset" value="<?php echo($opt['blog_charset']); ?>" size="20" class="code" /><br />
        <?php _e('The character encoding you write your blog in (UTF-8 is <a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html">recommended</a>)') ?></td>
        </tr>
        </table>
        
        </div>
        
        
        <p>&nbsp;</p>
        <div class="wrap">     
    	<h2>Discussion Settings</h2>
        <table class="form-table">
        <tr valign="top">
        <th scope="row"><?php _e('Default article settings') ?></th>
        <td>
         <label for="default_pingback_flag">
		 
       <input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php  if ($opt['default_pingback_flag'] == 1) echo('checked="checked"'); ?> /> <?php _e('Attempt to notify any blogs linked to from the article (slows down posting.)') ?> </label>
       
        <br /> 
		<label for="default_ping_status">
		
        <input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php if ($opt['default_ping_status'] == 'open') echo('checked="checked"'); ?> /> <?php _e('Allow link notifications from other blogs (pingbacks and trackbacks.)') ?></label>
       
        <br />
        <label for="default_comment_status">
		
        <input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php if ($opt['default_comment_status'] == 'open') echo('checked="checked"'); ?> /> <?php _e('Allow people to post comments on the article') ?></label>
    
        <br />
        <small><em><?php echo '(' . __('These settings may be overridden for individual articles.') . ')'; ?></em></small>
        </td>
        </tr>
		<tr valign="top">
		<th scope="row"><?php _e('Other comment settings') ?></th>
		<td><fieldset><legend class="hidden"><?php _e('Other comment settings') ?></legend>
		
		<label for="require_name_email">
		
        <input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php if ($opt['require_name_email'] == 1) echo('checked="checked"'); ?> /> <?php _e('Comment author must fill out name and e-mail') ?></label>
		<br />
		<label for="comment_registration">
		<input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked('1', $opt['comment_registration']); ?> />
		<?php _e('Users must be registered and logged in to comment') ?>
		</label>
		<br />
		
		<label for="close_comments_for_old_posts">
		<input name="close_comments_for_old_posts" type="checkbox" id="close_comments_for_old_posts" value="1" <?php checked('1', $opt['close_comments_for_old_posts']); ?> />
		<?php printf( __('Automatically close comments on articles older than %s days'), '</label><input name="close_comments_days_old" type="text" id="close_comments_days_old" value="' . esc_attr($opt['close_comments_days_old']) . '" class="small-text" />') ?>
		<br />
		<label for="thread_comments">
		<input name="thread_comments" type="checkbox" id="thread_comments" value="1" <?php checked('1', $opt['thread_comments']); ?> />
		<?php
		
		$maxdeep = (int) apply_filters( 'thread_comments_depth_max', 10 );
		
		
		
		$thread_comments_depth = '</label><select name="thread_comments_depth" id="thread_comments_depth">';
		for ( $i = 1; $i <= $maxdeep; $i++ ) {
			$thread_comments_depth .= "<option value='$i'";
			if (isset($opt['thread_comments_depth']) && $opt['thread_comments_depth'] == $i ) $thread_comments_depth .= " selected='selected'";
			$thread_comments_depth .= ">$i</option>";
		}
		$thread_comments_depth .= '</select>';
		
		printf( __('Enable threaded (nested) comments %s levels deep'), $thread_comments_depth );
		
		?><br />
		<label for="page_comments">
		<input name="page_comments" type="checkbox" id="page_comments" value="1" <?php checked('1', $opt['page_comments']); ?> />
		<?php
		
		
		$default_comments_page = '</label><label for="default_comments_page"><select name="default_comments_page" id="default_comments_page"><option value="newest"';
		if ( isset($opt['default_comments_page']) && 'newest' == $opt['default_comments_page'] ) $default_comments_page .= ' selected="selected"';
		$default_comments_page .= '>' . __('last') . '</option><option value="oldest"';
		if ( 'oldest' == $opt['default_comments_page'] ) $default_comments_page .= ' selected="selected"';
		$default_comments_page .= '>' . __('first') . '</option></select>';
		
		printf( __('Break comments into pages with %1$s comments per page and the %2$s page displayed by default'), '</label><label for="comments_per_page"><input name="comments_per_page" type="text" id="comments_per_page" value="' . esc_attr($opt['comments_per_page']) . '" class="small-text" />', $default_comments_page );
		
		?></label>
		<br />
		<label for="comment_order"><?php
		
		$comment_order = '<select name="comment_order" id="comment_order"><option value="asc"';
		if ( 'asc' == $opt['comment_order'] ) $comment_order .= ' selected="selected"';
		$comment_order .= '>' . __('older') . '</option><option value="desc"';
		if ( 'desc' == $opt['comment_order'] ) $comment_order .= ' selected="selected"';
		$comment_order .= '>' . __('newer') . '</option></select>';
		
		printf( __('Comments should be displayed with the %s comments at the top of each page'), $comment_order );
		
		?></label>
		</fieldset></td>
		</tr>
		
		
		
		
        <tr valign="top">
        <th scope="row"><?php _e('E-mail me whenever') ?></th>
        <td>
		<label for="comments_notify">
		
        <input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php if ($opt['comments_notify'] == 1 ) echo('checked="checked"'); ?> /> <?php _e('Anyone posts a comment') ?> </label>
         
        <br />
		<label for="moderation_notify">
		
        <input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php if ($opt['moderation_notify'] == 1) echo('checked="checked"'); ?> /> <?php _e('A comment is held for moderation') ?></label>
        </td>
        </tr>
        <tr valign="top">
        <th scope="row"><?php _e('Before a comment appears') ?></th>
        <td>
		<label for="comment_moderation">
		
        <input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php if ($opt['comment_moderation'] == 1) echo('checked="checked"'); ?> /> <?php _e('An administrator must always approve the comment') ?></label>
    
        
        
        <br />
		<label for="comment_whitelist">
        <input type="checkbox" name="comment_whitelist" id="comment_whitelist" value="1" <?php if ($opt['comment_whitelist'] == 1) echo('checked="checked"'); ?> /> <?php _e('Comment author must have a previously approved comment') ?></label>
       
        </td>
        </tr>
        <tr valign="top">
        <th scope="row"><?php _e('Comment Moderation') ?></th>
        <td>
        <p><?php printf(__('Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="text" id="comment_max_links" size="3" value="' . $opt['comment_max_links']. '" />' ) ?></p>
        
        <p><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be held in the <a href="edit-comments.php?comment_status=moderated">moderation queue</a>. One word or IP per line. It will match inside words, so "press" will match "WordPress".') ?></p>
        <p>
        <textarea name="moderation_keys" cols="60" rows="10" id="moderation_keys" style="width: 98%; font-size: 12px;" class="code"><?php echo($opt['moderation_keys']); ?></textarea>
        </p>
        </td>
        </tr>
        <tr valign="top">
        <th scope="row"><?php _e('Comment Blacklist') ?></th>
        <td>
        <p><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be marked as spam. One word or IP per line. It will match inside words, so "press" will match "WordPress".') ?></p>
        <p>
        <textarea name="blacklist_keys" cols="60" rows="10" id="blacklist_keys" style="width: 98%; font-size: 12px;" class="code"><?php echo($opt['blacklist_keys']); ?></textarea>
        </p>
        </td>
        </tr>
        </table>
        
        <h3><?php _e('Avatars') ?></h3>

        <p><?php _e('By default WordPress uses <a href="http://gravatar.com/">Gravatars</a> &#8212; short for Globally Recognized Avatars &#8212; for the pictures that show up next to comments. Plugins may override this.'); ?></p>
        
        <?php // the above would be a good place to link to codex documentation on the gravatar functions, for putting it in themes. anything like that? ?>
        
        <table class="form-table">
        <tr valign="top">
        <th scope="row"><?php _e('Avatar display') ?></th>
        <td>
        <?php
            $yesorno = array(0 => __("Don&#8217;t show Avatars"), 1 => __('Show Avatars'));
            foreach ( $yesorno as $key => $value) {
                $selected = ($opt['show_avatars'] == $key) ? 'checked="checked"' : '';
                echo "\n\t<label><input type='radio' name='show_avatars' value='$key' $selected> $value</label><br />";
            }
        ?>
        </td>
        </tr>
        <tr valign="top">
        <th scope="row"><?php _e('Maximum Rating') ?></th>
        <td>
        
        <?php
        $ratings = array( 'G' => __('G &#8212; Suitable for all audiences'), 'PG' => __('PG &#8212; Possibly offensive, usually for audiences 13 and above'), 'R' => __('R &#8212; Intended for adult audiences above 17'), 'X' => __('X &#8212; Even more mature than above'));
        foreach ($ratings as $key => $rating) :
          	$selected = ($opt['avatar_rating'] == $key) ? 'checked="checked"' : '';
            echo "\n\t<label><input type='radio' name='avatar_rating' value='$key' $selected> $rating</label><br />";
        endforeach;
        ?>
        
        </td>
        </tr>
		
		
		
		<tr valign="top">
		<th scope="row"><?php _e('Default Avatar') ?></th>
		<td class="defaultavatarpicker"><fieldset><legend class="hidden"><?php _e('Default Avatar') ?></legend>
		
		<?php _e('For users without a custom avatar of their own, you can either display a generic logo or a generated one based on their e-mail address.'); ?><br />
		
		<?php
		$avatar_defaults = array(
			'mystery' => __('Mystery Man'),
			'blank' => __('Blank'),
			'gravatar_default' => __('Gravatar Logo'),
			'identicon' => __('Identicon (Generated)'),
			'wavatar' => __('Wavatar (Generated)'),
			'monsterid' => __('MonsterID (Generated)')
		);
		$avatar_defaults = apply_filters('avatar_defaults', $avatar_defaults);
		$default = $opt['avatar_default'];
		if ( empty($default) )
			$default = 'mystery';
		$size = 32;
		$avatar_list = '';
		foreach ( $avatar_defaults as $default_key => $default_name ) {
			$selected = ($default == $default_key) ? 'checked="checked" ' : '';
			$avatar_list .= "\n\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='{$default_key}' {$selected}/> ";
		
			//$avatar = get_avatar( $user_email, $size, $default_key );
			//$avatar_list .= preg_replace("/src='(.+?)'/", "src='\$1&amp;forcedefault=1'", $avatar);
		
			$avatar_list .= ' ' . $default_name . '</label>';
			$avatar_list .= '<br />';
		}
		echo apply_filters('default_avatar_select', $avatar_list);
		?>
		
		</fieldset></td>
		</tr>
		
		
        
        </table>

        </div>
        <p>&nbsp;</p>
        <div class="wrap">
        <h2><?php _e('Privacy Settings') ?></h2>
        <table class="form-table">
        <tr valign="top">
        <th scope="row"><?php _e('Blog Visibility') ?> </th>
        <td>
        <p>Warning: It can be confusing for users to have these settings override the setting they choose on the sign up form. If you do not want to override user settings, select "Allow User Choice".</p>
		
		<p><input id="blog-public-reset" type="radio" name="blog_public" value="" <?php checked('', $opt['blog_public']); ?> />
        <label for="blog-public-reset"><?php _e('Allow User Choice'); ?></label></p>
        <p><input id="blog-public" type="radio" name="blog_public" value="1" <?php checked('1', $opt['blog_public']); ?> />
        <label for="blog-public"><?php _e('I would like my blog to be visible to everyone, including search engines (like Google, Sphere, Technorati) and archivers and in public listings around this site.') ?></label></p>
        <p><input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked('0', $opt['blog_public']); ?> />
        <label for="blog-norobots"><?php _e('I would like to block search engines, but allow normal visitors'); ?></label></p>
        <?php do_action('blog_privacy_selector'); ?>
        </td>
        </tr>
        </table>
        
       
        </div>
        <p>&nbsp;</p>
		<div class="wrap">
        <h2><?php _e('Customize Permalink Structure') ?></h2>
        <p><?php _e('By default WordPress uses web <abbr title="Universal Resource Locator">URL</abbr>s which have question marks and lots of numbers in them, however WordPress offers you the ability to create a custom URL structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="http://codex.wordpress.org/Using_Permalinks">number of tags are available</a>, and here are some examples to get you started.'); ?></p>
        
        <?php
        $prefix = '';
        
        if ( ! got_mod_rewrite() )
            $prefix = '/index.php';
        
        $structures = array(
            '',
            $prefix . '/%year%/%monthnum%/%day%/%postname%/',
            $prefix . '/%year%/%monthnum%/%postname%/',
            $prefix . '/archives/%post_id%'
            );
        ?>
        <h3><?php _e('Common settings'); ?></h3>
        
        <table class="form-table">
            <tr>
                <th><label><input name="permalink_choice" type="radio" value="" class="tog" <?php checked('', $opt['permalink_structure']); ?> /> <?php _e('Default'); ?></label></th>
                <td>&nbsp;</td>
             </tr>
            <tr>
                <th><label><input name="permalink_choice" type="radio" value="<?php echo $structures[1]; ?>" class="tog" <?php checked($structures[1], $opt['permalink_structure']); ?> /> <?php _e('Day and name'); ?></label></th>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <th><label><input name="permalink_choice" type="radio" value="<?php echo $structures[2]; ?>" class="tog" <?php checked($structures[2], $opt['permalink_structure']); ?> /> <?php _e('Month and name'); ?></label></th>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <th><label><input name="permalink_choice" type="radio" value="<?php echo $structures[3]; ?>" class="tog" <?php checked($structures[3], $opt['permalink_structure']); ?> /> <?php _e('Numeric'); ?></label></th>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <th>
                    <label><input name="permalink_choice" id="custom_selection" type="radio" value="custom" class="tog"
                    <?php if ( !in_array($opt['permalink_structure'], $structures) ) { ?>
                    checked="checked"
                    <?php } ?>
                     />
                    <?php _e('Custom Structure'); ?>
                    </label>
                </th>
                <td>
                    <?php if( constant( 'VHOST' ) == 'no' && $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) { echo "/blog"; $permalink_structure = str_replace( "/blog", "", $opt['permalink_structure'] ); }?>
                    <input name="permalink_structure" id="permalink_structure" type="text" class="code" style="width: 60%;" value="<?php echo esc_attr($opt['permalink_structure']); ?>" size="50" />
                </td>
            </tr>
        </table>
        
        <h3><?php _e('Optional'); ?></h3>
        <?php if ($is_apache) : ?>
            <p><?php _e('If you like, you may enter custom structures for your category and tag <abbr title="Universal Resource Locator">URL</abbr>s here. For example, using <code>/topics/</code> as your category base would make your category links like <code>http://example.org/topics/uncategorized/</code>. If you leave these blank the defaults will be used.') ?></p>
        <?php else : ?>
            <p><?php _e('If you like, you may enter custom structures for your category and tag <abbr title="Universal Resource Locator">URL</abbr>s here. For example, using <code>/topics/</code> as your category base would make your category links like <code>http://example.org/index.php/topics/uncategorized/</code>. If you leave these blank the defaults will be used.') ?></p>
        <?php endif; ?>
        
        <table class="form-table">
            <tr>
                <th><?php _e('Category base'); ?></th>
                <td><?php if( constant( 'VHOST' ) == 'no' && $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) { echo "/blog"; $opt['category_base'] = str_replace( "/blog", "", $opt['category_base'] ); }?> <input name="category_base" type="text" class="code"  value="<?php echo esc_attr( $opt['category_base'] ); ?>" size="30" /></td>
            </tr>
            <tr>
                <th><?php _e('Tag base'); ?></th>
                <td><?php if( constant( 'VHOST' ) == 'no' && $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path ) { echo "/blog"; $opt['tag_base'] = str_replace( "/blog", "", $opt['tag_base'] ); }?> <input name="tag_base" id="tag_base" type="text" class="code"  value="<?php echo esc_attr($opt['tag_base']); ?>" size="30" /></td>
            </tr>
        </table>
        
        </div>
                
        
        <p>&nbsp;</p>
        
        <div class="wrap">
        <h2><?php _e('Media Settings'); ?></h2>
        <h3><?php _e('Image sizes') ?></h3>
        <p><?php _e('The sizes listed below determine the maximum dimensions to use when inserting an image into the body of a post.'); ?></p>
        
        <table class="form-table">
        <tr valign="top">
        <th scope="row"><?php _e('Thumbnail size') ?></th>
        <td>
        <label for="thumbnail_size_w"><?php _e('Width'); ?></label>
        <input name="thumbnail_size_w" type="text" id="thumbnail_size_w" value="<?php echo($opt['thumbnail_size_w']); ?>" size="6" />
        <label for="thumbnail_size_h"><?php _e('Height'); ?></label>
        <input name="thumbnail_size_h" type="text" id="thumbnail_size_h" value="<?php echo($opt['thumbnail_size_h']); ?>" size="6" /><br />
        <input name="thumbnail_crop" type="checkbox" id="thumbnail_crop" value="1" <?php checked('1', $opt['thumbnail_crop']); ?>/>
        <label for="thumbnail_crop"><?php _e('Crop thumbnail to exact dimensions (normally thumbnails are proportional)'); ?></label>
        </td>
        </tr>
        <tr valign="top">
        <th scope="row"><?php _e('Medium size') ?></th>
        <td>
        <label for="medium_size_w"><?php _e('Max Width'); ?></label>
        <input name="medium_size_w" type="text" id="medium_size_w" value="<?php echo($opt['medium_size_w']); ?>" size="6" />
        <label for="medium_size_h"><?php _e('Max Height'); ?></label>
        <input name="medium_size_h" type="text" id="medium_size_h" value="<?php echo($opt['medium_size_h']); ?>" size="6" />
        </td>
        </tr>
			<tr valign="top">
		<th scope="row"><?php _e('Large size') ?></th>
		<td><fieldset><legend class="hidden"><?php _e('Large size') ?></legend>
		<label for="large_size_w"><?php _e('Max Width'); ?></label>
		<input name="large_size_w" type="text" id="large_size_w" value="<?php echo($opt['large_size_w']); ?>" class="small-text" />
		<label for="large_size_h"><?php _e('Max Height'); ?></label>
		<input name="large_size_h" type="text" id="large_size_h" value="<?php echo($opt['large_size_h']); ?>" class="small-text" />
		</fieldset></td>
		</tr>
		</table>
        <h3><?php _e('Embeds') ?></h3>

		<table class="form-table">
		
		<tr valign="top">
		<th scope="row"><?php _e('Auto-embeds'); ?></th>
		<td><fieldset><legend class="screen-reader-text"><span><?php _e('Attempt to automatically embed all plain text URLs'); ?></span></legend>
		<label for="embed_autourls"><input name="embed_autourls" type="checkbox" id="embed_autourls" value="1" <?php checked( '1', $opt['embed_autourls'] ); ?>/> <?php _e('Attempt to automatically embed all plain text URLs'); ?></label>
		</fieldset></td>
		</tr>
		
		<tr valign="top">
		<th scope="row"><?php _e('Maximum embed size') ?></th>
		<td>
		<label for="embed_size_w"><?php _e('Width'); ?></label>
		<input name="embed_size_w" type="text" id="embed_size_w" value="<?php echo $opt['embed_size_w']; ?>" class="small-text" />
		<label for="embed_size_h"><?php _e('Height'); ?></label>
		<input name="embed_size_h" type="text" id="embed_size_h" value="<?php echo $opt['embed_size_h']; ?>" class="small-text" />
		<?php if ( !empty($content_width) ) echo '<br />' . __("If the width value is left blank, embeds will default to the max width of your theme."); ?>
		</td>
		</tr>
		
		
		</table>
        </div>
        <p>&nbsp;</p>
        <div class="wrap">
        <h2>Default Theme</h2>
        <?php 
		$themes = get_themes();
		$ct = current_theme_info();
		$allowed_themes = get_site_allowed_themes();
		if( $allowed_themes == false )
			$allowed_themes = array();
		
		$blog_allowed_themes = wpmu_get_blog_allowedthemes();
		if( is_array( $blog_allowed_themes ) )
			$allowed_themes = array_merge( $allowed_themes, $blog_allowed_themes );
		
		if( $blog_id != 1 ) {
			unset( $allowed_themes[ "h3" ] );
		}
		
		if( isset( $allowed_themes[ esc_html( $ct->stylesheet ) ] ) == false )
			$allowed_themes[ esc_html( $ct->stylesheet ) ] = true;
		
		reset( $themes );
		foreach( $themes as $key => $theme ) {
			if( isset( $allowed_themes[ esc_html( $theme[ 'Stylesheet' ] ) ] ) == false ) {
				unset( $themes[ $key ] );
			}
		}
		reset( $themes );
		
		// get the names of the themes & sort them
		$theme_names = array_keys($themes);
		natcasesort($theme_names);
		?>
        <table class="form-table">
        <tr valign="top">
        <th>Select the default theme:</th>
        <td><select name="theme" size="1">
        <?php
		foreach ($theme_names as $theme_name) {
		$template = $themes[$theme_name]['Template'];
		$stylesheet = $themes[$theme_name]['Stylesheet'];
		$title = $themes[$theme_name]['Title'];
		$selected = "";
		if($opt[theme] == $template . "|" . $stylesheet) {
			$selected = "selected = 'selected' ";
		}
		echo('<option value="' . $template . "|" . $stylesheet .  '"' . $selected . '>' . $title . "</option>");
		}
		?>
        </select>
        </td>
        </tr>
        </table>
        </div>
        
        <div class="wrap">
        <h2>Bonus Settings</h2>
		<table class="form-table">
        <tr valign="top">
        <th>From Email:</th>
		<td><input name="from_email" type="text" id="from_email" size="30" value="<?php echo($opt['from_email']); ?>"  /></td>
		</tr>
		  <tr valign="top">
        <th>From Email Name:<br/>(defaults to site name if left blank)</th>
		<td><input name="from_email_name" type="text" id="from_email_name" size="30" value="<?php echo($opt['from_email_name']); ?>"  /></td>
		</tr>
		<tr>
			<th>Delete Standard WordPress Blogroll Links</th>
			<td>
		<label for="delete_blogroll_links">
		
        <input name="delete_blogroll_links" type="checkbox" id="delete_blogroll_links" value="1" <?php if ($opt['delete_blogroll_links'] == 1) echo('checked="checked"'); ?> /> <?php _e('Yes') ?></label>
		</td>
		</tr>
		<tr valign="top">
        <th>Default Link Category:<br/> (Overwrites "Blogroll")</th>
		<td><input name="default_link_cat" type="text" id="default_link_cat" size="30" value="<?php echo($opt['default_link_cat']); ?>"  /></td>
		</tr>
		<tr valign="top">
        <th scope="row"><?php _e('Additional Links') ?></th>
        <td>
        <p><?php _e('Enter links one per line with the name followed by an equals sign and a greater than sign and then the fully qualified link. Example: Google=>http://www.google.com') ?></p>
        <p>
        <textarea name="default_links" cols="60" rows="10" id="default_links" style="width: 98%; font-size: 12px;" class="code"><?php echo(str_replace('|+', "\n", $opt['default_links'])); ?></textarea>
        </p>
        </td>
        </tr>
		
		<tr valign="top">
        <th>Default Category:<br/> (Overwrites "Uncategorized")</th>
		<td><input name="default_cat_name" type="text" id="default_cat_name" size="30" value="<?php echo($opt['default_cat_name']); ?>"  /></td>
		</tr>
		<tr valign="top">
        <th scope="row"><?php _e('Additional Categories') ?></th>
        <td>
        <p><?php _e('Enter categories one per line with the name followed by an equals sign and a greater than sign and then the description => Nice Name => parent name. Example: Plugins=>Find out out about my plugins=>plugins=>code') ?></p>
        <p>
        <textarea name="default_categories" cols="60" rows="10" id="default_categories" style="width: 98%; font-size: 12px;" class="code"><?php echo(str_replace('|+', "\n", $opt['default_categories'])); ?></textarea>
        </p>
        </td>
        </tr>
		
    	<tr>
			<th>Delete Initial Comment</th>
			<td>
		<label for="delete_first_comment">
		
        <input name="delete_first_comment" type="checkbox" id="delete_first_comment" value="1" <?php if ($opt['delete_first_comment'] == 1) echo('checked="checked"'); ?> /> <?php _e('Yes') ?></label>
		</td>
		</tr>
		<tr>
			<th>Close Comments on Hello World Post</th>
			<td>
		<label for="close_comments_on_hello_world">
		
        <input name="close_comments_on_hello_world" type="checkbox" id="close_comments_on_hello_world" value="1" <?php if ($opt['close_comments_on_hello_world'] == 1) echo('checked="checked"'); ?> /> <?php _e('Yes') ?></label>
		</td>
		</tr>
		<tr>
			<th>Close Comments on About Page</th>
			<td>
		<label for="close_comments_on_about_page">
		
        <input name="close_comments_on_about_page" type="checkbox" id="close_comments_on_about_page" value="1" <?php if ($opt['close_comments_on_about_page'] == 1) echo('checked="checked"'); ?> /> <?php _e('Yes') ?></label>
		</td>
		</tr>
		<tr>
			<th>Make First Post a Draft ("Hello World")</th>
			<td>
		<label for="delete_first_post">
		
        <input name="delete_first_post" type="checkbox" id="delete_first_post" value="1" <?php if ($opt['delete_first_post'] == 1) echo('checked="checked"'); ?> /> <?php _e('Yes') ?></label>
		</td>
		</tr>
		
		<tr>
			<th>Delete Initial Widgets</th>
			<td>
			<input name="delete_initial_widgets" type="checkbox" id="delete_initial_widgets" value="1" <?php if ($opt['delete_initial_widgets'] == 1) echo('checked="checked"'); ?> /> <?php _e('Yes') ?>
			</td>
		</tr>
		
		<tr>
			<th colspan="2">
				Sites that use a combination of BBPress and BuddyPress need all users to be subscribed to the blog on which BBPress is installed. The following section lets you do that. Note that you may add people to a comma-delimited list of blogs, but they will have the same role on each blog. 
			</td>
		</tr>
		<tr valign="top">
        <th>Add User to Other Blog(s):</th>
		<td><input name="add_user_to_blog" type="checkbox" id="add_user_to_blog" value="1" <?php if ($opt['add_user_to_blog'] == 1) echo('checked="checked"'); ?> /> <?php _e('Yes') ?></label>
		</td>
		</tr>
		<tr valign="top">
        <th>Role on Other Blog (s)</th>
		<td>
			<select name="add_user_to_blog_role" id="add_user_to_blog_role">
			<option value="administrator"<?php if($opt['add_user_to_blog_role'] == 'administrator') echo ' selected="selected"';?>>Administator</option>
			<option value="editor"<?php if($opt['add_user_to_blog_role'] == 'editor') echo ' selected="selected"';?>>Editor</option>
			<option value="author"<?php if($opt['add_user_to_blog_role'] == 'author') echo ' selected="selected"';?>>Author</option>
			<option value="contributor"<?php if($opt['add_user_to_blog_role'] == 'contributor') echo ' selected="selected"';?>>Contributor</option>
			<option value="subscriber"<?php if($opt['add_user_to_blog_role'] == 'subscriber') echo ' selected="selected"';?>>Subscriber</option>				
		</select></td>
		</tr>
		<tr valign="top">
        <th>Blog ID's to add User To:</th>
		<td><input name="add_user_to_blog_id" type="text" id="add_user_to_blog_id" size="30" value="<?php echo($opt['add_user_to_blog_id']); ?>"  /><br/>Use Blog ID or comma-delimited list of ID's.</td>
		</tr>
		</table>
		</div>
        
        
         <p>  
         <input type="hidden" name="action" value="update" />
        <input type="submit" name="Submit" value="<?php _e('Save Changes') ?>" />
          </p> 
        
        <?php
	 }
コード例 #12
0
    } elseif ($current_offset < 0) {
        $tzstring = 'UTC' . $current_offset;
    } else {
        $tzstring = 'UTC+' . $current_offset;
    }
}
?>
<th scope="row"><label for="timezone_string"><?php 
_e('Timezone');
?>
</label></th>
<td>

<select id="timezone_string" name="timezone_string" aria-describedby="timezone-description">
	<?php 
echo wp_timezone_choice($tzstring, get_user_locale());
?>
</select>

<p class="description" id="timezone-description"><?php 
_e('Choose either a city in the same timezone as you or a UTC timezone offset.');
?>
</p>

<p class="timezone-info">
	<span id="utc-time"><?php 
/* translators: 1: UTC abbreviation, 2: UTC time */
printf(__('Universal time (%1$s) is %2$s.'), '<abbr>' . __('UTC') . '</abbr>', '<code>' . date_i18n($timezone_format, false, true) . '</code>');
?>
</span>
<?php 
コード例 #13
0
 /**
  * add_profile_boxes method
  *
  * Add options HTML to `wp-admin/profile.php` page.
  *
  * @return void Method does not return
  */
 public function add_profile_boxes()
 {
     global $ai1ec_view_helper;
     $user = wp_get_current_user();
     $selected_tz = '';
     if ($user->ID > 0) {
         $selected_tz = $this->user_selected_tz($user->ID);
     }
     $argv = array('tz_selector' => wp_timezone_choice($selected_tz));
     $ai1ec_view_helper->display_admin('box_profile_timezone.php', $argv);
 }
コード例 #14
0
 public static function select_timezone($field, $meta)
 {
     $meta = '' !== $meta ? $meta : $field['std'];
     if ('' === $meta) {
         $meta = cpmb_Meta_Box::timezone_string();
     }
     echo '<select name="', $field['id'], '" id="', $field['id'], '">';
     echo wp_timezone_choice($meta);
     echo '</select>';
 }
コード例 #15
0
ファイル: class-dc-wp-fields.php プロジェクト: itsunus/wstore
 /**
  * Output a select input box.
  *
  * @access public
  * @param array $field
  * @return void
  */
 public function timezone_input($field)
 {
     $field['class'] = isset($field['class']) ? $field['class'] : 'select short';
     $field['value'] = isset($field['value']) ? $field['value'] : '';
     $field['name'] = isset($field['name']) ? $field['name'] : $field['id'];
     // Custom attribute handling
     $custom_attributes = array();
     if (!empty($field['custom_attributes']) && is_array($field['custom_attributes'])) {
         foreach ($field['custom_attributes'] as $attribute => $value) {
             $custom_attributes[] = 'data-' . esc_attr($attribute) . '="' . esc_attr($value) . '"';
         }
     }
     $options = wp_timezone_choice($field['value']);
     $field = $this->field_wrapper_start($field);
     printf('<select id="%s" name="%s" class="%s" %s />%s</select>', esc_attr($field['id']), esc_attr($field['name']), esc_attr($field['class']), implode(' ', $custom_attributes), $options);
     $this->field_wrapper_end($field);
 }
コード例 #16
0
ファイル: test-cmb-types.php プロジェクト: Dovahkiin1991/CMB2
 public function test_select_timezone_field_after_value_update()
 {
     $value_to_save = cmb2_utils()->timezone_string();
     update_post_meta($this->post_id, $this->text_type_field['id'], $value_to_save);
     $zones = wp_timezone_choice($value_to_save);
     $this->assertHTMLstringsAreEqual(sprintf('<select class="cmb2_select cmb2-select-timezone" name="field_test_field" id="field_test_field">%s</select><span class="cmb2-metabox-description">This is a description</span>', $zones), $this->capture_render(array($this->get_field_type_object('select_timezone'), 'render')));
     delete_post_meta($this->post_id, $this->text_type_field['id']);
 }
コード例 #17
0
 if (!($timezone_string = bb_get_option('timezone_string'))) {
     // set the Etc zone if no timezone string exists
     $_gmt_offset = (int) round($gmt_offset);
     if ($_gmt_offset === 0) {
         $timezone_string = 'Etc/UTC';
     } elseif ($_gmt_offset > 0) {
         // Zoneinfo has these signed backwards to common convention
         $timezone_string = 'Etc/GMT-' . abs($_gmt_offset);
     } else {
         // Zoneinfo has these signed backwards to common convention
         $timezone_string = 'Etc/GMT+' . abs($_gmt_offset);
     }
     unset($_gmt_offset);
 }
 // Build the new selector
 $_time_options = array('timezone_string' => array('title' => __('Time zone'), 'type' => 'select', 'options' => wp_timezone_choice($timezone_string), 'note' => array(__('Choose a city in the same time zone as you.'), sprintf(__('<abbr title="Coordinated Universal Time">UTC</abbr> time is <code>%s</code>'), bb_gmdate_i18n(bb_get_datetime_formatstring_i18n(), bb_current_time())), sprintf(__('Local time is <code>%s</code>'), bb_datetime_format_i18n(bb_current_time())))));
 $_now = localtime(bb_current_time(), true);
 if ($now['tm_isdst']) {
     $_time_options['timezone_string']['note'][] = __('This time zone is currently in daylight savings time.');
 } else {
     $_time_options['timezone_string']['note'][] = __('This time zone is currently in standard time.');
 }
 if (function_exists('timezone_transitions_get')) {
     $timezone_object = new DateTimeZone($timezone_string);
     $found_transition = false;
     foreach (timezone_transitions_get($timezone_object) as $timezone_transition) {
         if ($timezone_transition['ts'] > time()) {
             $note = $timezone_transition['isdst'] ? __('Daylight savings time begins on <code>%s</code>') : __('Standard time begins on <code>%s</code>');
             $_time_options['timezone_string']['note'][] = sprintf($note, bb_gmdate_i18n(bb_get_datetime_formatstring_i18n(), $timezone_transition['ts'], false));
             break;
         }
コード例 #18
0
    /**
     * Output the about screen.
     */
    public function about_screen()
    {
        include_once 'class-sp-admin-settings.php';
        $class = 'chosen-select' . (is_rtl() ? ' chosen-rtl' : '');
        ?>
		<div class="wrap about-wrap about-sportspress-wrap">

			<?php 
        $this->intro();
        ?>

			<?php 
        // Save settings
        if (isset($_POST['timezone_string'])) {
            update_option('timezone_string', $_POST['timezone_string']);
            update_option('sportspress_basic_setup', 1);
        }
        if (isset($_POST['sportspress_sport']) && !empty($_POST['sportspress_sport'])) {
            $sport = $_POST['sportspress_sport'];
            SP_Admin_Sports::apply_preset($sport);
            update_option('sportspress_sport', $_POST['sportspress_sport']);
            update_option('_sportspress_needs_welcome', 1);
            ?>
				<div id="message" class="updated sportspress-message">
					<p><strong><?php 
            _e('Your settings have been saved.', 'sportspress');
            ?>
</strong></p>
				</div>
			<?php 
        }
        if (isset($_POST['add_sample_data'])) {
            SP_Admin_Sample_Data::delete_posts();
            SP_Admin_Sample_Data::insert_posts();
        }
        ?>
			<div class="sp-feature feature-section col two-col">
				<div>
					<?php 
        if (get_option('sportspress_basic_setup')) {
            ?>
						<h4><?php 
            _e('Sport', 'sportspress');
            ?>
</h4>
						<?php 
            $sport = get_option('sportspress_sport');
            $sport_options = SP_Admin_Sports::get_preset_options();
            foreach ($sport_options as $options) {
                foreach ($options as $slug => $name) {
                    if ($sport === $slug) {
                        $sport = $name;
                        break;
                    }
                }
            }
            echo $sport;
            ?>
						<a href="<?php 
            echo esc_url(admin_url(add_query_arg(array('page' => 'sportspress', 'tab' => 'general'), 'admin.php')));
            ?>
"><i class="dashicons dashicons-edit"></i> <?php 
            _e('Change', 'sportspress');
            ?>
</a>

						<h4><?php 
            _e('Next Steps', 'sportspress');
            ?>
</h4>
						<p><?php 
            _e('We&#8217;ve assembled some links to get you started:', 'sportspress');
            ?>
</p>
						<?php 
            $steps = apply_filters('sportspress_next_steps', array('teams' => array('link' => admin_url(add_query_arg(array('post_type' => 'sp_team'), 'edit.php')), 'icon' => 'sp-icon-shield', 'label' => __('Add New Team', 'sportspress')), 'players' => array('link' => admin_url(add_query_arg(array('post_type' => 'sp_player'), 'edit.php')), 'icon' => 'sp-icon-tshirt', 'label' => __('Add New Player', 'sportspress')), 'events' => array('link' => admin_url(add_query_arg(array('post_type' => 'sp_event'), 'edit.php')), 'icon' => 'sp-icon-calendar', 'label' => __('Add New Event', 'sportspress'))));
            ?>
						<?php 
            if (sizeof($steps)) {
                ?>
						<div class="sportspress-steps">
							<ul>
								<?php 
                foreach ($steps as $step) {
                    ?>
									<li><a href="<?php 
                    echo esc_url($step['link']);
                    ?>
" class="welcome-icon sp-welcome-icon"><i class="<?php 
                    echo sp_array_value($step, 'icon');
                    ?>
"></i> <?php 
                    echo $step['label'];
                    ?>
</a></li>
								<?php 
                }
                ?>
							</ul>
						</div>
						<?php 
            }
            ?>

						<h4><?php 
            _e('Settings', 'sportspress');
            ?>
</h4>
						<a href="<?php 
            echo esc_url(admin_url(add_query_arg(array('page' => 'sportspress', 'tab' => 'general'), 'admin.php')));
            ?>
"><?php 
            _e('Go to SportsPress Settings', 'sportspress');
            ?>
</a>
					<?php 
        } else {
            ?>
						<form method="post" id="mainform" action="" enctype="multipart/form-data">
							<h4><?php 
            _e('Basic Setup', 'sportspress');
            ?>
</h4>
							<p><?php 
            _e('Select your timezone and sport to get started.', 'sportspress');
            ?>
</p>
							<table class="form-table">
								<tbody>
									<tr valign="top">
										<th scope="row" class="titledesc">
											<label for="timezone_string"><?php 
            _e('Timezone', 'sportspress');
            ?>
 <i class="dashicons dashicons-editor-help sp-desc-tip" title="<?php 
            _e('Choose a city in the same timezone as you.', 'sportspress');
            ?>
"></i></label>
										</th>
										<td>
											<select id="timezone_string" name="timezone_string" class="<?php 
            echo $class;
            ?>
">
												<?php 
            $current_offset = get_option('gmt_offset');
            $tzstring = get_option('timezone_string');
            $check_zone_info = true;
            // Remove old Etc mappings. Fallback to gmt_offset.
            if (false !== strpos($tzstring, 'Etc/GMT')) {
                $tzstring = '';
            }
            if (empty($tzstring)) {
                // Create a UTC+- zone if no timezone string exists
                $check_zone_info = false;
                if (0 == $current_offset) {
                    $tzstring = 'UTC+0';
                } elseif ($current_offset < 0) {
                    $tzstring = 'UTC' . $current_offset;
                } else {
                    $tzstring = 'UTC+' . $current_offset;
                }
            }
            echo wp_timezone_choice($tzstring);
            ?>
											</select>
										</td>
									</tr>
									<?php 
            $sport_options = SP_Admin_Sports::get_preset_options();
            $settings = array(array('id' => 'sportspress_sport', 'default' => 'custom', 'type' => 'sport', 'title' => __('Sport', 'sportspress'), 'welcome' => true, 'class' => $class, 'options' => $sport_options));
            SP_Admin_Settings::output_fields($settings);
            ?>
								</tbody>
							</table>
					        <p class="submit sportspress-actions">
					        	<input name="save" class="button-primary" type="submit" value="<?php 
            _e('Save Changes', 'sportspress');
            ?>
" />
					        	<input type="hidden" name="subtab" id="last_tab" />
					        	<?php 
            wp_nonce_field('sportspress-settings');
            ?>
					        </p>
						</form>
					<?php 
        }
        ?>
				</div>
				<?php 
        if (current_user_can('install_themes') && !current_theme_supports('sportspress')) {
            ?>
					<div class="last-feature">
						<h4><?php 
            _e('Free SportsPress Theme', 'sportspress');
            ?>
</h4>
						<a href="<?php 
            echo add_query_arg(array('theme' => 'rookie'), network_admin_url('theme-install.php'));
            ?>
" class="sp-theme-screenshot"><img src="<?php 
            echo plugin_dir_url(SP_PLUGIN_FILE);
            ?>
/assets/images/modules/rookie.png"></a>
						<p><?php 
            _e('Have you tried the free Rookie theme yet?', 'sportspress');
            ?>
</p>
						<p><?php 
            _e('Rookie is a free starter theme for SportsPress designed by ThemeBoy.', 'sportspress');
            ?>
</p>
						<p class="sp-module-actions">
							<a class="button button-large" href="<?php 
            echo add_query_arg(array('theme' => 'rookie'), network_admin_url('theme-install.php'));
            ?>
"><?php 
            _e('Install Now', 'sportspress');
            ?>
</a>
						</p>
					</div>
				<?php 
        }
        ?>
			</div>
		</div>
		<?php 
    }
コード例 #19
0
function espresso_ddtimezone_simple($event_id = 0)
{
    global $wpdb;
    $tz_event = $wpdb->get_var($wpdb->prepare("SELECT timezone_string FROM " . EVENTS_DETAIL_TABLE . " WHERE id = '" . $event_id . "'"));
    $timezone_format = _x('Y-m-d G:i:s', 'timezone date format');
    $current_offset = get_option('gmt_offset');
    $tzstring = $tz_event != '' ? $tz_event : get_option('timezone_string');
    //echo $tzstring;
    $check_zone_info = true;
    // Remove old Etc mappings.  Fallback to gmt_offset.
    if (false !== strpos($tzstring, 'Etc/GMT')) {
        $tzstring = '';
    }
    if (empty($tzstring)) {
        // Create a UTC+- zone if no timezone string exists
        $check_zone_info = false;
        if (0 == $current_offset) {
            $tzstring = 'UTC+0';
        } elseif ($current_offset < 0) {
            $tzstring = 'UTC' . $current_offset;
        } else {
            $tzstring = 'UTC+' . $current_offset;
        }
    }
    ?>

    <p><select id="timezone_string" name="timezone_string">
            <?php 
    echo wp_timezone_choice($tzstring);
    ?>
        </select></p>
    <?php 
}
コード例 #20
0
 public function select_timezone()
 {
     $this->field->args['default'] = $this->field->args('default') ? $this->field->args('default') : cmb2_utils()->timezone_string();
     return $this->select(array('class' => 'cmb2_select cmb2-select-timezone', 'options' => wp_timezone_choice($this->field->escaped_value()), 'desc' => $this->_desc()));
 }
コード例 #21
0
					</tr>
					<tr class="event-timezone">
						<td class="label">
							<label for="event-timezone">
								<?php 
esc_html_e('Timezone:', 'the-events-calendar');
?>
							</label>
						</td>
						<td>
							<select tabindex="<?php 
tribe_events_tab_index();
?>
" name="EventTimezone" id="event-timezone" class="chosen">
								<?php 
echo wp_timezone_choice(Tribe__Events__Timezones::get_event_timezone_string());
?>
							</select>
						</td>
					</tr>
					<?php 
/**
 * Fires after the event end date field in The Events Calendar meta box
 * HTML outputted here should be wrapped in a table row (<tr>) that contains 2 cells (<td>s)
 *
 * @param int $event->ID the event currently being edited, will be 0 if creating a new event
 * @param boolean
 */
do_action('tribe_events_date_display', $event->ID, true);
?>
				</table>
コード例 #22
0
 public function select_timezone()
 {
     $this->field->args['default'] = $this->field->args('default') ? $this->field->args('default') : cmb_Meta_Box::timezone_string();
     $meta_value = $this->field->escaped_value();
     return '<select name="' . $this->_name() . '" id="' . $this->_id() . '">' . wp_timezone_choice($meta_value) . '</select>';
 }
コード例 #23
0
 public function render()
 {
     $this->field->args['default'] = $this->field->get_default() ? $this->field->get_default() : cmb2_utils()->timezone_string();
     $this->args = wp_parse_args($this->args, array('class' => 'cmb2_select cmb2-select-timezone', 'options' => wp_timezone_choice($this->field->escaped_value()), 'desc' => $this->_desc()));
     return parent::render();
 }