Changeset 3678
- Timestamp:
- 04/02/2006 12:33:10 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upgrade-functions.php
r3670 r3678 167 167 upgrade_160(); 168 168 169 if ( $wp_current_db_version < 3 582 )169 if ( $wp_current_db_version < 3672 ) 170 170 upgrade_210(); 171 171 -
trunk/wp-admin/upgrade-schema.php
r3598 r3678 114 114 guid varchar(255) NOT NULL default '', 115 115 menu_order int(11) NOT NULL default '0', 116 post_type varchar( 100) NOT NULL default 'post',116 post_type varchar(20) NOT NULL default 'post', 117 117 post_mime_type varchar(100) NOT NULL default '', 118 118 comment_count bigint(20) NOT NULL default '0', 119 119 PRIMARY KEY (ID), 120 KEY post_name (post_name) 120 KEY post_name (post_name), 121 KEY type_status_date (post_type, post_status, post_date) 121 122 ); 122 123 CREATE TABLE $wpdb->users ( -
trunk/wp-includes/query.php
r3649 r3678 506 506 $where = ''; 507 507 $limits = ''; 508 $distinct = '';509 508 $join = ''; 510 509 … … 823 822 } 824 823 825 //$now = gmdate('Y-m-d H:i:59');826 827 //only select past-dated posts, except if a logged in user is viewing a single: then, if they828 //can edit the post, we let them through829 //if ($pagenow != 'post.php' && $pagenow != 'edit.php' && !($this->is_single && $user_ID)) {830 // $where .= " AND post_date_gmt <= '$now'";831 // $distinct = 'DISTINCT';832 //}833 834 824 if ( $this->is_attachment ) { 835 825 $where .= ' AND (post_type = "attachment")'; … … 843 833 if ( is_admin() ) 844 834 $where .= " OR post_status = 'future' OR post_status = 'draft'"; 845 else846 $distinct = 'DISTINCT';847 835 848 836 if ( is_user_logged_in() ) … … 885 873 // manipulate paging queries should use these hooks. 886 874 $where = apply_filters('posts_where_paged', $where); 887 $groupby = " $wpdb->posts.ID ";875 $groupby = ''; 888 876 $groupby = apply_filters('posts_groupby', $groupby); 877 if ( ! empty($groupby) ) 878 $groupby = 'GROUP BY ' . $groupby; 889 879 $join = apply_filters('posts_join_paged', $join); 890 880 $orderby = apply_filters('posts_orderby', $q['orderby']); 891 $request = " SELECT $distinct * FROM $wpdb->posts $join WHERE 1=1" . $where . " GROUP BY " . $groupby . " ORDER BY " . $orderby . "$limits";881 $request = " SELECT * FROM $wpdb->posts $join WHERE 1=1 $where $groupby ORDER BY $orderby $limits"; 892 882 $this->request = apply_filters('posts_request', $request); 893 883 -
trunk/wp-includes/template-functions-links.php
r3647 r3678 471 471 472 472 if ( 'posts' == get_query_var('what_to_show') ) { 473 preg_match('#FROM\s(.*)\s GROUPBY#siU', $wp_query->request, $matches);473 preg_match('#FROM\s(.*)\sORDER BY#siU', $wp_query->request, $matches); 474 474 $fromwhere = $matches[1]; 475 475 $numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere"); … … 477 477 } else { 478 478 $posts = $wp_query->posts; 479 preg_match('#WHERE\s(.*)\s GROUPBY#siU', $wp_query->request, $matches);479 preg_match('#WHERE\s(.*)\sORDER BY#siU', $wp_query->request, $matches); 480 480 $where = preg_replace('/( AND )?post_date >= (\'|\")(.*?)(\'|\")( AND post_date <= (\'\")(.*?)(\'\"))?/siU', '', $matches[1]); 481 481 $num_days = $wpdb->query("SELECT DISTINCT post_date FROM $wpdb->posts WHERE $where GROUP BY year(post_date), month(post_date), dayofmonth(post_date)"); -
trunk/wp-includes/version.php
r3581 r3678 4 4 5 5 $wp_version = '2.1-alpha1'; 6 $wp_db_version = 3 582;6 $wp_db_version = 3672; 7 7 8 8 ?>
Note: See TracChangeset
for help on using the changeset viewer.