2006-06-21, 01:21 PM
What do I have to do to be able to search for 2 keywords. The way I think it is coded now (by looking at the sql string in debug mode), it searches for one or the other but I want them both in the topic/post.
I have looked at the code of search.php and there I found this:
If this is possible without changing the code, could anyone tell me how?
If this is not possible consider this post a suggestion.
I have looked at the code of search.php and there I found this:
if($mybb->input['keywords']) {
$wheresql = "(1=0 ";
if($mybb->input['srchtype'] != 2)
{
$words = explode(" ", $mybb->input['keywords']);
$wordcount = count($words);
for($i=0;$i<$wordcount;$i++)
{
$wheresql .= "OR $op $lookin LIKE '%".addslashes($words[$i])."%'";
if($lookin2)
{
$wheresql .= "OR $op $lookin2 LIKE '%".addslashes($words[$i])."%'";
}
}
}
else
{
$wheresql .= " AND $lookin LIKE '%".addslashes($mybb->input['keywords'])."%'";
}
}
It seems that if the variable $mybb->input['srchtype'] equals 2 it uses an and operator in the sql string. But "WHERE 1=0 AND $lookin LIKE '%keywords%'" will never return any results.If this is possible without changing the code, could anyone tell me how?
If this is not possible consider this post a suggestion.