Fixed logic error when selecting posts by multiple author ids

git-svn-id: http://svn.automattic.com/wordpress/trunk@404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
emc3 2003-10-02 13:56:14 +00:00
parent e50c87cc4f
commit aaeaaa0c45
1 changed files with 2 additions and 1 deletions

View File

@ -158,10 +158,11 @@ if ((empty($author)) || ($author == 'all') || ($author == '0')) {
$andor = 'OR'; $andor = 'OR';
} }
$author_array = explode(' ', $author); $author_array = explode(' ', $author);
$whichauthor .= ' AND post_author '.$eq.' '.intval($author_array[0]); $whichauthor .= ' AND (post_author '.$eq.' '.intval($author_array[0]);
for ($i = 1; $i < (count($author_array)); $i = $i + 1) { for ($i = 1; $i < (count($author_array)); $i = $i + 1) {
$whichauthor .= ' '.$andor.' post_author '.$eq.' '.intval($author_array[$i]); $whichauthor .= ' '.$andor.' post_author '.$eq.' '.intval($author_array[$i]);
} }
$whichauthor .= ')';
} }
$where .= $search.$whichcat.$whichauthor; $where .= $search.$whichcat.$whichauthor;