|
From: Paul S. O. <ps...@us...> - 2002-02-18 15:06:20
|
Update of /cvsroot/phpbb/phpBB2/includes
In directory usw-pr-cvs1:/tmp/cvs-serv6290/includes
Modified Files:
search.php
Log Message:
Wasn't updating search match table ... fudged solution
Index: search.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/search.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** search.php 15 Feb 2002 21:59:01 -0000 1.10
--- search.php 18 Feb 2002 15:06:15 -0000 1.11
***************
*** 116,121 ****
--- 116,123 ----
$word = array();
+ $word_insert_sql = array();
while( list($word_in, $search_matches) = @each($search_raw_words) )
{
+ $word_insert_sql[$word_in] = "";
if( !empty($search_matches) )
{
***************
*** 126,130 ****
if( $search_matches[$i] != "" )
{
! $word[] = $search_matches[$i];
}
}
--- 128,136 ----
if( $search_matches[$i] != "" )
{
! $word[] = $search_matches[$i];
! if ( !strstr($word_insert_sql[$word_in], "'" . $search_matches[$i] . "'") )
! {
! $word_insert_sql[$word_in] .= ( $word_insert_sql[$word_in] != "" ) ? ", '" . $search_matches[$i] . "'" : "'" . $search_matches[$i] . "'";
! }
}
}
***************
*** 157,161 ****
case 'oracle':
case 'db2':
! $sql = "SELECT word_id, word_text, word_common
FROM " . SEARCH_WORD_TABLE . "
WHERE word_text IN ($word_text_sql)";
--- 163,167 ----
case 'oracle':
case 'db2':
! $sql = "SELECT word_id, word_text
FROM " . SEARCH_WORD_TABLE . "
WHERE word_text IN ($word_text_sql)";
***************
*** 167,171 ****
while( $row = $db->sql_fetchrow($result) )
{
! $check_words[$row['word_text']] = $row['word_common'];
}
break;
--- 173,177 ----
while( $row = $db->sql_fetchrow($result) )
{
! $check_words[$row['word_text']] = $row['word_id'];
}
break;
***************
*** 229,243 ****
}
! while( list($word_in, $match_sql) = @each($word_text_sql) )
{
$title_match = ( $word_in == 'title' ) ? 1 : 0;
! $sql = "INSERT INTO " . SEARCH_MATCH_TABLE . " (post_id, word_id, title_match)
! SELECT $post_id, word_id, $title_match
! FROM " . SEARCH_WORD_TABLE . "
! WHERE word_text IN ($match_sql)";
! if( !($result = $db->sql_query($sql)) )
{
! message_die(GENERAL_ERROR, "Couldn't insert new word matches", "", __LINE__, __FILE__, $sql);
}
}
--- 235,252 ----
}
! while( list($word_in, $match_sql) = @each($word_insert_sql) )
{
$title_match = ( $word_in == 'title' ) ? 1 : 0;
! if ( $match_sql != "" )
{
! $sql = "INSERT INTO " . SEARCH_MATCH_TABLE . " (post_id, word_id, title_match)
! SELECT $post_id, word_id, $title_match
! FROM " . SEARCH_WORD_TABLE . "
! WHERE word_text IN ($match_sql)";
! if( !($result = $db->sql_query($sql)) )
! {
! message_die(GENERAL_ERROR, "Couldn't insert new word matches", "", __LINE__, __FILE__, $sql);
! }
}
}
|