Some new options and an option cleanup.

git-svn-id: http://svn.automattic.com/wordpress/trunk@949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-02-27 05:48:00 +00:00
parent 0f75194831
commit 87655b156e
3 changed files with 58 additions and 26 deletions

View File

@ -44,8 +44,8 @@ if ($user_level <= 3) {
}
?>
<ul id="adminmenu2">
<li><a href="options-general.php">General</a></li>
<li><a class="current">Writing</a></li>
<li><a href="options-general.php">General</a></li>
<li><a class="current">Writing</a></li>
<?php
//we need to iterate through the available option groups.
$option_groups = $wpdb->get_results("SELECT group_id, group_name, group_desc, group_longdesc FROM $tableoptiongroups ORDER BY group_id");
@ -65,29 +65,43 @@ if ($user_level <= 3) {
<div class="wrap">
<h2>Writing Options</h2>
<form name="form1" method="post" action="options.php">
<input type="hidden" name="action" value="update" /> <input type="hidden" name="page_options" value="'default_post_edit_rows','blog_charset','use_smilies','use_balanceTags'" />
<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'" />
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
<tr valign="top">
<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="2" style="width: 1.5em; " />
lines </td>
lines </td>
</tr>
<tr valign="top">
<th scope="row">Character Setting: </th>
<td><input name="blog_charset" type="text" id="blog_charset" value="<?php echo get_settings('blog_charset'); ?>" size="20" class="code" />
<br />
The charset you write your blog in (UTF-8 recommended<a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html"></a>)</td>
<br />
The charset you write your blog in (UTF-8 recommended<a href="http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html"></a>)</td>
</tr>
</table>
<p><label for="use_smilies"><input name="use_smilies" type="checkbox" id="use_smilies" value="1" <?php checked('1', get_settings('use_smilies')); ?> />
Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics</label>
<label for="new_users_can_blog"></label></p>
<p>
<label for="use_balanceTags">
<input name="use_balanceTags" type="checkbox" id="use_balanceTags" value="1" <?php checked('1', get_settings('use_balanceTags')); ?> />
WordPress should correct invalidly nested XHTML automatically </label>
<p>
<label for="use_smilies">
<input name="use_smilies" type="checkbox" id="use_smilies" value="1" <?php checked('1', get_settings('use_smilies')); ?> />
Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics.</label>
</p>
<p style="text-align: right;">
<p>
<label for="use_balanceTags">
<input name="use_balanceTags" type="checkbox" id="use_balanceTags" value="1" <?php checked('1', get_settings('use_balanceTags')); ?> />
WordPress should correct invalidly nested XHTML automatically.</label>
</p>
<p>
<label for="advanced_edit">
<input name="advanced_edit" type="checkbox" id="advanced_edit" value="1" <?php checked('1', get_settings('advanced_edit')); ?> />
Compose posts using the advanced interface by default.</label>
</p>
<fieldset>
<legend>Update Services</legend>
<p>Enter the sites that you would like to notify when you publish a new post. For a list of some recommended sites to ping please see [LINK TO SOMETHING]. Seperate multiple URIs by line breaks.</p>
<textarea name="ping_sites" id="ping_sites" style="width: 98%;"><?php echo get_settings('ping_sites'); ?></textarea>
</fieldset>
<p style="text-align: right;">
<input type="submit" name="Submit" value="Update Options" />
</p>
</form>

View File

@ -693,7 +693,12 @@ switch($action) {
$ping_status = get_settings('default_ping_status');
$post_pingback = get_settings('default_pingback_flag');
$default_post_cat = get_settings('default_post_category');
include('edit-form.php');
if (get_settings('advanced_edit')) {
include('edit-form-advanced.php');
} else {
include('edit-form.php');
}
}
?>
<div class="wrap">

View File

@ -651,7 +651,7 @@ function upgrade_100() {
function upgrade_101() {
global $wpdb, $tableoptionvalues, $tablelinkcategories, $tableposts, $tablecategories, $tablecomments, $tablelinks;
// Fix possible duplicate problem from CVS
// Fix possible duplicate problem from CVS, we can REMOVE this later
$option59 = $wpdb->get_results("SELECT * FROM $tableoptionvalues WHERE option_id = '59'");
if (1 < count($option59)) {
$wpdb->query("DELETE FROM $tableoptionvalues WHERE option_id = '59' AND optionvalue LIKE('%FROM order%')");
@ -672,6 +672,7 @@ function upgrade_101() {
add_clean_index($tablelinks , 'link_visible');
}
function upgrade_110() {
global $wpdb, $tableusers, $tablecomments, $tableposts, $tableoptiongroups, $tableoptiongroup_options, $tableoptions, $tablepostmeta;
@ -708,8 +709,8 @@ function upgrade_110() {
$wpdb->query("DELETE FROM $tableoptiongroups WHERE group_id = 6");
// Add blog_charset option
if(!$wpdb->get_var("SELECT * FROM $tableoptions WHERE option_id = '93'")) {
$wpdb->query("INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level) VALUES (93, 'blog_charset', 3, 'utf-8', 'Your blog&#8217;s charset (here&#8217;s a <a href=\"http://developer.apple.com/documentation/macos8/TextIntlSvcs/TextEncodingConversionManager/TEC1.5/TEC.b0.html\">list of possible charsets</a>)', 8)");
if(!$wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = 'blog_charset'")) {
$wpdb->query("INSERT INTO $tableoptions (option_name, option_type, option_value, option_admin_level) VALUES ('blog_charset', 3, 'utf-8', 8)");
}
// Convert all datetime fields' values to GMT, add a gmt_offset option
@ -767,6 +768,18 @@ function upgrade_110() {
)
");
// First we need to enlarge option_value so it can hold larger values:
$wpdb->query("ALTER TABLE `$tableoptions` CHANGE `option_value` `option_value` TEXT NOT NULL");
// Now an option for blog pinging
if(!$wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = 'ping_sites'")) {
$wpdb->query("INSERT INTO $tableoptions (option_name, option_type, option_value, option_admin_level) VALUES ('ping_sites', 3, '', 8)");
}
// Option for using the advanced edit screen by default
if(!$wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = 'advanced_edit'")) {
$wpdb->query("INSERT INTO $tableoptions (option_name, option_type, option_value, option_admin_level) VALUES ('advanced_edit', 3, '0', 8)");
}
}
?>