$v) { if (is_array($v)) { $array[$k] = add_magic_quotes($v); } else { $array[$k] = addslashes($v); } } return $array; } if (!get_magic_quotes_gpc()) { $_GET = add_magic_quotes($_GET); $_POST = add_magic_quotes($_POST); $_COOKIE = add_magic_quotes($_COOKIE); } $wpvarstoreset = array('action','standalone', 'option_group_id'); for ($i=0; $i $value) { $option_names[] = "'$key'"; } $option_names = implode(',', $option_names); } else { $option_names = stripslashes($_POST['page_options']); } $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)); // HACK // Options that if not there have 0 value but need to be something like "closed" $nonbools = array('default_ping_status', 'default_comment_status'); if ($options) { foreach ($options as $option) { // should we even bother checking? if ($user_level >= $option->option_admin_level) { $old_val = stripslashes($option->option_value); $new_val = $_POST[$option->option_name]; if (!$new_val) { if (3 == $option->option_type) $new_val = ''; else $new_val = 0; } if( in_array($option->option_name, $nonbools) && $new_val == 0 ) $new_value = 'closed'; if ($new_val !== $old_val) { $query = "UPDATE $tableoptions SET option_value = '$new_val' WHERE option_id = $option->option_id"; $result = $wpdb->query($query); //if( in_array($option->option_name, $nonbools)) die('boo'.$query); if (!$result) { $db_errors .= " SQL error while saving $this_name. "; } else { ++$any_changed; } } } } // end foreach unset($cache_settings); // so they will be re-read get_settings('siteurl'); // make it happen now } // end if options if ($any_changed) { $message = $any_changed . ' setting(s) saved... '; } if (($dB_errors != '') || ($validation_message != '')) { if ($message != '') { $message .= '
and '; } $message .= $dB_errors . '
' . $validation_message; } $goback = str_replace('?updated=true', '', $_SERVER['HTTP_REFERER']) . '?updated=true'; header('Location: ' . $goback); break; default: $standalone = 0; include_once("./admin-header.php"); if ($user_level <= 6) { die("You have do not have sufficient permissions to edit the options for this blog."); } ?>
get_results("SELECT group_id, group_name, group_desc, group_longdesc FROM $tableoptiongroups ORDER BY group_id"); foreach ($option_groups as $option_group) { echo("
group_id}\" title=\"{$option_group->group_desc}\">{$option_group->group_name}
\n"); $current_long_desc = $option_group->group_longdesc; if ($current_long_desc == '') { $current_long_desc = 'No help for this group of options.'; } echo("
{$option_group->group_desc}: $current_long_desc
\n"); } // end for each group ?>
Permalinks
Permanent link configuration

get_results("SELECT * FROM $tableoptions LEFT JOIN $tableoptiongroup_options ON $tableoptions.option_id = $tableoptiongroup_options.option_id ORDER BY option_name"); else : $options = $wpdb->get_results(" SELECT $tableoptions.option_id, option_name, option_type, option_value, option_width, option_height, option_description, option_admin_level FROM $tableoptions LEFT JOIN $tableoptiongroup_options ON $tableoptions.option_id = $tableoptiongroup_options.option_id WHERE group_id = $option_group_id ORDER BY seq "); endif; foreach ($options as $option) : if ('all' == $_GET['option_group_id']) $option->option_type = 3; echo "\t\n"; endforeach; ?>
" . get_option_widget($option, ($user_level >= $option->option_admin_level), ''); echo "\t$option->option_description