Make WordPress Core

Changeset 236


Ignore:
Timestamp:
06/18/2003 04:29:10 PM (21 years ago)
Author:
mikelittle
Message:

I'm a bit happier (but not completely) with the upgrade script.
It can still mess up if you run it twice :-(

Location:
trunk/wp-admin
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/upgrade-071-to-072.php

    r235 r236  
    22$_wp_installing = 1;
    33require('../wp-config.php');
     4require('wp-install-helper.php');
     5
    46$thisfile = 'upgrade-071-to-072.php';
    57$step = $HTTP_GET_VARS['step'];
    68if (!$step) $step = 0;
    7 if (!step) $step = 0;
    89?>
    910<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    1011<html xmlns="http://www.w3.org/1999/xhtml">
    11     <title>WordPress > .70 to .71 Upgrade</title>
     12    <title>WordPress > .71 to .72 Upgrade</title>
    1213    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    1314    <style media="screen" type="text/css">
     
    4950<ul>
    5051
    51   <li>One of the biggest changes is that b2config.php has been removed! But we
    52   will use it one last time as part of this upgrade process. Some other files
     52  <li>One of the biggest changes is that b2config.php has been removed! <strong>But</strong> we
     53  will use it <em>one last time</em> as part of this upgrade process. Some other files
    5354  have been eliminated, so it's generally safest to delete all your old files
    5455  (apart from b2config.php) before re-uploading the new ones.</li>
     
    7778  the way.</p>
    7879<?php
    79 
    80 $query = "
     80$error_count = 0;
     81$tablename = $tableoptions;
     82$ddl = "
    8183CREATE TABLE $tableoptions (
    8284  option_id int(11) NOT NULL auto_increment,
     
    9395)
    9496";
    95 $q = $wpdb->query($query);
    96 
    97 $query = "
     97
     98if (maybe_create_table($tablename, $ddl) == true) {
     99    $res .= $tablename . ' - ok <br />';
     100} else {
     101    $res .= 'There was a problem with ' . $tablename . '<br />';
     102    ++$error_count;
     103}
     104
     105$tablename = $tableoptiontypes;
     106$ddl = "
    98107CREATE TABLE $tableoptiontypes (
    99108  optiontype_id int(11) NOT NULL auto_increment,
     
    102111)
    103112";
    104 $q = $wpdb->query($query);
    105 
     113
     114if (maybe_create_table($tablename, $ddl) == true) {
     115    $res .= $tablename . ' - ok <br />';
     116} else {
     117    $res .= 'There was a problem with ' . $tablename . '<br />';
     118    ++$error_count;
     119}
     120
     121$tablename = $tableoptiongroups;
    106122$query = "
    107123CREATE TABLE $tableoptiongroups (
     
    113129)
    114130";
    115 $q = $wpdb->query($query);
    116 
     131
     132if (maybe_create_table($tablename, $ddl) == true) {
     133    $res .= $tablename . ' - ok <br />';
     134} else {
     135    $res .= 'There was a problem with ' . $tablename . '<br />';
     136    ++$error_count;
     137}
     138
     139$tablename = $tableoptiongroup_options;
    117140$query = "
    118141CREATE TABLE $tableoptiongroup_options (
     
    123146)
    124147";
    125 $q = $wpdb->query($query);
    126 
     148
     149if (maybe_create_table($tablename, $ddl) == true) {
     150    $res .= $tablename . ' - ok <br />';
     151} else {
     152    $res .= 'There was a problem with ' . $tablename . '<br />';
     153    ++$error_count;
     154}
     155
     156$tablename = $tableoptionvalues;
    127157$query = "
    128158CREATE TABLE $tableoptionvalues (
     
    137167)
    138168";
    139 $q = $wpdb->query($query);
    140 
    141 
     169
     170if (maybe_create_table($tablename, $ddl) == true) {
     171    $res .= $tablename . ' - ok <br />';
     172} else {
     173    $res .= 'There was a problem with ' . $tablename . '<br />';
     174    ++$error_count;
     175}
     176
     177?>
     178
     179<p><?php echo $res ?></p>
     180
     181<?php
     182if ($error_count > 0) {
     183?>
     184<p>Hmmm... there was some kind of error. If you cannot figure out
     185   see from the output above how to correct the problems please
     186   visit our <a href="http://wordpress.org/support/">support
     187   forums</a> and report your problem.</p>
     188<?php
     189} else {
    142190?>
    143191<p>OK, the tables got created, now to populate them with data.</p>
    144192<?php
     193}
    145194
    146195$option_data = array(
    147 "INSERT INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (1, 'integer')",
    148 "INSERT INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (2, 'boolean')",
    149 "INSERT INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (3, 'string')",
    150 "INSERT INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (4, 'date')",
    151 "INSERT INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (5, 'select')",
    152 "INSERT INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (6, 'range')",
    153 "INSERT INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (7, 'sqlselect')",
     196"REPLACE INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (1, 'integer')",
     197"REPLACE INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (2, 'boolean')",
     198"REPLACE INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (3, 'string')",
     199"REPLACE INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (4, 'date')",
     200"REPLACE INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (5, 'select')",
     201"REPLACE INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (6, 'range')",
     202"REPLACE INTO $tableoptiontypes (optiontype_id, optiontype_name) VALUES (7, 'sqlselect')",
    154203//base options from b2cofig
    155 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(1,'siteurl', 3, 'http://mydomain.com', 'siteurl is your blog\'s URL: for example, \'http://mydomain.com/wordpress\' (no trailing slash !)', 8, 30)",
    156 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(2,'blogfilename', 3, 'index.php', 'blogfilename is the name of the default file for your blog', 8, 20)",
    157 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(3,'blogname', 3, 'my weblog', 'blogname is the name of your blog', 8, 20)",
    158 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(4,'blogdescription', 3, 'babblings!', 'blogdescription is the description of your blog', 8, 40)",
    159 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(6,'search_engine_friendly_urls', 2, '0', 'Querystring Configuration ** (don\'t change if you don\'t know what you\'re doing)', 8, 20)",
    160 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(7,'new_users_can_blog', 2, '0', 'whether you want new users to be able to post entries once they have registered', 8, 20)",
    161 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(8,'users_can_register', 2, '1', 'whether you want to allow users to register on your blog', 8, 20)",
    162 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(54,'admin_email', 3, 'you@example.com', 'Your email (obvious eh?)', 8, 20)",
     204"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(1,'siteurl', 3, 'http://mydomain.com', 'siteurl is your blog\'s URL: for example, \'http://mydomain.com/wordpress\' (no trailing slash !)', 8, 30)",
     205"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(2,'blogfilename', 3, 'index.php', 'blogfilename is the name of the default file for your blog', 8, 20)",
     206"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(3,'blogname', 3, 'my weblog', 'blogname is the name of your blog', 8, 20)",
     207"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(4,'blogdescription', 3, 'babblings!', 'blogdescription is the description of your blog', 8, 40)",
     208"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(6,'search_engine_friendly_urls', 2, '0', 'Querystring Configuration ** (don\'t change if you don\'t know what you\'re doing)', 8, 20)",
     209"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(7,'new_users_can_blog', 2, '0', 'whether you want new users to be able to post entries once they have registered', 8, 20)",
     210"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(8,'users_can_register', 2, '1', 'whether you want to allow users to register on your blog', 8, 20)",
     211"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(54,'admin_email', 3, 'you@example.com', 'Your email (obvious eh?)', 8, 20)",
    163212// general blog setup
    164 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(9 ,'start_of_week', 5, '1', 'day at the start of the week', 8, 20)",
    165 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(10,'use_preview', 2, '1', 'Do you want to use the \'preview\' function', 8, 20)",
    166 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(11,'use_bbcode', 2, '0', 'use BBCode, like [b]bold[/b]', 8, 20)",
    167 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(12,'use_gmcode', 2, '0', 'use GreyMatter-styles: **bold** \\\\italic\\\\ __underline__', 8, 20)",
    168 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(13,'use_quicktags', 2, '1', 'buttons for HTML tags (they won\'t work on IE Mac yet)', 8, 20)",
    169 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(14,'use_htmltrans', 2, '1', 'IMPORTANT! set this to false if you are using Chinese, Japanese, Korean, or other double-bytes languages', 8, 20)",
    170 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(15,'use_balanceTags', 2, '1', 'this could help balance your HTML code. if it gives bad results, set it to false', 8, 20)",
    171 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(16,'use_smilies', 2, '1', 'set this to 1 to enable smiley conversion in posts (note: this makes smiley conversion in ALL posts)', 8, 20)",
    172 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(17,'smilies_directory', 3, 'http://mydomain.com/b2-img/smilies', 'the directory where your smilies are (no trailing slash)', 8, 40)",
    173 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(18,'require_name_email', 2, '0', 'set this to true to require e-mail and name, or false to allow comments without e-mail/name', 8, 20)",
    174 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(19,'comment_allowed_tags', 3, '<b><i><strong><em><code><blockquote><p><br><strike><a>', 'here is a list of the tags that are allowed in the comments. You can add tags to the list, just add them in the string, add only the opening tag: for example, only \'&lt;a>\' instead of \'&lt;a href=\"\">&lt;/a>\'', 8, 40)",
    175 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(20,'comments_notify', 2, '1', 'set this to true to let every author be notified about comments on their posts', 8, 20)",
     213"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(9 ,'start_of_week', 5, '1', 'day at the start of the week', 8, 20)",
     214"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(10,'use_preview', 2, '1', 'Do you want to use the \'preview\' function', 8, 20)",
     215"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(11,'use_bbcode', 2, '0', 'use BBCode, like [b]bold[/b]', 8, 20)",
     216"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(12,'use_gmcode', 2, '0', 'use GreyMatter-styles: **bold** \\\\italic\\\\ __underline__', 8, 20)",
     217"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(13,'use_quicktags', 2, '1', 'buttons for HTML tags (they won\'t work on IE Mac yet)', 8, 20)",
     218"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(14,'use_htmltrans', 2, '1', 'IMPORTANT! set this to false if you are using Chinese, Japanese, Korean, or other double-bytes languages', 8, 20)",
     219"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(15,'use_balanceTags', 2, '1', 'this could help balance your HTML code. if it gives bad results, set it to false', 8, 20)",
     220"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(16,'use_smilies', 2, '1', 'set this to true to enable smiley conversion in posts (note: this makes smiley conversion in ALL posts)', 8, 20)",
     221"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(17,'smilies_directory', 3, 'http://mydomain.com/b2-img/smilies', 'the directory where your smilies are (no trailing slash)', 8, 40)",
     222"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(18,'require_name_email', 2, '0', 'set this to true to require e-mail and name, or false to allow comments without e-mail/name', 8, 20)",
     223"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(19,'comment_allowed_tags', 3, '<b><i><strong><em><code><blockquote><p><br><strike><a>', 'here is a list of the tags that are allowed in the comments. You can add tags to the list, just add them in the string, add only the opening tag: for example, only \'&lt;a>\' instead of \'&lt;a href=\"\">&lt;/a>\'', 8, 40)",
     224"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(20,'comments_notify', 2, '1', 'set this to true to let every author be notified about comments on their posts', 8, 20)",
    176225//rss/rdf feeds
    177 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(21,'posts_per_rss', 1, '10', 'number of last posts to syndicate', 8, 20)",
    178 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(22,'rss_language', 3, 'en', 'the language of your blog ( see this: http://backend.userland.com/stories/storyReader$16 )', 8, 20)",
    179 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(23,'rss_encoded_html', 2, '0', 'for b2rss.php: allow encoded HTML in &lt;description> tag?', 8, 20)",
    180 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(24,'rss_excerpt_length', 1, '50', 'length (in words) of excerpts in the RSS feed? 0=unlimited note: in b2rss.php, this will be set to 0 if you use encoded HTML', 8, 20)",
    181 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(25,'rss_use_excerpt', 2, '1', 'use the excerpt field for rss feed.', 8, 20)",
    182 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(26,'use_weblogsping', 2, '0', 'set this to true if you want your site to be listed on http://weblogs.com when you add a new post', 8, 20)",
    183 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(27,'use_blodotgsping', 2, '0', 'set this to true if you want your site to be listed on http://blo.gs when you add a new post', 8, 20)",
    184 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(28,'blodotgsping_url', 3, 'http://mydomain.com', 'You shouldn\'t need to change this.', 8, 30)",
    185 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(29,'use_trackback', 2, '1', 'set this to 0 or 1, whether you want to allow your posts to be trackback\'able or not note: setting it to zero would also disable sending trackbacks', 8, 20)",
    186 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(30,'use_pingback', 2, '1', 'set this to 0 or 1, whether you want to allow your posts to be pingback\'able or not note: setting it to zero would also disable sending pingbacks', 8, 20)",
     226"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(21,'posts_per_rss', 1, '10', 'number of last posts to syndicate', 8, 20)",
     227"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(22,'rss_language', 3, 'en', 'the language of your blog ( see this: http://backend.userland.com/stories/storyReader$16 )', 8, 20)",
     228"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(23,'rss_encoded_html', 2, '0', 'for b2rss.php: allow encoded HTML in &lt;description> tag?', 8, 20)",
     229"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(24,'rss_excerpt_length', 1, '50', 'length (in words) of excerpts in the RSS feed? 0=unlimited note: in b2rss.php, this will be set to 0 if you use encoded HTML', 8, 20)",
     230"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(25,'rss_use_excerpt', 2, '1', 'use the excerpt field for rss feed.', 8, 20)",
     231"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(26,'use_weblogsping', 2, '0', 'set this to true if you want your site to be listed on http://weblogs.com when you add a new post', 8, 20)",
     232"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(27,'use_blodotgsping', 2, '0', 'set this to true if you want your site to be listed on http://blo.gs when you add a new post', 8, 20)",
     233"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(28,'blodotgsping_url', 3, 'http://mydomain.com', 'You shouldn\'t need to change this.', 8, 30)",
     234"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(29,'use_trackback', 2, '1', 'set this to false or true, whether you want to allow your posts to be trackback\'able or not note: setting it to false would also disable sending trackbacks', 8, 20)",
     235"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(30,'use_pingback', 2, '1', 'set this to false or true, whether you want to allow your posts to be pingback\'able or not note: setting it to false would also disable sending pingbacks', 8, 20)",
    187236//file upload
    188 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(31,'use_fileupload', 2, '0', 'set this to false to disable file upload, or true to enable it', 8, 20)",
    189 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(32,'fileupload_realpath', 3, '/home/your/site/wordpress/images', 'enter the real path of the directory where you\'ll upload the pictures \nif you\'re unsure about what your real path is, please ask your host\'s support staff \nnote that the  directory must be writable by the webserver (chmod 766) \nnote for windows-servers users: use forwardslashes instead of backslashes', 8, 40)",
    190 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(33,'fileupload_url', 3, 'http://mydomain.com/images', 'enter the URL of that directory (it\'s used to generate the links to the uploded files)', 8, 40)",
    191 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(34,'fileupload_allowedtypes', 3, ' jpg gif png ', 'accepted file types, you can add to that list if you want. note: add a space before and after each file type. example: \' jpg gif png \'', 8, 20)",
    192 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(35,'fileupload_maxk', 1, '96', 'by default, most servers limit the size of uploads to 2048 KB, if you want to set it to a lower value, here it is (you cannot set a higher value than your server limit)', 8, 20)",
    193 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(36,'fileupload_minlevel', 1, '1', 'you may not want all users to upload pictures/files, so you can set a minimum level for this', 8, 20)",
    194 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(37,'fileupload_allowedusers', 3, '', '...or you may authorize only some users. enter their logins here, separated by spaces if you leave that variable blank, all users who have the minimum level are authorized to upload note: add a space before and after each login name example: \' barbara anne \'', 8, 30)",
     237"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(31,'use_fileupload', 2, '0', 'set this to false to disable file upload, or true to enable it', 8, 20)",
     238"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(32,'fileupload_realpath', 3, '/home/your/site/wordpress/images', 'enter the real path of the directory where you\'ll upload the pictures \nif you\'re unsure about what your real path is, please ask your host\'s support staff \nnote that the  directory must be writable by the webserver (chmod 766) \nnote for windows-servers users: use forwardslashes instead of backslashes', 8, 40)",
     239"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(33,'fileupload_url', 3, 'http://mydomain.com/images', 'enter the URL of that directory (it\'s used to generate the links to the uploded files)', 8, 40)",
     240"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(34,'fileupload_allowedtypes', 3, ' jpg gif png ', 'accepted file types, you can add to that list if you want. note: add a space before and after each file type. example: \' jpg gif png \'', 8, 20)",
     241"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(35,'fileupload_maxk', 1, '96', 'by default, most servers limit the size of uploads to 2048 KB, if you want to set it to a lower value, here it is (you cannot set a higher value than your server limit)', 8, 20)",
     242"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(36,'fileupload_minlevel', 1, '1', 'you may not want all users to upload pictures/files, so you can set a minimum level for this', 8, 20)",
     243"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(37,'fileupload_allowedusers', 3, '', '...or you may authorize only some users. enter their logins here, separated by spaces if you leave that variable blank, all users who have the minimum level are authorized to upload note: add a space before and after each login name example: \' barbara anne \'', 8, 30)",
    195244// email settings
    196 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(38,'mailserver_url', 3, 'mail.example.com', 'mailserver settings', 8, 20)",
    197 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(39,'mailserver_login', 3, 'login@example.com', 'mailserver settings', 8, 20)",
    198 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(40,'mailserver_pass', 3, 'password', 'mailserver settings', 8, 20)",
    199 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(41,'mailserver_port', 1, '110', 'mailserver settings', 8, 20)",
    200 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(42,'default_category', 1, '1', 'by default posts will have this category', 8, 20)",
    201 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(43,'subjectprefix', 3, 'blog:', 'subject prefix', 8, 20)",
    202 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(44,'bodyterminator', 3, '___', 'body terminator string (starting from this string, everything will be ignored, including this string)', 8, 20)",
    203 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(45,'emailtestonly', 2, '0', 'set this to true to run in test mode', 8, 20)",
    204 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(46,'use_phoneemail', 2, '0', 'some mobile phone email services will send identical subject & content on the same line if you use such a service, set use_phoneemail to true, and indicate a separator string', 8, 20)",
    205 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(47,'phoneemail_separator', 3, ':::', 'when you compose your message, you\'ll type your subject then the separator string then you type your login:password, then the separator, then content', 8, 20)",
     245"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(38,'mailserver_url', 3, 'mail.example.com', 'mailserver settings', 8, 20)",
     246"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(39,'mailserver_login', 3, 'login@example.com', 'mailserver settings', 8, 20)",
     247"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(40,'mailserver_pass', 3, 'password', 'mailserver settings', 8, 20)",
     248"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(41,'mailserver_port', 1, '110', 'mailserver settings', 8, 20)",
     249"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(42,'default_category', 1, '1', 'by default posts will have this category', 8, 20)",
     250"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(43,'subjectprefix', 3, 'blog:', 'subject prefix', 8, 20)",
     251"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(44,'bodyterminator', 3, '___', 'body terminator string (starting from this string, everything will be ignored, including this string)', 8, 20)",
     252"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(45,'emailtestonly', 2, '0', 'set this to true to run in test mode', 8, 20)",
     253"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(46,'use_phoneemail', 2, '0', 'some mobile phone email services will send identical subject & content on the same line if you use such a service, set use_phoneemail to true, and indicate a separator string', 8, 20)",
     254"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(47,'phoneemail_separator', 3, ':::', 'when you compose your message, you\'ll type your subject then the separator string then you type your login:password, then the separator, then content', 8, 20)",
    206255// original options from options page
    207 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(48,'posts_per_page', 1, '20','How many posts/days to show on the index page.', 4, 20)",
    208 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(49,'what_to_show', 5, 'posts','Posts, days, or posts paged', 4, 20)",
    209 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(50,'archive_mode', 5, 'monthly','Which \'unit\' to use for archives.', 4, 20)",
    210 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(51,'time_difference', 6, '0', 'if you\'re not on the timezone of your server', 4, 20)",
    211 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(52,'date_format', 3, 'n/j/Y', 'see note for format characters', 4, 20)",
    212 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(53,'time_format', 3, 'g:i a', 'see note for format characters', 4, 20)",
     256"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(48,'posts_per_page', 1, '20','How many posts/days to show on the index page.', 4, 20)",
     257"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(49,'what_to_show', 5, 'posts','Posts, days, or posts paged', 4, 20)",
     258"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(50,'archive_mode', 5, 'monthly','Which \'unit\' to use for archives.', 4, 20)",
     259"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(51,'time_difference', 6, '0', 'if you\'re not on the timezone of your server', 4, 20)",
     260"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(52,'date_format', 3, 'n/j/Y', 'see note for format characters', 4, 20)",
     261"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(53,'time_format', 3, 'g:i a', 'see note for format characters', 4, 20)",
    213262
    214263//'pages' of options
    215 "INSERT INTO $tableoptiongroups (group_id,  group_name, group_desc) VALUES(1, 'Other Options', 'Posts per page etc. Original options page')",
    216 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(1,48,1 )",
    217 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(1,49,2 )",
    218 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(1,50,3 )",
    219 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(1,51,4 )",
    220 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(1,52,5 )",
    221 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(1,53,6 )",
    222 
    223 "INSERT INTO $tableoptiongroups (group_id,  group_name, group_desc) VALUES(2, 'General blog settings', 'Things you\'ll probably want to tweak')",
    224 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,9 ,1 )",
    225 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,10,2 )",
    226 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,11,3 )",
    227 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,12,4 )",
    228 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,13,5 )",
    229 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,14,6 )",
    230 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,15,7 )",
    231 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,16,8 )",
    232 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,17,9 )",
    233 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,18,10)",
    234 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,19,11)",
    235 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,20,12)",
    236 
    237 "INSERT INTO $tableoptiongroups (group_id,  group_name, group_desc) VALUES(3, 'RSS/RDF Feeds, Track/Ping-backs', 'Settings for RSS/RDF Feeds, Track/ping-backs')",
    238 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,21,1 )",
    239 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,22,2 )",
    240 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,23,3 )",
    241 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,24,4 )",
    242 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,25,5 )",
    243 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,26,6 )",
    244 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,27,7 )",
    245 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,28,8 )",
    246 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,29,9 )",
    247 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,30,10)",
    248 
    249 "INSERT INTO $tableoptiongroups (group_id,  group_name, group_desc) VALUES(4, 'File uploads', 'Settings for file uploads')",
    250 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(4,31,1 )",
    251 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(4,32,2 )",
    252 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(4,33,3 )",
    253 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(4,34,4 )",
    254 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(4,35,5 )",
    255 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(4,36,6 )",
    256 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(4,37,7 )",
    257 
    258 "INSERT INTO $tableoptiongroups (group_id,  group_name, group_desc) VALUES(5, 'Blog-by-Email settings', 'Settings for blogging via email')",
    259 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,38,1 )",
    260 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,39,2 )",
    261 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,40,3 )",
    262 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,41,4 )",
    263 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,42,5 )",
    264 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,43,6 )",
    265 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,44,7 )",
    266 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,45,8 )",
    267 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,46,9 )",
    268 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,47,10)",
    269 
    270 "INSERT INTO $tableoptiongroups (group_id,  group_name, group_desc) VALUES(6, 'Base settings', 'Basic settings required to get your blog working')",
    271 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(6,1,1)",
    272 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(6,2,2)",
    273 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(6,3,3)",
    274 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(6,4,4)",
    275 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(6,6,5)",
    276 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(6,7,6)",
    277 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(6,8,7)",
    278 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(6,54,8)",
     264"REPLACE INTO $tableoptiongroups (group_id,  group_name, group_desc) VALUES(1, 'Other Options', 'Posts per page etc. Original options page')",
     265"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(1,48,1 )",
     266"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(1,49,2 )",
     267"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(1,50,3 )",
     268"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(1,51,4 )",
     269"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(1,52,5 )",
     270"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(1,53,6 )",
     271
     272"REPLACE INTO $tableoptiongroups (group_id,  group_name, group_desc) VALUES(2, 'General blog settings', 'Things you\'ll probably want to tweak')",
     273"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,9 ,1 )",
     274"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,10,2 )",
     275"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,11,3 )",
     276"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,12,4 )",
     277"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,13,5 )",
     278"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,14,6 )",
     279"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,15,7 )",
     280"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,16,8 )",
     281"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,17,9 )",
     282"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,18,10)",
     283"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,19,11)",
     284"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(2,20,12)",
     285
     286"REPLACE INTO $tableoptiongroups (group_id,  group_name, group_desc) VALUES(3, 'RSS/RDF Feeds, Track/Ping-backs', 'Settings for RSS/RDF Feeds, Track/ping-backs')",
     287"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,21,1 )",
     288"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,22,2 )",
     289"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,23,3 )",
     290"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,24,4 )",
     291"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,25,5 )",
     292"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,26,6 )",
     293"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,27,7 )",
     294"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,28,8 )",
     295"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,29,9 )",
     296"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(3,30,10)",
     297
     298"REPLACE INTO $tableoptiongroups (group_id,  group_name, group_desc) VALUES(4, 'File uploads', 'Settings for file uploads')",
     299"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(4,31,1 )",
     300"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(4,32,2 )",
     301"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(4,33,3 )",
     302"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(4,34,4 )",
     303"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(4,35,5 )",
     304"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(4,36,6 )",
     305"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(4,37,7 )",
     306
     307"REPLACE INTO $tableoptiongroups (group_id,  group_name, group_desc) VALUES(5, 'Blog-by-Email settings', 'Settings for blogging via email')",
     308"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,38,1 )",
     309"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,39,2 )",
     310"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,40,3 )",
     311"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,41,4 )",
     312"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,42,5 )",
     313"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,43,6 )",
     314"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,44,7 )",
     315"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,45,8 )",
     316"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,46,9 )",
     317"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(5,47,10)",
     318
     319"REPLACE INTO $tableoptiongroups (group_id,  group_name, group_desc) VALUES(6, 'Base settings', 'Basic settings required to get your blog working')",
     320"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(6,1,1)",
     321"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(6,2,2)",
     322"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(6,3,3)",
     323"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(6,4,4)",
     324"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(6,6,5)",
     325"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(6,7,6)",
     326"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(6,8,7)",
     327"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(6,54,8)",
    279328
    280329// select data for what to show
    281 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (49, 'days',  'days',        null,null,1)",
    282 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (49, 'posts', 'posts',       null,null,2)",
    283 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (49, 'paged', 'posts paged', null,null,3)",
     330"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (49, 'days',  'days',        null,null,1)",
     331"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (49, 'posts', 'posts',       null,null,2)",
     332"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (49, 'paged', 'posts paged', null,null,3)",
    284333// select data for archive mode
    285 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (50, 'daily',     'daily',       null,null,1)",
    286 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (50, 'weekly',    'weekly',      null,null,2)",
    287 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (50, 'monthly',   'monthly',     null,null,3)",
    288 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (50, 'postbypost','post by post',null,null,4)",
     334"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (50, 'daily',     'daily',       null,null,1)",
     335"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (50, 'weekly',    'weekly',      null,null,2)",
     336"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (50, 'monthly',   'monthly',     null,null,3)",
     337"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (50, 'postbypost','post by post',null,null,4)",
    289338// select data for time diff
    290 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (51, null, null, 13, 0, null)",
     339"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (51, null, null, 13, 0, null)",
    291340// select data for start of week
    292 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (9, '0', 'Sunday',   null,null,1)",
    293 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (9, '1', 'Monday',   null,null,2)",
    294 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (9, '6', 'Saturday', null,null,3)",
     341"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (9, '0', 'Sunday',   null,null,1)",
     342"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (9, '1', 'Monday',   null,null,2)",
     343"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (9, '6', 'Saturday', null,null,3)",
    295344
    296345
     
    303352// default_post_category sql_select "SELECT cat_id AS value, cat_name AS label FROM $tablecategories order by cat_name"
    304353
    305 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(55,'default_post_status',    5, 'publish', 'The default state of each new post', 8, 20)",
    306 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(56,'default_comment_status', 5, 'open', 'The default state of comments for each new post', 8, 20)",
    307 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(57,'default_ping_status',    5, 'open', 'The default ping state for each new post', 8, 20)",
    308 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(58,'default_pingback_flag',  5, '1', 'Whether the \'PingBack the URLs in this post\' checkbox should be checked by default', 8, 20)",
    309 "INSERT INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(59,'default_post_category',  7, '1', 'The default category for each new post', 8, 20)",
    310 
    311 "INSERT INTO $tableoptiongroups (group_id,  group_name, group_desc) VALUES(7, 'Default post options', 'Default settings for new posts.')",
    312 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(7,55,1 )",
    313 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(7,56,2 )",
    314 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(7,57,3 )",
    315 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(7,58,4 )",
    316 "INSERT INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(7,59,5 )",
     354"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(55,'default_post_status',    5, 'publish', 'The default state of each new post', 8, 20)",
     355"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(56,'default_comment_status', 5, 'open', 'The default state of comments for each new post', 8, 20)",
     356"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(57,'default_ping_status',    5, 'open', 'The default ping state for each new post', 8, 20)",
     357"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(58,'default_pingback_flag',  5, '1', 'Whether the \'PingBack the URLs in this post\' checkbox should be checked by default', 8, 20)",
     358"REPLACE INTO $tableoptions (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(59,'default_post_category',  7, '1', 'The default category for each new post', 8, 20)",
     359
     360"REPLACE INTO $tableoptiongroups (group_id,  group_name, group_desc) VALUES(7, 'Default post options', 'Default settings for new posts.')",
     361"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(7,55,1 )",
     362"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(7,56,2 )",
     363"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(7,57,3 )",
     364"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(7,58,4 )",
     365"REPLACE INTO $tableoptiongroup_options (group_id, option_id, seq) VALUES(7,59,5 )",
    317366
    318367// select data for post_status
    319 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (55, 'publish', 'Publish', null,null,1)",
    320 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (55, 'draft',   'Draft',   null,null,2)",
    321 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (55, 'private', 'Private', null,null,3)",
     368"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (55, 'publish', 'Publish', null,null,1)",
     369"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (55, 'draft',   'Draft',   null,null,2)",
     370"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (55, 'private', 'Private', null,null,3)",
    322371
    323372// select data for comment_status
    324 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (56, 'open', 'Open',   null,null,1)",
    325 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (56, 'closed', 'Closed', null,null,2)",
     373"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (56, 'open', 'Open',   null,null,1)",
     374"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (56, 'closed', 'Closed', null,null,2)",
    326375
    327376// select data for ping_status (aargh duplication!)
    328 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (57, 'open', 'Open',   null,null,1)",
    329 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (57, 'closed', 'Closed', null,null,2)",
     377"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (57, 'open', 'Open',   null,null,1)",
     378"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (57, 'closed', 'Closed', null,null,2)",
    330379
    331380// select data for pingback flag
    332 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (58, '1', 'Checked',   null,null,1)",
    333 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (58, '0', 'Unchecked', null,null,2)",
     381"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (58, '1', 'Checked',   null,null,1)",
     382"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (58, '0', 'Unchecked', null,null,2)",
    334383
    335384// sql select data for default
    336 "INSERT INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (59, 'SELECT cat_id AS value, cat_name AS label FROM $tablecategories order by cat_name', '', null,null,1)",
     385"REPLACE INTO $tableoptionvalues (option_id, optionvalue, optionvalue_desc, optionvalue_max, optionvalue_min, optionvalue_seq) VALUES (59, 'SELECT cat_id AS value, cat_name AS label FROM $tablecategories order by cat_name', '', null,null,1)",
    337386);
    338387
     
    350399    if (file_exists('../b2config.php')) {
    351400        include('../b2config.php');
    352     }
    353 
    354     // now update the database with those settings
    355     $query = "UPDATE $tableoptions SET option_value='".addslashes($siteurl                 )."' WHERE option_id=1"; $q = $wpdb->query($query);
    356     $query = "UPDATE $tableoptions SET option_value='".addslashes($blogfilename            )."' WHERE option_id=2"; $q = $wpdb->query($query);
    357     $query = "UPDATE $tableoptions SET option_value='".addslashes($blogname                )."' WHERE option_id=3"; $q = $wpdb->query($query);
    358     $query = "UPDATE $tableoptions SET option_value='".addslashes($blogdescription         )."' WHERE option_id=4"; $q = $wpdb->query($query);
    359     $query = "UPDATE $tableoptions SET option_value='".addslashes($admin_email             )."' WHERE option_id=54"; $q = $wpdb->query($query);
    360     $query = "UPDATE $tableoptions SET option_value='".addslashes($new_users_can_blog      )."' WHERE option_id=7"; $q = $wpdb->query($query);
    361     $query = "UPDATE $tableoptions SET option_value='".addslashes($users_can_register      )."' WHERE option_id=8"; $q = $wpdb->query($query);
    362     $query = "UPDATE $tableoptions SET option_value='".addslashes($start_of_week           )."' WHERE option_id=9"; $q = $wpdb->query($query);
    363     $query = "UPDATE $tableoptions SET option_value='".addslashes($use_preview             )."' WHERE option_id=10"; $q = $wpdb->query($query);
    364     $query = "UPDATE $tableoptions SET option_value='".addslashes($use_bbcode              )."' WHERE option_id=11"; $q = $wpdb->query($query);
    365     $query = "UPDATE $tableoptions SET option_value='".addslashes($use_gmcode              )."' WHERE option_id=12"; $q = $wpdb->query($query);
    366     $query = "UPDATE $tableoptions SET option_value='".addslashes($use_quicktags           )."' WHERE option_id=13"; $q = $wpdb->query($query);
    367     $query = "UPDATE $tableoptions SET option_value='".addslashes($use_htmltrans           )."' WHERE option_id=14"; $q = $wpdb->query($query);
    368     $query = "UPDATE $tableoptions SET option_value='".addslashes($use_balanceTags         )."' WHERE option_id=15"; $q = $wpdb->query($query);
    369     $query = "UPDATE $tableoptions SET option_value='".addslashes($use_fileupload          )."' WHERE option_id=31"; $q = $wpdb->query($query);
    370     $query = "UPDATE $tableoptions SET option_value='".addslashes($fileupload_realpath     )."' WHERE option_id=32"; $q = $wpdb->query($query);
    371     $query = "UPDATE $tableoptions SET option_value='".addslashes($fileupload_url          )."' WHERE option_id=33"; $q = $wpdb->query($query);
    372     $query = "UPDATE $tableoptions SET option_value='".addslashes($fileupload_allowedtypes )."' WHERE option_id=34"; $q = $wpdb->query($query);
    373     $query = "UPDATE $tableoptions SET option_value='".addslashes($fileupload_maxk         )."' WHERE option_id=35"; $q = $wpdb->query($query);
    374     $query = "UPDATE $tableoptions SET option_value='".addslashes($fileupload_minlevel     )."' WHERE option_id=36"; $q = $wpdb->query($query);
    375     $query = "UPDATE $tableoptions SET option_value='".addslashes($fileupload_allowedusers )."' WHERE option_id=37"; $q = $wpdb->query($query);
    376     $query = "UPDATE $tableoptions SET option_value='".addslashes($posts_per_rss           )."' WHERE option_id=21"; $q = $wpdb->query($query);
    377     $query = "UPDATE $tableoptions SET option_value='".addslashes($rss_language            )."' WHERE option_id=22"; $q = $wpdb->query($query);
    378     $query = "UPDATE $tableoptions SET option_value='".addslashes($rss_encoded_html        )."' WHERE option_id=23"; $q = $wpdb->query($query);
    379     $query = "UPDATE $tableoptions SET option_value='".addslashes($rss_excerpt_length      )."' WHERE option_id=24"; $q = $wpdb->query($query);
    380     $query = "UPDATE $tableoptions SET option_value='".addslashes($rss_use_excerpt         )."' WHERE option_id=25"; $q = $wpdb->query($query);
    381     $query = "UPDATE $tableoptions SET option_value='".addslashes($use_weblogsping         )."' WHERE option_id=26"; $q = $wpdb->query($query);
    382     $query = "UPDATE $tableoptions SET option_value='".addslashes($use_blodotgsping        )."' WHERE option_id=27"; $q = $wpdb->query($query);
    383     $query = "UPDATE $tableoptions SET option_value='".addslashes($blodotgsping_url        )."' WHERE option_id=28"; $q = $wpdb->query($query);
    384     $query = "UPDATE $tableoptions SET option_value='".addslashes($use_trackback           )."' WHERE option_id=29"; $q = $wpdb->query($query);
    385     $query = "UPDATE $tableoptions SET option_value='".addslashes($use_pingback            )."' WHERE option_id=30"; $q = $wpdb->query($query);
    386     $query = "UPDATE $tableoptions SET option_value='".addslashes($require_name_email      )."' WHERE option_id=18"; $q = $wpdb->query($query);
    387     $query = "UPDATE $tableoptions SET option_value='".addslashes($comment_allowed_tags    )."' WHERE option_id=19"; $q = $wpdb->query($query);
    388     $query = "UPDATE $tableoptions SET option_value='".addslashes($comments_notify         )."' WHERE option_id=20"; $q = $wpdb->query($query);
    389     $query = "UPDATE $tableoptions SET option_value='".addslashes($use_smilies             )."' WHERE option_id=16"; $q = $wpdb->query($query);
    390     $query = "UPDATE $tableoptions SET option_value='".addslashes($smilies_directory       )."' WHERE option_id=17"; $q = $wpdb->query($query);
    391     $query = "UPDATE $tableoptions SET option_value='".addslashes($mailserver_url          )."' WHERE option_id=38"; $q = $wpdb->query($query);
    392     $query = "UPDATE $tableoptions SET option_value='".addslashes($mailserver_login        )."' WHERE option_id=39"; $q = $wpdb->query($query);
    393     $query = "UPDATE $tableoptions SET option_value='".addslashes($mailserver_pass         )."' WHERE option_id=40"; $q = $wpdb->query($query);
    394     $query = "UPDATE $tableoptions SET option_value='".addslashes($mailserver_port         )."' WHERE option_id=41"; $q = $wpdb->query($query);
    395     $query = "UPDATE $tableoptions SET option_value='".addslashes($default_category        )."' WHERE option_id=42"; $q = $wpdb->query($query);
    396     $query = "UPDATE $tableoptions SET option_value='".addslashes($subjectprefix           )."' WHERE option_id=43"; $q = $wpdb->query($query);
    397     $query = "UPDATE $tableoptions SET option_value='".addslashes($bodyterminator          )."' WHERE option_id=44"; $q = $wpdb->query($query);
    398     $query = "UPDATE $tableoptions SET option_value='".addslashes($emailtestonly           )."' WHERE option_id=45"; $q = $wpdb->query($query);
    399     $query = "UPDATE $tableoptions SET option_value='".addslashes($use_phoneemail          )."' WHERE option_id=46"; $q = $wpdb->query($query);
    400     $query = "UPDATE $tableoptions SET option_value='".addslashes($phoneemail_separator    )."' WHERE option_id=47"; $q = $wpdb->query($query);
    401 
    402     // now pickup the old settings table data
    403     $v = $wpdb->get_var("SELECT posts_per_page from $tablesettings");
    404     if ($v != null) {
    405         $query = "UPDATE $tableoptions SET option_value='".addslashes($v)."' WHERE option_id=48";
     401   
     402        // now update the database with those settings
     403        $query = "UPDATE $tableoptions SET option_value='".addslashes($siteurl                 )."' WHERE option_id=1"; $q = $wpdb->query($query);
     404        $query = "UPDATE $tableoptions SET option_value='".addslashes($blogfilename            )."' WHERE option_id=2"; $q = $wpdb->query($query);
     405        $query = "UPDATE $tableoptions SET option_value='".addslashes($blogname                )."' WHERE option_id=3"; $q = $wpdb->query($query);
     406        $query = "UPDATE $tableoptions SET option_value='".addslashes($blogdescription         )."' WHERE option_id=4"; $q = $wpdb->query($query);
     407        $query = "UPDATE $tableoptions SET option_value='".addslashes($admin_email             )."' WHERE option_id=54"; $q = $wpdb->query($query);
     408        $query = "UPDATE $tableoptions SET option_value='".addslashes($new_users_can_blog      )."' WHERE option_id=7"; $q = $wpdb->query($query);
     409        $query = "UPDATE $tableoptions SET option_value='".addslashes($users_can_register      )."' WHERE option_id=8"; $q = $wpdb->query($query);
     410        $query = "UPDATE $tableoptions SET option_value='".addslashes($start_of_week           )."' WHERE option_id=9"; $q = $wpdb->query($query);
     411        $query = "UPDATE $tableoptions SET option_value='".addslashes($use_preview             )."' WHERE option_id=10"; $q = $wpdb->query($query);
     412        $query = "UPDATE $tableoptions SET option_value='".addslashes($use_bbcode              )."' WHERE option_id=11"; $q = $wpdb->query($query);
     413        $query = "UPDATE $tableoptions SET option_value='".addslashes($use_gmcode              )."' WHERE option_id=12"; $q = $wpdb->query($query);
     414        $query = "UPDATE $tableoptions SET option_value='".addslashes($use_quicktags           )."' WHERE option_id=13"; $q = $wpdb->query($query);
     415        $query = "UPDATE $tableoptions SET option_value='".addslashes($use_htmltrans           )."' WHERE option_id=14"; $q = $wpdb->query($query);
     416        $query = "UPDATE $tableoptions SET option_value='".addslashes($use_balanceTags         )."' WHERE option_id=15"; $q = $wpdb->query($query);
     417        $query = "UPDATE $tableoptions SET option_value='".addslashes($use_fileupload          )."' WHERE option_id=31"; $q = $wpdb->query($query);
     418        $query = "UPDATE $tableoptions SET option_value='".addslashes($fileupload_realpath     )."' WHERE option_id=32"; $q = $wpdb->query($query);
     419        $query = "UPDATE $tableoptions SET option_value='".addslashes($fileupload_url          )."' WHERE option_id=33"; $q = $wpdb->query($query);
     420        $query = "UPDATE $tableoptions SET option_value='".addslashes($fileupload_allowedtypes )."' WHERE option_id=34"; $q = $wpdb->query($query);
     421        $query = "UPDATE $tableoptions SET option_value='".addslashes($fileupload_maxk         )."' WHERE option_id=35"; $q = $wpdb->query($query);
     422        $query = "UPDATE $tableoptions SET option_value='".addslashes($fileupload_minlevel     )."' WHERE option_id=36"; $q = $wpdb->query($query);
     423        $query = "UPDATE $tableoptions SET option_value='".addslashes($fileupload_allowedusers )."' WHERE option_id=37"; $q = $wpdb->query($query);
     424        $query = "UPDATE $tableoptions SET option_value='".addslashes($posts_per_rss           )."' WHERE option_id=21"; $q = $wpdb->query($query);
     425        $query = "UPDATE $tableoptions SET option_value='".addslashes($rss_language            )."' WHERE option_id=22"; $q = $wpdb->query($query);
     426        $query = "UPDATE $tableoptions SET option_value='".addslashes($rss_encoded_html        )."' WHERE option_id=23"; $q = $wpdb->query($query);
     427        $query = "UPDATE $tableoptions SET option_value='".addslashes($rss_excerpt_length      )."' WHERE option_id=24"; $q = $wpdb->query($query);
     428        $query = "UPDATE $tableoptions SET option_value='".addslashes($rss_use_excerpt         )."' WHERE option_id=25"; $q = $wpdb->query($query);
     429        $query = "UPDATE $tableoptions SET option_value='".addslashes($use_weblogsping         )."' WHERE option_id=26"; $q = $wpdb->query($query);
     430        $query = "UPDATE $tableoptions SET option_value='".addslashes($use_blodotgsping        )."' WHERE option_id=27"; $q = $wpdb->query($query);
     431        $query = "UPDATE $tableoptions SET option_value='".addslashes($blodotgsping_url        )."' WHERE option_id=28"; $q = $wpdb->query($query);
     432        $query = "UPDATE $tableoptions SET option_value='".addslashes($use_trackback           )."' WHERE option_id=29"; $q = $wpdb->query($query);
     433        $query = "UPDATE $tableoptions SET option_value='".addslashes($use_pingback            )."' WHERE option_id=30"; $q = $wpdb->query($query);
     434        $query = "UPDATE $tableoptions SET option_value='".addslashes($require_name_email      )."' WHERE option_id=18"; $q = $wpdb->query($query);
     435        $query = "UPDATE $tableoptions SET option_value='".addslashes($comment_allowed_tags    )."' WHERE option_id=19"; $q = $wpdb->query($query);
     436        $query = "UPDATE $tableoptions SET option_value='".addslashes($comments_notify         )."' WHERE option_id=20"; $q = $wpdb->query($query);
     437        $query = "UPDATE $tableoptions SET option_value='".addslashes($use_smilies             )."' WHERE option_id=16"; $q = $wpdb->query($query);
     438        $query = "UPDATE $tableoptions SET option_value='".addslashes($smilies_directory       )."' WHERE option_id=17"; $q = $wpdb->query($query);
     439        $query = "UPDATE $tableoptions SET option_value='".addslashes($mailserver_url          )."' WHERE option_id=38"; $q = $wpdb->query($query);
     440        $query = "UPDATE $tableoptions SET option_value='".addslashes($mailserver_login        )."' WHERE option_id=39"; $q = $wpdb->query($query);
     441        $query = "UPDATE $tableoptions SET option_value='".addslashes($mailserver_pass         )."' WHERE option_id=40"; $q = $wpdb->query($query);
     442        $query = "UPDATE $tableoptions SET option_value='".addslashes($mailserver_port         )."' WHERE option_id=41"; $q = $wpdb->query($query);
     443        $query = "UPDATE $tableoptions SET option_value='".addslashes($default_category        )."' WHERE option_id=42"; $q = $wpdb->query($query);
     444        $query = "UPDATE $tableoptions SET option_value='".addslashes($subjectprefix           )."' WHERE option_id=43"; $q = $wpdb->query($query);
     445        $query = "UPDATE $tableoptions SET option_value='".addslashes($bodyterminator          )."' WHERE option_id=44"; $q = $wpdb->query($query);
     446        $query = "UPDATE $tableoptions SET option_value='".addslashes($emailtestonly           )."' WHERE option_id=45"; $q = $wpdb->query($query);
     447        $query = "UPDATE $tableoptions SET option_value='".addslashes($use_phoneemail          )."' WHERE option_id=46"; $q = $wpdb->query($query);
     448        $query = "UPDATE $tableoptions SET option_value='".addslashes($phoneemail_separator    )."' WHERE option_id=47"; $q = $wpdb->query($query);
     449
     450        // now pickup the old settings table data
     451        $v = $wpdb->get_var("SELECT posts_per_page from $tablesettings");
     452        if ($v != null) {
     453            $query = "UPDATE $tableoptions SET option_value='".addslashes($v)."' WHERE option_id=48";
     454            $q = $wpdb->query($query);
     455        }
     456
     457        $v = $wpdb->get_var("SELECT what_to_show from $tablesettings");
     458        if ($v != null) {
     459            $query = "UPDATE $tableoptions SET option_value='".addslashes($v)."' WHERE option_id=49";
     460            $q = $wpdb->query($query);
     461        }
     462
     463        $v = $wpdb->get_var("SELECT archive_mode from $tablesettings");
     464        if ($v != null) {
     465            $query = "UPDATE $tableoptions SET option_value='".addslashes($v)."' WHERE option_id=50";
     466            $q = $wpdb->query($query);
     467        }
     468
     469        $v = $wpdb->get_var("SELECT time_difference from $tablesettings");
     470        if ($v != null) {
     471            $query = "UPDATE $tableoptions SET option_value='".addslashes($v)."' WHERE option_id=51";
     472            $q = $wpdb->query($query);
     473        }
     474
     475        $v = $wpdb->get_var("SELECT date_format from $tablesettings");
     476        if ($v != null) {
     477            $query = "UPDATE $tableoptions SET option_value='".addslashes($v)."' WHERE option_id=52";
     478            $q = $wpdb->query($query);
     479        }
     480
     481        $v = $wpdb->get_var("SELECT time_format from $tablesettings");
     482        if ($v != null) {
     483            $query = "UPDATE $tableoptions SET option_value='".addslashes($v)."' WHERE option_id=53";
     484            $q = $wpdb->query($query);
     485        }
     486
     487        // ok it can go now
     488        $query = "DROP TABLE $tablesettings";
    406489        $q = $wpdb->query($query);
    407     }
    408    
    409     $v = $wpdb->get_var("SELECT what_to_show from $tablesettings");
    410     if ($v != null) {
    411         $query = "UPDATE $tableoptions SET option_value='".addslashes($v)."' WHERE option_id=49";
    412         $q = $wpdb->query($query);
    413     }
    414    
    415     $v = $wpdb->get_var("SELECT archive_mode from $tablesettings");
    416     if ($v != null) {
    417         $query = "UPDATE $tableoptions SET option_value='".addslashes($v)."' WHERE option_id=50";
    418         $q = $wpdb->query($query);
    419     }
    420    
    421     $v = $wpdb->get_var("SELECT time_difference from $tablesettings");
    422     if ($v != null) {
    423         $query = "UPDATE $tableoptions SET option_value='".addslashes($v)."' WHERE option_id=51";
    424         $q = $wpdb->query($query);
    425     }
    426    
    427     $v = $wpdb->get_var("SELECT date_format from $tablesettings");
    428     if ($v != null) {
    429         $query = "UPDATE $tableoptions SET option_value='".addslashes($v)."' WHERE option_id=52";
    430         $q = $wpdb->query($query);
    431     }
    432    
    433     $v = $wpdb->get_var("SELECT time_format from $tablesettings");
    434     if ($v != null) {
    435         $query = "UPDATE $tableoptions SET option_value='".addslashes($v)."' WHERE option_id=53";
    436         $q = $wpdb->query($query);
    437     }
    438    
    439     // ok it can go now
    440     $query = "DROP TABLE $tablesettings";
    441     $q = $wpdb->query($query);
    442 ?>
    443 <p>OK. All settings transferred.</p>
    444 <p>Congratulations! You have updated to the latest version of WordPress</p>
    445 <p>You can now delete your b2config.php file, and go play with your <a href="<?php echo $siteurl; ?>">updated blog</a> </p>
    446 <?php
     490?>
     491    <p>OK. All settings transferred.</p>
     492    <p>Congratulations! You have updated to the latest version of WordPress</p>
     493    <p>You can now delete your b2config.php file, and go play with your
     494        <a href="<?php echo $siteurl; ?>">updated blog</a> </p>
     495<?php
     496    // end if b2config exists
     497    } else {
     498?>
     499<p>Hmm... I couldn't find b2config.php so I couldn't transfer all your settings.
     500    You need to check them on the <a href="wp-options.php?option_group_id=6">admin options page</a>.</p>
     501<p>You can now go play with your <a href="<?php echo $siteurl ? $siteurl : '../index.php'; ?>">updated blog</a> </p>
     502<?php
     503    } // end else no b2config
    447504    break;
    448505}
Note: See TracChangeset for help on using the changeset viewer.