|
From: Paul S. O. <ps...@us...> - 2001-11-09 13:26:58
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv15462
Modified Files:
posting.php search.php
Log Message:
Altered for constant table names
Index: posting.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/posting.php,v
retrieving revision 1.90
retrieving revision 1.91
diff -C2 -r1.90 -r1.91
*** posting.php 2001/11/09 13:15:35 1.90
--- posting.php 2001/11/09 13:26:55 1.91
***************
*** 124,134 ****
$word_id_sql .= $word_id_list[$i]['word_id'];
}
! $word_id_sql = " AND sl.word_id IN ($word_id_sql)";
! $sql = "SELECT sl.word_id, SUM(sm.word_count) AS post_occur_count
! FROM phpbb_search_wordlist sl, phpbb_search_wordmatch sm
! WHERE sl.word_id = sm.word_id
$word_id_sql
! GROUP BY sl.word_id
ORDER BY post_occur_count DESC";
if( !$result = $db->sql_query($sql) )
--- 124,134 ----
$word_id_sql .= $word_id_list[$i]['word_id'];
}
! $word_id_sql = " AND w.word_id IN ($word_id_sql)";
! $sql = "SELECT w.word_id, SUM(m.word_count) AS post_occur_count
! FROM " . SEARCH_WORD_TABLE . " w, " . SEARCH_MATCH_TABLE . " m
! WHERE w.word_id = m.word_id
$word_id_sql
! GROUP BY w.word_id
ORDER BY post_occur_count DESC";
if( !$result = $db->sql_query($sql) )
***************
*** 157,161 ****
if( ( $rowset[$i]['post_occur_count'] / $row['total_posts'] ) >= $percent )
{
! $sql = "DELETE FROM phpbb_search_wordlist
WHERE word_id = " . $rowset[$i]['word_id'];
$result = $db->sql_query($sql);
--- 157,161 ----
if( ( $rowset[$i]['post_occur_count'] / $row['total_posts'] ) >= $percent )
{
! $sql = "DELETE FROM " . SEARCH_WORD_TABLE . "
WHERE word_id = " . $rowset[$i]['word_id'];
$result = $db->sql_query($sql);
***************
*** 165,169 ****
}
! $sql = "DELETE FROM phpbb_search_wordmatch
WHERE word_id = " . $rowset[$i]['word_id'];
$result = $db->sql_query($sql);
--- 165,169 ----
}
! $sql = "DELETE FROM " . SEARCH_MATCH_TABLE . "
WHERE word_id = " . $rowset[$i]['word_id'];
$result = $db->sql_query($sql);
***************
*** 195,199 ****
{
$row = $db->sql_fetchrow($result);
- // print_r($row);
$search_text = clean_words($row['post_text'], $stopword_array, $synonym_array);
--- 195,198 ----
***************
*** 245,249 ****
$sql = "SELECT word_id, word_text
! FROM phpbb_search_wordlist
WHERE word_text IN ($sql_in)";
$result = $db->sql_query($sql);
--- 244,248 ----
$sql = "SELECT word_id, word_text
! FROM " . SEARCH_WORD_TABLE . "
WHERE word_text IN ($sql_in)";
$result = $db->sql_query($sql);
***************
*** 257,262 ****
$check_words = $db->sql_fetchrowset($result);
- // print_r($check_words);
-
$word_id_sql = "";
for($i = 0; $i < count($check_words); $i++ )
--- 256,259 ----
***************
*** 271,275 ****
$sql = "SELECT word_id, COUNT(post_id) AS post_occur_count
! FROM phpbb_search_wordmatch
WHERE $word_id_sql
GROUP BY word_id
--- 268,272 ----
$sql = "SELECT word_id, COUNT(post_id) AS post_occur_count
! FROM " . SEARCH_MATCH_TABLE . "
WHERE $word_id_sql
GROUP BY word_id
***************
*** 284,295 ****
$rowset = $db->sql_fetchrowset($result);
- // print_r($rowset);
-
for($i = 0; $i < $post_count; $i++)
{
- // echo $rowset[$i]['post_occur_count'] . "<BR>";
if( $rowset[$i]['post_occur_count'] == 1 )
{
! $sql = "DELETE FROM phpbb_search_wordlist
WHERE word_id = " . $rowset[$i]['word_id'];
$result = $db->sql_query($sql);
--- 281,289 ----
$rowset = $db->sql_fetchrowset($result);
for($i = 0; $i < $post_count; $i++)
{
if( $rowset[$i]['post_occur_count'] == 1 )
{
! $sql = "DELETE FROM " . SEARCH_WORD_TABLE . "
WHERE word_id = " . $rowset[$i]['word_id'];
$result = $db->sql_query($sql);
***************
*** 302,306 ****
}
! $sql = "DELETE FROM phpbb_search_wordmatch
WHERE post_id = $post_id";
$result = $db->sql_query($sql);
--- 296,300 ----
}
! $sql = "DELETE FROM " . SEARCH_MATCH_TABLE . "
WHERE post_id = $post_id";
$result = $db->sql_query($sql);
***************
*** 375,379 ****
$sql = "SELECT word_id, word_text
! FROM phpbb_search_wordlist
WHERE word_text IN ($sql_in)";
$result = $db->sql_query($sql);
--- 369,373 ----
$sql = "SELECT word_id, word_text
! FROM " . SEARCH_WORD_TABLE . "
WHERE word_text IN ($sql_in)";
$result = $db->sql_query($sql);
***************
*** 408,412 ****
if( $new_match )
{
! $sql = "INSERT INTO phpbb_search_wordlist (word_text)
VALUES ('". addslashes($word[$j]) . "')";
$result = $db->sql_query($sql);
--- 402,406 ----
if( $new_match )
{
! $sql = "INSERT INTO " . SEARCH_WORD_TABLE . " (word_text)
VALUES ('". addslashes($word[$j]) . "')";
$result = $db->sql_query($sql);
***************
*** 419,423 ****
}
! $sql = "INSERT INTO phpbb_search_wordmatch (post_id, word_id, word_count, title_match)
VALUES ($post_id, $word_id, " . $word_count[$word[$j]] . ", 0)";
$result = $db->sql_query($sql);
--- 413,417 ----
}
! $sql = "INSERT INTO " . SEARCH_MATCH_TABLE . " (post_id, word_id, word_count, title_match)
VALUES ($post_id, $word_id, " . $word_count[$word[$j]] . ", 0)";
$result = $db->sql_query($sql);
Index: search.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/search.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** search.php 2001/11/09 13:00:03 1.23
--- search.php 2001/11/09 13:26:55 1.24
***************
*** 308,312 ****
$sql = "SELECT m.post_id, m.word_count
! FROM phpbb_search_wordlist w, phpbb_search_wordmatch m
WHERE w.word_text LIKE '$match_word'
AND m.word_id = w.word_id
--- 308,312 ----
$sql = "SELECT m.post_id, m.word_count
! FROM " . SEARCH_WORD_TABLE . " w, " . SEARCH_MATCH_TABLE . " m
WHERE w.word_text LIKE '$match_word'
AND m.word_id = w.word_id
|