diff options
author | Nils Adermann <naderman@naderman.de> | 2006-03-26 01:36:26 +0000 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2006-03-26 01:36:26 +0000 |
commit | 8a32e0de742d9d4fd453402a48889bc6edd6a7f9 (patch) | |
tree | 83da50045e715ee7c47e8ea84e528a7fc17f58a6 /phpBB/includes/search/fulltext_mysql.php | |
parent | ed32b4d8dc396a656a6a0b84f9a40c5fce53278a (diff) | |
download | forums-8a32e0de742d9d4fd453402a48889bc6edd6a7f9.tar forums-8a32e0de742d9d4fd453402a48889bc6edd6a7f9.tar.gz forums-8a32e0de742d9d4fd453402a48889bc6edd6a7f9.tar.bz2 forums-8a32e0de742d9d4fd453402a48889bc6edd6a7f9.tar.xz forums-8a32e0de742d9d4fd453402a48889bc6edd6a7f9.zip |
- correctly use DISTINCT and GROUP BY in search related SQL [Bug #1256]
- always display views and replies in search results [Bug #1223]
- display error messages occuring during search index creation/deletion [Bug #1274]
- correctly align the ACP link on the search results page [Bug #1160]
- fixed the search forum box [Bug #1300] and added a search topic box (subBlue: can you please position this a little more visible, didn't want to mess with the CSS ;-))
- correctly check and use show_results on the search page
git-svn-id: file:///svn/phpbb/trunk@5727 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/search/fulltext_mysql.php')
-rw-r--r-- | phpBB/includes/search/fulltext_mysql.php | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 3ef8fe0b2d..45597376fe 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -40,7 +40,7 @@ class fulltext_mysql extends search_backend } /** - * Checks for correct MySQL version and stores max/min word length in the config + * Checks for correct MySQL version and stores min/max word length in the config */ function init() { @@ -61,12 +61,18 @@ class fulltext_mysql extends search_backend } $result = $db->sql_query('SHOW TABLE STATUS LIKE \'' . POSTS_TABLE . '\''); - $engine = $db->sql_fetchfield('Engine', 0, $result); - if (!$engine) + $info = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $engine = ''; + if (isset($info['Engine'])) { - $engine = $db->sql_fetchfield('Type', 0, $result); + $engine = $info['Engine']; + } + else if (isset($info['Type'])) + { + $engine = $info['Type']; } - $db->sql_freeresult($result); if ($engine != 'MyISAM') { @@ -160,7 +166,7 @@ class fulltext_mysql extends search_backend } /** - * Turns text into an array of words that can be stored in the word list table + * Turns text into an array of words */ function split_message($text) { @@ -618,9 +624,10 @@ class fulltext_mysql extends search_backend { global $db; - if (strpos(SQL_LAYER, 'mysql') === false) + // Make sure we can actually use MySQL with fulltext indexes + if ($error = $this->init()) { - return $user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_VERSION']; + return $error; } if (!is_array($this->stats)) @@ -648,9 +655,10 @@ class fulltext_mysql extends search_backend { global $db; - if (strpos(SQL_LAYER, 'mysql') === false) + // Make sure we can actually use MySQL with fulltext indexes + if ($error = $this->init()) { - return $user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_VERSION']; + return $error; } if (!is_array($this->stats)) @@ -706,6 +714,12 @@ class fulltext_mysql extends search_backend { global $db; + if (strpos(SQL_LAYER, 'mysql') === false) + { + $this->stats = array(); + return; + } + $sql = 'SHOW INDEX FROM ' . POSTS_TABLE; $result = $db->sql_query($sql); |