git-svn-id: http://svn.automattic.com/wordpress/trunk@2264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7231abe7ea
commit
83f85c76ac
|
@ -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'");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue