Sorry for the length of this post - wasn't sure how much around the problem area to grab. This is a portion of search.php -
default:
if ( !empty($search_terms) )
{
$current_match_type = 'and';
}
// BEGIN QWiki MOD By LoonyLuke (
www.Quezza.com AND
www.ForumImgs.com)
if ($return_wiki)
{
$from_sql = ", " . POSTS_TABLE . " p";
$where_sql = " AND p.post_id = m.post_id AND p.post_wiki";
}
// END QWiki MOD By LoonyLuke (
www.Quezza.com AND
www.ForumImgs.com)
if ( !strstr($multibyte_charset, $lang['ENCODING']) )
{
$match_word = str_replace('*', '%', $split_search[$i]);
$sql = "SELECT m.post_id
FROM " . SEARCH_WORD_TABLE . " w, " . SEARCH_MATCH_TABLE . " m, " . $from_sql . "
WHERE w.word_text LIKE '$match_word'
AND m.word_id = w.word_id
AND w.word_common <> 1
$search_msg_only $where_sql";
}
// BEGIN QWiki MOD By LoonyLuke (
www.Quezza.com AND
www.ForumImgs.com)
if ($return_wiki)
{
$sql .= " AND post_wiki = 1";
}
// END QWiki MOD By LoonyLuke (
www.Quezza.com AND
www.ForumImgs.com)
else
{
$match_word = addslashes('%' . str_replace('*', '', $split_search[$i]) . '%');
$search_msg_only = ( $search_fields ) ? "OR post_subject LIKE '$match_word'" : '';
$sql = "SELECT post_id
FROM " . POSTS_TEXT_TABLE . "
WHERE post_text LIKE '$match_word'
$search_msg_only";
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain matched posts list', '', __LINE__, __FILE__, $sql);
}
$row = array();
while( $temp_row = $db->sql_fetchrow($result) )
{
$row[$temp_row['post_id']] = 1;
if ( !$word_count )
{
$result_list[$temp_row['post_id']] = 1;
}
else if ( $current_match_type == 'or' )
{
$result_list[$temp_row['post_id']] = 1;
}
else if ( $current_match_type == 'not' )
{
$result_list[$temp_row['post_id']] = 0;
}
}
if ( $current_match_type == 'and' && $word_count )
{
@reset($result_list);
while( list($post_id, $match_count) = @each($result_list) )
{
if ( !$row[$post_id] )
{
$result_list[$post_id] = 0;
}
}
}
$word_count++;
$db->sql_freeresult($result);
}
}
If you look at the following line ...
FROM " . SEARCH_WORD_TABLE . " w, " . SEARCH_MATCH_TABLE . " m, " . $from_sql . "
... you can see that I had to modify your mod ( . $from_sql . ") which did not contain the preceeding parantheses or comma - not sure it needed the comma.
I invite you to take a look at my site (
www.green-space.us/forum) and let me know what you think and whether it's working as expected.
Thanks!