Changeset 1596
- Timestamp:
- 09/04/2004 10:09:21 PM (20 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/install.php
r1595 r1596 342 342 "; 343 343 $q = $wpdb->query($query); 344 345 $query = "346 CREATE TABLE $wpdb->optiongroups (347 group_id int(11) NOT NULL auto_increment,348 group_name varchar(64) not null,349 group_desc varchar(255),350 group_longdesc tinytext,351 PRIMARY KEY (group_id)352 )353 ";354 $q = $wpdb->query($query);355 356 357 // $query = "DROP TABLE IF EXISTS $wpdb->optiongroup_options";358 // $q = mysql_query($query) or mysql_doh("doh, can't drop the table \"$wpdb->optiongroup_options\" in the database.");359 344 360 345 $query = " … … 419 404 420 405 //'pages' of options 421 "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES(1, 'Other Options', 'Posts per page etc. Original options page')",422 406 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(1,48,1 )", 423 407 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(1,49,2 )", … … 427 411 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(1,53,6 )", 428 412 429 "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES(2, 'General blog settings', 'Things you\'ll probably want to tweak')",430 413 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(2,9 ,1 )", 431 414 //"INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(2,10,2 )", … … 441 424 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(2,20,12)", 442 425 443 "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')",444 426 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(3,21,1 )", 445 427 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(3,22,2 )", … … 453 435 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(3,30,10)", 454 436 455 "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES(4, 'File uploads', 'Settings for file uploads')",456 437 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(4,31,1 )", 457 438 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(4,32,2 )", … … 462 443 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(4,37,7 )", 463 444 464 "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES(5, 'Blog-by-Email settings', 'Settings for blogging via email')",465 445 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(5,38,1 )", 466 446 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(5,39,2 )", … … 474 454 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(5,47,10)", 475 455 476 "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES(6, 'Base settings', 'Basic settings required to get your blog working')",477 456 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(6,1,1)", 478 457 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(6,2,2)", … … 499 478 "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)", 500 479 501 "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES(7, 'Default post options', 'Default settings for new posts.')",502 480 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(7,55,1 )", 503 481 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(7,56,2 )", … … 542 520 543 521 //group them together 544 "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES(8, 'Link Manager Settings', 'Various settings for the link manager.')",545 522 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(8,60,1 )", 546 523 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(8,61,2 )", … … 582 559 "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)", 583 560 584 "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES(9,'Geo Options', 'Settings which control the posting and display of Geo Options')",585 561 586 562 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES(9,84,1)", -
trunk/wp-admin/options-head.php
r1551 r1596 3 3 if ($user_level <= 6) { 4 4 die( __('You have do not have sufficient permissions to edit the options for this blog.') ); 5 }6 7 //we need to iterate through the available option groups.8 $groups = '';9 $option_groups = $wpdb->get_results("SELECT group_id, group_name, group_desc, group_longdesc FROM $wpdb->optiongroups ORDER BY group_id");10 foreach ($option_groups as $option_group) {11 if ($option_group->group_id == $option_group_id) {12 $current_desc = $option_group->group_desc;13 $current_long_desc = $option_group->group_longdesc;14 $groups .= "<li><a class='current' title='{$option_group->group_desc}'>{$option_group->group_name}</a></li>\n";15 } else {16 $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";17 }18 5 } 19 6 ?> -
trunk/wp-admin/options.php
r1587 r1596 126 126 ?> 127 127 128 <?php 129 if ($non_was_selected) { // no group pre-selected, display opening page 130 ?> 131 <div class="wrap"> 132 <dl> 133 <?php 134 //iterate through the available option groups. output them as a definition list. 135 $option_groups = $wpdb->get_results("SELECT group_id, group_name, group_desc, group_longdesc FROM $wpdb->optiongroups ORDER BY group_id"); 136 foreach ($option_groups as $option_group) { 137 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"); 138 $current_long_desc = $option_group->group_longdesc; 139 if ($current_long_desc == '') { 140 $current_long_desc = __('No help for this group of options.'); 141 } 142 echo(" <dd>{$option_group->group_desc}: $current_long_desc</dd>\n"); 143 } // end for each group 144 ?> 145 <dt><a href="options-permalink.php"><?php _e('Permalinks') ?></a></dt> 146 <dd><?php _e('Permanent link configuration') ?></dd> 147 </dl> 148 </div> 149 <?php 150 151 } else { //there was a group selected. 152 include('options-head.php'); 153 ?> 128 <?php include('options-head.php'); ?> 154 129 155 130 <div class="wrap"> -
trunk/wp-admin/upgrade-functions.php
r1595 r1596 71 71 seq int(11) NOT NULL default '0', 72 72 PRIMARY KEY (group_id,option_id) 73 );74 CREATE TABLE $wpdb->optiongroups (75 group_id int(11) NOT NULL auto_increment,76 group_name varchar(64) NOT NULL default '',77 group_desc varchar(255) default NULL,78 group_longdesc tinytext,79 PRIMARY KEY (group_id)80 73 ); 81 74 CREATE TABLE $wpdb->options ( … … 218 211 ) 219 212 "); 220 maybe_create_table($wpdb->optiongroups, "221 CREATE TABLE $wpdb->optiongroups (222 group_id int(11) NOT NULL auto_increment,223 group_name varchar(64) not null,224 group_desc varchar(255),225 group_longdesc tinytext,226 PRIMARY KEY (group_id)227 )228 ");229 213 maybe_create_table($wpdb->optiongroup_options, " 230 214 CREATE TABLE $wpdb->optiongroup_options ( … … 329 313 } 330 314 331 $option_groups = array(332 "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES (1, 'Other Options', 'Posts per page etc. Original options page')",333 "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES (2, 'General blog settings', 'Things you\'ll probably want to tweak')",334 "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')",335 "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES (4, 'File uploads', 'Settings for file uploads')",336 "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES (5, 'Blog-by-Email settings', 'Settings for blogging via email')",337 "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES (6, 'Base settings', 'Basic settings required to get your blog working')",338 "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES (7, 'Default post options', 'Default settings for new posts.')",339 "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES (8, 'Link Manager Settings', 'Various settings for the link manager.')",340 "INSERT INTO $wpdb->optiongroups (group_id, group_name, group_desc) VALUES (9, 'Geo Options', 'Settings which control the posting and display of Geo Options')");341 342 foreach ($option_groups as $query) {343 $option_id = preg_match('|VALUES \(([0-9]+)|', $query, $matches);344 $option_id = $matches[1];345 if(!$wpdb->get_var("SELECT * FROM $wpdb->optiongroups WHERE group_id = '$option_id'")) {346 $wpdb->query($query);347 }348 }349 350 315 $optiongroup_options = array ( "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES (1,48,1 )", 351 316 "INSERT INTO $wpdb->optiongroup_options (group_id, option_id, seq) VALUES (1,49,2 )", … … 515 480 516 481 $oid = $wpdb->get_var("SELECT option_id FROM $wpdb->options WHERE option_name = 'comment_moderation'"); 517 $gid = $wpdb->get_var("SELECT group_id FROM $wpdb->optiongroups WHERE group_name = 'General blog settings'");518 482 $seq = $wpdb->get_var("SELECT MAX(seq) FROM $wpdb->optiongroup_options WHERE group_id = '$gid'"); 519 483 ++$seq; … … 693 657 } 694 658 } 695 696 $wpdb->query("DELETE FROM $wpdb->optiongroups WHERE group_id = 1");697 $wpdb->query("DELETE FROM $wpdb->optiongroups WHERE group_id = 2");698 $wpdb->query("DELETE FROM $wpdb->optiongroups WHERE group_id = 3");699 $wpdb->query("DELETE FROM $wpdb->optiongroups WHERE group_id = 4");700 $wpdb->query("DELETE FROM $wpdb->optiongroups WHERE group_id = 5");701 $wpdb->query("DELETE FROM $wpdb->optiongroups WHERE group_id = 6");702 $wpdb->query("DELETE FROM $wpdb->optiongroups WHERE group_id = 7");703 $wpdb->query("DELETE FROM $wpdb->optiongroups WHERE group_id = 9");704 705 $wpdb->query("UPDATE $wpdb->optiongroups SET group_name = 'Link Manager' WHERE group_id = 8");706 659 707 660 // Add blog_charset option … … 879 832 $wpdb->query('DROP TABLE IF EXISTS ' . $table_prefix . 'optionvalues'); 880 833 $wpdb->query('DROP TABLE IF EXISTS ' . $table_prefix . 'optiontypes'); 834 $wpdb->query('DROP TABLE IF EXISTS ' . $table_prefix . 'optiongroups'); 881 835 } 882 836
Note: See TracChangeset
for help on using the changeset viewer.