Only display published entries.

git-svn-id: https://develop.svn.wordpress.org/trunk@142 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2003-06-01 14:49:04 +00:00
parent 05ce9b7dd9
commit e95f55e8a3
1 changed files with 4 additions and 1 deletions

View File

@ -46,7 +46,6 @@ $what_to_show = get_settings('what_to_show');
$archive_mode = get_settings('archive_mode');
$dateformat = stripslashes(get_settings('date_format'));
$timeformat = stripslashes(get_settings('time_format'));
$autobr = get_settings('AutoBR');
$time_difference = get_settings('time_difference');
/* First let's clear some variables */
@ -252,9 +251,13 @@ if ($pagenow != 'b2edit.php') {
gzip_compression();
}
}
$where .= ' AND post_status = "publish"';
// Get private posts
if ('' != intval($user_ID)) $where .= " OR post_author = $user_ID AND post_status != 'draft'";
$request = " SELECT $distinct * FROM $tableposts WHERE 1=1".$where." ORDER BY post_$orderby $limits";
if ($preview) {
$request = 'SELECT 1-1'; // dummy mysql query for the preview
// little funky fix for IEwin, rawk on that code