git-svn-id: http://svn.automattic.com/wordpress/trunk@2264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2005-02-11 02:27:45 +00:00
parent 7231abe7ea
commit 83f85c76ac
1 changed files with 6 additions and 1 deletions

View File

@ -12,7 +12,12 @@ get_currentuserinfo();
<?php
if (isset($user_ID) && ('' != intval($user_ID))) {
$posts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_status = 'static' AND post_author = $user_ID");
$posts = $wpdb->get_results("
SELECT $wpdb->posts.*, $wpdb->users.user_level FROM $wpdb->posts
INNER JOIN $wpdb->users ON ($wpdb->posts.post_author = $wpdb->users.ID)
WHERE $wpdb->posts.post_status = 'static'
AND ($wpdb->users.user_level < $user_level OR $wpdb->posts.post_author = $user_ID)
");
} else {
$posts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_status = 'static'");
}