Gremlins in the options machine.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e9e2ba1ee1
commit
cf06e8e7f6
|
@ -110,6 +110,7 @@ include('options-head.php');
|
||||||
<?php _e('Output:') ?> <strong><?php echo gmdate(get_settings('time_format'), current_time('timestamp')); ?></strong></td>
|
<?php _e('Output:') ?> <strong><?php echo gmdate(get_settings('time_format'), current_time('timestamp')); ?></strong></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
<pre><?php var_dump($cache_settings); ?></pre>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<p style="text-align: right;">
|
<p style="text-align: right;">
|
||||||
<input type="submit" name="Submit" value="<?php _e('Update Options') ?>" />
|
<input type="submit" name="Submit" value="<?php _e('Update Options') ?>" />
|
||||||
|
|
|
@ -48,7 +48,7 @@ include('options-head.php');
|
||||||
<h2>Writing Options</h2>
|
<h2>Writing Options</h2>
|
||||||
<form name="form1" method="post" action="options.php">
|
<form name="form1" method="post" action="options.php">
|
||||||
<input type="hidden" name="action" value="update" />
|
<input type="hidden" name="action" value="update" />
|
||||||
<input type="hidden" name="page_options" value="'default_post_edit_rows','blog_charset','use_smilies','use_balanceTags','advanced_edit','ping_sites','mailserver_url', 'mailserver_port','mailserver_login','mailserver_pass','default_category'" />
|
<input type="hidden" name="page_options" value="'default_post_edit_rows','use_smilies','use_balanceTags','advanced_edit','ping_sites','mailserver_url', 'mailserver_port','mailserver_login','mailserver_pass','default_category'" />
|
||||||
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
|
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
|
||||||
<tr valign="top">
|
<tr valign="top">
|
||||||
<th scope="row"> <?php _e('When starting a post, show:') ?> </th>
|
<th scope="row"> <?php _e('When starting a post, show:') ?> </th>
|
||||||
|
|
|
@ -35,7 +35,7 @@ for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$option_group_id = (int) $_GET['option_group_id'];
|
if (isset($_GET['option_group_id'])) $option_group_id = (int) $_GET['option_group_id'];
|
||||||
require_once('./optionhandler.php');
|
require_once('./optionhandler.php');
|
||||||
$non_was_selected = 0;
|
$non_was_selected = 0;
|
||||||
if ('' == $_GET['option_group_id']) {
|
if ('' == $_GET['option_group_id']) {
|
||||||
|
@ -83,7 +83,7 @@ $nonbools = array('default_ping_status', 'default_comment_status');
|
||||||
}
|
}
|
||||||
if( in_array($option->option_name, $nonbools) && $new_val == 0 ) $new_value = 'closed';
|
if( in_array($option->option_name, $nonbools) && $new_val == 0 ) $new_value = 'closed';
|
||||||
if ($new_val !== $old_val) {
|
if ($new_val !== $old_val) {
|
||||||
$query = "UPDATE $tableoptions SET option_value = '$new_val' WHERE option_id = $option->option_id";
|
$query = "UPDATE $tableoptions SET option_value = '$new_val' WHERE option_name = '$option->option_name'";
|
||||||
$result = $wpdb->query($query);
|
$result = $wpdb->query($query);
|
||||||
//if( in_array($option->option_name, $nonbools)) die('boo'.$query);
|
//if( in_array($option->option_name, $nonbools)) die('boo'.$query);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
|
@ -109,7 +109,8 @@ $nonbools = array('default_ping_status', 'default_comment_status');
|
||||||
$message .= $dB_errors . '<br />' . $validation_message;
|
$message .= $dB_errors . '<br />' . $validation_message;
|
||||||
}
|
}
|
||||||
|
|
||||||
$goback = str_replace('?updated=true', '', $_SERVER['HTTP_REFERER']) . '?updated=true';
|
if (strstr($_SERVER['HTTP_REFERER'], '?')) $goback = str_replace('&updated=true', '', $_SERVER['HTTP_REFERER']) . '&updated=true';
|
||||||
|
else $goback = str_replace('?updated=true', '', $_SERVER['HTTP_REFERER']) . '?updated=true';
|
||||||
header('Location: ' . $goback);
|
header('Location: ' . $goback);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -731,7 +731,7 @@ function upgrade_110() {
|
||||||
// Add a gmt_offset option, with value $gmt_offset
|
// Add a gmt_offset option, with value $gmt_offset
|
||||||
if (!get_settings('gmt_offset')) {
|
if (!get_settings('gmt_offset')) {
|
||||||
if(!$wpdb->get_var("SELECT * FROM $tableoptions WHERE option_name = 'gmt_offset'")) {
|
if(!$wpdb->get_var("SELECT * FROM $tableoptions WHERE option_name = 'gmt_offset'")) {
|
||||||
$wpdb->query("INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level) VALUES (94, 'gmt_offset', 8, $gmt_offset, 'The difference in hours between GMT and your timezone', 8)");
|
$wpdb->query("INSERT INTO $tableoptions (option_name, option_type, option_value, option_description, option_admin_level) VALUES ('gmt_offset', 8, $gmt_offset, 'The difference in hours between GMT and your timezone', 8)");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,6 @@ function mysql2date($dateformatstring, $mysqlstring, $use_b2configmonthsdays = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
function current_time($type, $gmt = 0) {
|
function current_time($type, $gmt = 0) {
|
||||||
$time_difference = get_settings('time_difference');
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'mysql':
|
case 'mysql':
|
||||||
if ($gmt) $d = gmdate('Y-m-d H:i:s');
|
if ($gmt) $d = gmdate('Y-m-d H:i:s');
|
||||||
|
@ -300,9 +299,6 @@ function get_settings($setting) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// until we switch to using 'gmt_offset' everywhere
|
|
||||||
$setting = str_replace('time_difference', 'gmt_offset', $setting);
|
|
||||||
|
|
||||||
if ( (empty($cache_settings)) ) {
|
if ( (empty($cache_settings)) ) {
|
||||||
$settings = get_alloptions();
|
$settings = get_alloptions();
|
||||||
$cache_settings = $settings;
|
$cache_settings = $settings;
|
||||||
|
|
Loading…
Reference in New Issue