diff options
| author | Nils Adermann <naderman@naderman.de> | 2006-01-22 19:13:12 +0000 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2006-01-22 19:13:12 +0000 |
| commit | 4b08c14417d716c6186250d54ed35d578c074707 (patch) | |
| tree | 3c38d0c24f792e7bf803232cfeb767fc632535c5 /phpBB/includes/search/fulltext_phpbb.php | |
| parent | ec959d00014ba92466b676e0a32d662e629825e5 (diff) | |
| download | forums-4b08c14417d716c6186250d54ed35d578c074707.tar forums-4b08c14417d716c6186250d54ed35d578c074707.tar.gz forums-4b08c14417d716c6186250d54ed35d578c074707.tar.bz2 forums-4b08c14417d716c6186250d54ed35d578c074707.tar.xz forums-4b08c14417d716c6186250d54ed35d578c074707.zip | |
- added fulltext_mysql
- sort search results by topic author, not topic author id
- topic tracking on search results page
- dotted topics on search results page
- links to global announcements fixed
git-svn-id: file:///svn/phpbb/trunk@5488 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/search/fulltext_phpbb.php')
| -rw-r--r-- | phpBB/includes/search/fulltext_phpbb.php | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/phpBB/includes/search/fulltext_phpbb.php b/phpBB/includes/search/fulltext_phpbb.php index 3dadc08466..d9a61d4d6b 100644 --- a/phpBB/includes/search/fulltext_phpbb.php +++ b/phpBB/includes/search/fulltext_phpbb.php @@ -36,8 +36,8 @@ class fulltext_phpbb extends search_backend { global $db, $config; - $drop_char_match = array('^', '$', ';', '#', '&', '(', ')', '<', '>', '`', '\'', '"', ',', '@', '_', '?', '%', '~', '.', '[', ']', '{', '}', ':', '\\', '/', '=', '\'', '!'); - $drop_char_replace = array(' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '', '', ' ', ' ', ' ', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '' , ' ', ' ', ' ', ' '); + $drop_char_match = array('^', '$', ';', '#', '&', '(', ')', '<', '>', '`', '\'', '"', ',', '@', '_', '?', '%', '~', '.', '[', ']', '{', '}', ':', '\\', '/', '=', '!'); + $drop_char_replace = array(' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '', '', ' ', ' ', ' ', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '' , ' ', ' ', ' '); $this->get_ignore_words(); $this->get_synonyms(); @@ -206,7 +206,7 @@ class fulltext_phpbb extends search_backend * Performs a search on keywords depending on display specific params. * * @param array $id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered - * @param int $start indicated the first index of the page + * @param int $start indicates the first index of the page * @param int $per_page number of ids each page is supposed to contain * @return total number of results */ @@ -252,14 +252,17 @@ class fulltext_phpbb extends search_backend case 'u': $sql_sort_table = USERS_TABLE . ' u, '; $sql_sort_join = ' AND u.user_id = p.poster_id '; - break; + break; + case 't': $join_topic = true; - break; + break; + case 'f': $sql_sort_table = FORUMS_TABLE . ' f, '; $sql_sort_join = ' AND f.forum_id = p.forum_id '; - break; + break; + } // Build some display specific sql strings @@ -268,14 +271,17 @@ class fulltext_phpbb extends search_backend case 'titleonly': $sql_match = ' AND m.title_match = 1 AND p.post_id = t.topic_first_post_id'; $join_topic = true; - break; + break; + case 'msgonly': $sql_match = ' AND m.title_match = 0'; - break; + break; + case 'firstpost': $sql_match = ' AND p.post_id = t.topic_first_post_id'; $join_topic = true; - break; + break; + default: $sql_match = ''; } @@ -522,7 +528,7 @@ class fulltext_phpbb extends search_backend * Performs a search on an author's posts without caring about message contents. Depends on display specific params * * @param array $id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered - * @param int $start indicated the first index of the page + * @param int $start indicates the first index of the page * @param int $per_page number of ids each page is supposed to contain * @return total number of results */ @@ -572,15 +578,17 @@ class fulltext_phpbb extends search_backend case 'u': $sql_sort_table = USERS_TABLE . ' u, '; $sql_sort_join = ' AND u.user_id = p.poster_id '; - break; + break; + case 't': $sql_sort_table = ($type == 'posts') ? TOPICS_TABLE . ' t, ' : ''; $sql_sort_join = ($type == 'posts') ? ' AND t.topic_id = p.topic_id ' : ''; - break; + break; + case 'f': $sql_sort_table = FORUMS_TABLE . ' f, '; $sql_sort_join = ' AND f.forum_id = p.forum_id '; - break; + break; } // If the cache was completely empty count the results @@ -745,7 +753,7 @@ class fulltext_phpbb extends search_backend $sql = 'INSERT INTO ' . SEARCH_WORD_TABLE . ' (word_text) VALUES ' . implode(', ', preg_replace('#^(.*)$#', '(\'$1\')', $new_words)); $db->sql_query($sql); - break; + break; case 'mysql4': case 'mysqli': @@ -754,7 +762,7 @@ class fulltext_phpbb extends search_backend case 'sqlite': $sql = 'INSERT INTO ' . SEARCH_WORD_TABLE . ' (word_text) ' . implode(' UNION ALL ', preg_replace('#^(.*)$#', "SELECT '\$1'", $new_words)); $db->sql_query($sql); - break; + break; default: foreach ($new_words as $word) @@ -763,7 +771,6 @@ class fulltext_phpbb extends search_backend VALUES ('$word')"; $db->sql_query($sql); } - break; } } unset($new_words); |
