made the search an 'AND' search (I think)
git-svn-id: https://develop.svn.wordpress.org/trunk@367 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f0247cb9b1
commit
4e4cc84c13
@ -109,9 +109,9 @@ if (!empty($s)) {
|
|||||||
}
|
}
|
||||||
if (!$sentence) {
|
if (!$sentence) {
|
||||||
$s_array = explode(' ',$s);
|
$s_array = explode(' ',$s);
|
||||||
$search .= '(post_title LIKE \''.$n.$s_array[0].$n.'\') OR (post_content LIKE \''.$s_array[0].'\')';
|
$search .= '((post_title LIKE \''.$n.$s_array[0].$n.'\') OR (post_content LIKE \''.$s_array[0].'\'))';
|
||||||
for ( $i = 1; $i < count($s_array); $i = $i + 1) {
|
for ( $i = 1; $i < count($s_array); $i = $i + 1) {
|
||||||
$search .= ' OR (post_title LIKE \''.$n.$s_array[$i].$n.'\') OR (post_content LIKE \''.$n.$s_array[$i].$n.'\')';
|
$search .= ' AND ((post_title LIKE \''.$n.$s_array[$i].$n.'\') OR (post_content LIKE \''.$n.$s_array[$i].$n.'\'))';
|
||||||
}
|
}
|
||||||
$search .= ' OR (post_title LIKE \''.$n.$s.$n.'\') OR (post_content LIKE \''.$n.$s.$n.'\')';
|
$search .= ' OR (post_title LIKE \''.$n.$s.$n.'\') OR (post_content LIKE \''.$n.$s.$n.'\')';
|
||||||
$search .= ')';
|
$search .= ')';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user