Option fixes.
git-svn-id: http://svn.automattic.com/wordpress/trunk@939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d31e7bcc4a
commit
0174984f7f
|
@ -66,6 +66,7 @@ if ($user_level <= 3) {
|
||||||
<h2>General Options</h2>
|
<h2>General 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="action" value="update" /> <input type="hidden" name="page_options" value="'blogname','blogdescription','siteurl','admin_email','users_can_register','new_users_can_blog','time_difference'" />
|
||||||
<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 width="33%" scope="row">Weblog title: </th>
|
<th width="33%" scope="row">Weblog title: </th>
|
||||||
|
@ -106,7 +107,7 @@ This address is used only for admin purposes. </td>
|
||||||
<td><code><?php echo gmdate('Y-m-d g:i:s a'); ?></code></td>
|
<td><code><?php echo gmdate('Y-m-d g:i:s a'); ?></code></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row"> Times in the weblog should differ by: </th>
|
<th scope="row">Times in the weblog should differ by: </th>
|
||||||
<td><input name="time_difference" type="text" id="time_difference" size="2" value="<?php echo get_settings('time_difference'); ?>" />
|
<td><input name="time_difference" type="text" id="time_difference" size="2" value="<?php echo get_settings('time_difference'); ?>" />
|
||||||
hours </td>
|
hours </td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -65,11 +65,12 @@ if ($user_level <= 3) {
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<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'" />
|
||||||
<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 width="33%" scope="row"> Size of the writing box, in lines:</th>
|
<th width="33%" scope="row"> Size of the writing box:</th>
|
||||||
<td><input name="default_post_edit_rows" type="text" id="default_post_edit_rows" value="<?php echo get_settings('default_post_edit_rows'); ?>" size="3" /></td>
|
<td><input name="default_post_edit_rows" type="text" id="default_post_edit_rows" value="<?php echo get_settings('default_post_edit_rows'); ?>" size="2" style="width: 1.5em; " />
|
||||||
|
lines </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr valign="top">
|
<tr valign="top">
|
||||||
<th scope="row">Character Setting: </th>
|
<th scope="row">Character Setting: </th>
|
||||||
|
|
|
@ -44,7 +44,7 @@ if ($option_group_id == '') {
|
||||||
|
|
||||||
switch($action) {
|
switch($action) {
|
||||||
|
|
||||||
case "update":
|
case 'update':
|
||||||
$standalone = 1;
|
$standalone = 1;
|
||||||
include_once("./admin-header.php");
|
include_once("./admin-header.php");
|
||||||
$any_changed = 0;
|
$any_changed = 0;
|
||||||
|
@ -53,19 +53,24 @@ case "update":
|
||||||
// pull the vars from the post
|
// pull the vars from the post
|
||||||
// validate ranges etc.
|
// validate ranges etc.
|
||||||
// update the values
|
// update the values
|
||||||
foreach ($_POST as $key => $value) {
|
if (!$_POST['page_options']) {
|
||||||
$option_names[] = "'$key'";
|
foreach ($_POST as $key => $value) {
|
||||||
|
$option_names[] = "'$key'";
|
||||||
|
}
|
||||||
|
$option_names = implode(',', $option_names);
|
||||||
|
} else {
|
||||||
|
$option_names = stripslashes($_POST['page_options']);
|
||||||
}
|
}
|
||||||
$option_names = implode(',', $option_names);
|
|
||||||
|
|
||||||
$options = $wpdb->get_results("SELECT $tableoptions.option_id, option_name, option_type, option_value, option_admin_level FROM $tableoptions WHERE option_name IN ($option_names)");
|
$options = $wpdb->get_results("SELECT $tableoptions.option_id, option_name, option_type, option_value, option_admin_level FROM $tableoptions WHERE option_name IN ($option_names)");
|
||||||
|
// die(var_dump($options));
|
||||||
if ($options) {
|
if ($options) {
|
||||||
foreach ($options as $option) {
|
foreach ($options as $option) {
|
||||||
// should we even bother checking?
|
// should we even bother checking?
|
||||||
if ($user_level >= $option->option_admin_level) {
|
if ($user_level >= $option->option_admin_level) {
|
||||||
$this_name = $option->option_name;
|
|
||||||
$old_val = stripslashes($option->option_value);
|
$old_val = stripslashes($option->option_value);
|
||||||
$new_val = $_POST[$this_name];
|
$new_val = $_POST[$option->option_name];
|
||||||
|
if (!$new_val) $new_val = 0;
|
||||||
|
|
||||||
if ($new_val != $old_val) {
|
if ($new_val != $old_val) {
|
||||||
// get type and validate
|
// get type and validate
|
||||||
|
|
Loading…
Reference in New Issue