Changeset 4738
- Timestamp:
- 01/16/2007 01:54:50 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upgrade-functions.php
r4612 r4738 509 509 wp_schedule_single_event(mysql2date('U', $post->post_date), 'publish_future_post', array($post->ID)); 510 510 } 511 511 512 if ( $wp_current_db_version < 3570 ) { 512 513 // Create categories for link categories if a category with the same 513 514 // name doesn't exist. Create a map of link cat IDs to cat IDs. 514 $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories"); 515 $link_cat_id_map = array(); 516 $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM " . $wpdb->prefix . 'linkcategories'); 515 517 foreach ( $link_cats as $link_cat) { 516 518 if ( $cat_id = category_exists($link_cat->cat_name) ) { … … 526 528 $links = $wpdb->get_results("SELECT link_id, link_category FROM $wpdb->links"); 527 529 if ( !empty($links) ) foreach ( $links as $link ) { 530 if ( 0 == $link->link_category ) 531 continue; 532 if ( ! isset($link_cat_id_map[$link->link_category]) ) 533 continue; 528 534 $link_cat = $link_cat_id_map[$link->link_category]; 529 535 $cat = $wpdb->get_row("SELECT * FROM $wpdb->link2cat WHERE link_id = '$link->link_id' AND category_id = '$link_cat'"); 530 if ( !$cat && 0 != $link->link_category) {536 if ( !$cat ) { 531 537 $wpdb->query("INSERT INTO $wpdb->link2cat (link_id, category_id) 532 538 VALUES ('$link->link_id', '$link_cat')"); … … 545 551 } 546 552 } 553 554 // Obsolete linkcategories table 555 $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'linkcategories'); 547 556 } 548 557 } -
trunk/wp-includes/wp-db.php
r4686 r4738 29 29 var $comments; 30 30 var $links; 31 var $linkcategories;32 31 var $options; 33 32 var $optiontypes; -
trunk/wp-settings.php
r4717 r4738 114 114 $wpdb->link2cat = $wpdb->prefix . 'link2cat'; 115 115 $wpdb->links = $wpdb->prefix . 'links'; 116 $wpdb->linkcategories = $wpdb->prefix . 'linkcategories';117 116 $wpdb->options = $wpdb->prefix . 'options'; 118 117 $wpdb->postmeta = $wpdb->prefix . 'postmeta';
Note: See TracChangeset
for help on using the changeset viewer.