From 6a5b25251eb16dc8da58816eb41e806197fe8a43 Mon Sep 17 00:00:00 2001 From: donncha Date: Tue, 14 Feb 2006 16:56:46 +0000 Subject: WP Merge git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@525 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-inst/wp-admin/admin-db.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'wp-inst/wp-admin/admin-db.php') diff --git a/wp-inst/wp-admin/admin-db.php b/wp-inst/wp-admin/admin-db.php index e4cf6bf..2a4a83a 100644 --- a/wp-inst/wp-admin/admin-db.php +++ b/wp-inst/wp-admin/admin-db.php @@ -3,7 +3,7 @@ function get_users_drafts( $user_id ) { global $wpdb; $user_id = (int) $user_id; - $query = "SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author = $user_id ORDER BY ID DESC"; + $query = "SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author = $user_id ORDER BY ID DESC"; $query = apply_filters('get_users_drafts', $query); return $wpdb->get_results( $query ); } @@ -14,12 +14,12 @@ function get_others_drafts( $user_id ) { $level_key = $wpdb->prefix . 'user_level'; $editable = get_editable_user_ids( $user_id ); - + if( !$editable ) { $other_drafts = ''; } else { $editable = join(',', $editable); - $other_drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author IN ($editable) AND post_author != '$user_id' "); + $other_drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author IN ($editable) AND post_author != '$user_id' "); } return apply_filters('get_others_drafts', $other_drafts); @@ -42,9 +42,9 @@ function get_editable_authors( $user_id ) { function get_editable_user_ids( $user_id, $exclude_zeros = true ) { global $wpdb; - + $user = new WP_User( $user_id ); - + if ( ! $user->has_cap('edit_others_posts') ) { if ( $user->has_cap('edit_posts') || $exclude_zeros == false ) return array($user->id); @@ -57,7 +57,7 @@ function get_editable_user_ids( $user_id, $exclude_zeros = true ) { $query = "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$level_key'"; if ( $exclude_zeros ) $query .= " AND meta_value != '0'"; - + return $wpdb->get_col( $query ); } -- cgit