[wp-cvs]
wordpress/wp-admin install.php, 1.40, 1.41 options-head.php,
1.11, 1.12 options.php, 1.28, 1.29 upgrade-functions.php, 1.70, 1.71
Matthew Mullenweg
saxmatt at users.sourceforge.net
Sat Sep 4 22:09:24 UTC 2004
Update of /cvsroot/cafelog/wordpress/wp-admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32180/wp-admin
Modified Files:
install.php options-head.php options.php upgrade-functions.php
Log Message:
Remove optiongroups table.
Index: options-head.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/options-head.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** options-head.php 22 Aug 2004 23:24:50 -0000 1.11
--- options-head.php 4 Sep 2004 22:09:21 -0000 1.12
***************
*** 4,20 ****
die( __('You have do not have sufficient permissions to edit the options for this blog.') );
}
-
- //we need to iterate through the available option groups.
- $groups = '';
- $option_groups = $wpdb->get_results("SELECT group_id, group_name, group_desc, group_longdesc FROM $wpdb->optiongroups ORDER BY group_id");
- foreach ($option_groups as $option_group) {
- if ($option_group->group_id == $option_group_id) {
- $current_desc = $option_group->group_desc;
- $current_long_desc = $option_group->group_longdesc;
- $groups .= "<li><a class='current' title='{$option_group->group_desc}'>{$option_group->group_name}</a></li>\n";
- } else {
- $groups .= "<li><a href='options.php?option_group_id={$option_group->group_id}' title='{$option_group->group_desc}'>{$option_group->group_name}</a></li>\n";
- }
- }
?>
--- 4,7 ----
Index: options.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/options.php,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** options.php 3 Sep 2004 21:50:06 -0000 1.28
--- options.php 4 Sep 2004 22:09:21 -0000 1.29
***************
*** 126,155 ****
?>
! <?php
! if ($non_was_selected) { // no group pre-selected, display opening page
! ?>
! <div class="wrap">
! <dl>
! <?php
! //iterate through the available option groups. output them as a definition list.
! $option_groups = $wpdb->get_results("SELECT group_id, group_name, group_desc, group_longdesc FROM $wpdb->optiongroups ORDER BY group_id");
! foreach ($option_groups as $option_group) {
! echo(" <dt><a href=\"$this_file?option_group_id={$option_group->group_id}\" title=\"{$option_group->group_desc}\">{$option_group->group_name}</a></dt>\n");
! $current_long_desc = $option_group->group_longdesc;
! if ($current_long_desc == '') {
! $current_long_desc = __('No help for this group of options.');
! }
! echo(" <dd>{$option_group->group_desc}: $current_long_desc</dd>\n");
! } // end for each group
! ?>
! <dt><a href="options-permalink.php"><?php _e('Permalinks') ?></a></dt>
! <dd><?php _e('Permanent link configuration') ?></dd>
! </dl>
! </div>
! <?php
!
! } else { //there was a group selected.
! include('options-head.php');
! ?>
<div class="wrap">
--- 126,130 ----
?>
! <?php include('options-head.php'); ?>
<div class="wrap">
Index: install.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/install.php,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** install.php 4 Sep 2004 22:04:18 -0000 1.40
--- install.php 4 Sep 2004 22:09:21 -0000 1.41
***************
*** 344,362 ****
$query = "
- CREATE TABLE $wpdb->optiongroups (
- group_id int(11) NOT NULL auto_increment,
- group_name varchar(64) not null,
- group_desc varchar(255),
- group_longdesc tinytext,
- PRIMARY KEY (group_id)
- )
- ";
- $q = $wpdb->query($query);
-
-
- // $query = "DROP TABLE IF EXISTS $wpdb->optiongroup_options";
- // $q = mysql_query($query) or mysql_doh("doh, can't drop the table \"$wpdb->optiongroup_options\" in the database.");
-
- $query = "
CREATE TABLE $wpdb->optiongroup_options (
group_id int(11) NOT NULL,
--- 344,347 ----
***************
*** 419,423 ****
//'pages' of options
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES(1, 'Other Options', 'Posts per page etc. Original options page')",
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(1,48,1 )",
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(1,49,2 )",
--- 404,407 ----
***************
*** 427,431 ****
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(1,53,6 )",
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES(2, 'General blog settings', 'Things you\'ll probably want to tweak')",
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(2,9 ,1 )",
//"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(2,10,2 )",
--- 411,414 ----
***************
*** 441,445 ****
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(2,20,12)",
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES(3, 'RSS/RDF Feeds, Track/Ping-backs', 'Settings for RSS/RDF Feeds, Track/ping-backs')",
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(3,21,1 )",
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(3,22,2 )",
--- 424,427 ----
***************
*** 453,457 ****
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(3,30,10)",
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES(4, 'File uploads', 'Settings for file uploads')",
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(4,31,1 )",
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(4,32,2 )",
--- 435,438 ----
***************
*** 462,466 ****
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(4,37,7 )",
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES(5, 'Blog-by-Email settings', 'Settings for blogging via email')",
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(5,38,1 )",
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(5,39,2 )",
--- 443,446 ----
***************
*** 474,478 ****
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(5,47,10)",
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES(6, 'Base settings', 'Basic settings required to get your blog working')",
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(6,1,1)",
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(6,2,2)",
--- 454,457 ----
***************
*** 499,503 ****
"INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(83,'default_post_edit_rows', 1, '9', 'The number of rows in the edit post form (min 3, max 100)', 8, 5)",
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES(7, 'Default post options', 'Default settings for new posts.')",
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(7,55,1 )",
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(7,56,2 )",
--- 478,481 ----
***************
*** 542,546 ****
//group them together
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES(8, 'Link Manager Settings', 'Various settings for the link manager.')",
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(8,60,1 )",
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(8,61,2 )",
--- 520,523 ----
***************
*** 582,586 ****
"INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(87,'default_geourl_lon', 8, 0.0, 'The default Longitude ICBM value', 8, 20)",
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES(9,'Geo Options', 'Settings which control the posting and display of Geo Options')",
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(9,84,1)",
--- 559,562 ----
Index: upgrade-functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/upgrade-functions.php,v
retrieving revision 1.70
retrieving revision 1.71
diff -C2 -d -r1.70 -r1.71
*** upgrade-functions.php 4 Sep 2004 22:04:19 -0000 1.70
--- upgrade-functions.php 4 Sep 2004 22:09:21 -0000 1.71
***************
*** 72,82 ****
PRIMARY KEY (group_id,option_id)
);
- CREATE TABLE $wpdb->optiongroups (
- group_id int(11) NOT NULL auto_increment,
- group_name varchar(64) NOT NULL default '',
- group_desc varchar(255) default NULL,
- group_longdesc tinytext,
- PRIMARY KEY (group_id)
- );
CREATE TABLE $wpdb->options (
option_id int(11) NOT NULL auto_increment,
--- 72,75 ----
***************
*** 218,230 ****
)
");
- maybe_create_table($wpdb->optiongroups, "
- CREATE TABLE $wpdb->optiongroups (
- group_id int(11) NOT NULL auto_increment,
- group_name varchar(64) not null,
- group_desc varchar(255),
- group_longdesc tinytext,
- PRIMARY KEY (group_id)
- )
- ");
maybe_create_table($wpdb->optiongroup_options, "
CREATE TABLE $wpdb->optiongroup_options (
--- 211,214 ----
***************
*** 329,351 ****
}
- $option_groups = array(
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES (1, 'Other Options', 'Posts per page etc. Original options page')",
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES (2, 'General blog settings', 'Things you\'ll probably want to tweak')",
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES (3, 'RSS/RDF Feeds, Track/Ping-backs', 'Settings for RSS/RDF Feeds, Track/ping-backs')",
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES (4, 'File uploads', 'Settings for file uploads')",
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES (5, 'Blog-by-Email settings', 'Settings for blogging via email')",
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES (6, 'Base settings', 'Basic settings required to get your blog working')",
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES (7, 'Default post options', 'Default settings for new posts.')",
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES (8, 'Link Manager Settings', 'Various settings for the link manager.')",
- "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES (9, 'Geo Options', 'Settings which control the posting and display of Geo Options')");
-
- foreach ($option_groups as $query) {
- $option_id = preg_match('|VALUES \(([0-9]+)|', $query, $matches);
- $option_id = $matches[1];
- if(!$wpdb->get_var("SELECT * FROM $wpdb->optiongroups WHERE group_id = '$option_id'")) {
- $wpdb->query($query);
- }
- }
-
$optiongroup_options = array ( "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES (1,48,1 )",
"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES (1,49,2 )",
--- 313,316 ----
***************
*** 515,519 ****
$oid = $wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'comment_moderation'");
- $gid = $wpdb->get_var("SELECT group_id FROM $wpdb->optiongroups WHERE group_name = 'General blog settings'");
$seq = $wpdb->get_var("SELECT MAX(seq) FROM $wpdb->optiongroup_options WHERE group_id = '$gid'");
++$seq;
--- 480,483 ----
***************
*** 693,707 ****
}
}
-
- $wpdb->query("DELETE FROM $wpdb->optiongroups WHERE group_id = 1");
- $wpdb->query("DELETE FROM $wpdb->optiongroups WHERE group_id = 2");
- $wpdb->query("DELETE FROM $wpdb->optiongroups WHERE group_id = 3");
- $wpdb->query("DELETE FROM $wpdb->optiongroups WHERE group_id = 4");
- $wpdb->query("DELETE FROM $wpdb->optiongroups WHERE group_id = 5");
- $wpdb->query("DELETE FROM $wpdb->optiongroups WHERE group_id = 6");
- $wpdb->query("DELETE FROM $wpdb->optiongroups WHERE group_id = 7");
- $wpdb->query("DELETE FROM $wpdb->optiongroups WHERE group_id = 9");
-
- $wpdb->query("UPDATE $wpdb->optiongroups SET group_name = 'Link Manager' WHERE group_id = 8");
// Add blog_charset option
--- 657,660 ----
***************
*** 879,882 ****
--- 832,836 ----
$wpdb->query('DROP TABLE IF EXISTS ' . $table_prefix . 'optionvalues');
$wpdb->query('DROP TABLE IF EXISTS ' . $table_prefix . 'optiontypes');
+ $wpdb->query('DROP TABLE IF EXISTS ' . $table_prefix . 'optiongroups');
}
More information about the cvs
mailing list