Changeset 1595
- Timestamp:
- 09/04/2004 10:04:19 PM (21 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/install.php
r1594 r1595 343 343 $q = $wpdb->query($query); 344 344 345 // $query = "DROP TABLE IF EXISTS $tableoptiontypes";346 // $q = mysql_query($query) or mysql_doh("doh, can't drop the table \"$tableoptiontypes\" in the database.");347 348 $query = "349 CREATE TABLE $wpdb->optiontypes (350 optiontype_id int(11) NOT NULL auto_increment,351 optiontype_name varchar(64) NOT NULL,352 PRIMARY KEY (optiontype_id)353 )354 ";355 $q = $wpdb->query($query);356 357 358 // $query = "DROP TABLE IF EXISTS $tableoptiongroups";359 // $q = mysql_query($query) or mysql_doh("doh, can't drop the table \"$tableoptiongroups\" in the database.");360 361 345 $query = " 362 346 CREATE TABLE $wpdb->optiongroups ( … … 385 369 386 370 $option_data = array( 387 "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES (1, 'integer')",388 "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES (2, 'boolean')",389 "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES (3, 'string')",390 "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES (4, 'date')",391 "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES (5, 'select')",392 "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES (6, 'range')",393 "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES (7, 'sqlselect')",394 "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES (8, 'float')",395 396 371 //base options from b2cofig 397 372 "INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(1,'siteurl', 3, '$guessurl', 'siteurl is your blog\'s URL: for example, \'http://example.com/wordpress\' (no trailing slash !)', 8, 30)", -
trunk/wp-admin/upgrade-functions.php
r1594 r1595 93 93 PRIMARY KEY (option_id,blog_id,option_name) 94 94 ); 95 CREATE TABLE $wpdb->optiontypes (96 optiontype_id int(11) NOT NULL auto_increment,97 optiontype_name varchar(64) NOT NULL default '',98 PRIMARY KEY (optiontype_id)99 );100 95 CREATE TABLE $wpdb->post2cat ( 101 96 rel_id int(11) NOT NULL auto_increment, … … 223 218 ) 224 219 "); 225 maybe_create_table($wpdb->optiontypes, "226 CREATE TABLE $wpdb->optiontypes (227 optiontype_id int(11) NOT NULL auto_increment,228 optiontype_name varchar(64) NOT NULL,229 PRIMARY KEY (optiontype_id)230 )231 ");232 220 maybe_create_table($wpdb->optiongroups, " 233 221 CREATE TABLE $wpdb->optiongroups ( … … 247 235 ) 248 236 "); 249 250 // TODO: REWRITE THIS251 $option_types = array(252 "1" => "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES ('1', 'integer')",253 "2" => "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES ('2', 'boolean')",254 "3" => "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES ('3', 'string')",255 "4" => "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES ('4', 'date')",256 "5" => "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES ('5', 'select')",257 "6" => "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES ('6', 'range')",258 "7" => "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES ('7', 'sqlselect')");259 260 foreach ($option_types as $option_id => $query) {261 if(!$wpdb->get_var("SELECT * FROM $wpdb->optiontypes WHERE optiontype_id = '$option_id'")) {262 $wpdb->query($query);263 }264 }265 237 266 238 // Guess a site URI … … 904 876 } 905 877 878 // Obsolete tables 906 879 $wpdb->query('DROP TABLE IF EXISTS ' . $table_prefix . 'optionvalues'); 880 $wpdb->query('DROP TABLE IF EXISTS ' . $table_prefix . 'optiontypes'); 907 881 } 908 882 -
trunk/wp-settings.php
r1594 r1595 26 26 $wpdb->linkcategories = $table_prefix . 'linkcategories'; 27 27 $wpdb->options = $table_prefix . 'options'; 28 $wpdb->optiontypes = $table_prefix . 'optiontypes';29 28 $wpdb->optiongroups = $table_prefix . 'optiongroups'; 30 29 $wpdb->optiongroup_options = $table_prefix . 'optiongroup_options'; … … 41 40 $tablelinkcategories = $wpdb->linkcategories; 42 41 $tableoptions = $wpdb->options; 43 $tableoptiontypes = $wpdb->optiontypes;44 42 $tableoptiongroups = $wpdb->optiongroups; 45 43 $tableoptiongroup_options = $wpdb->optiongroup_options;
Note: See TracChangeset
for help on using the changeset viewer.