aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/config/tables.yml4
-rw-r--r--phpBB/docs/sphinx.sample.conf103
-rw-r--r--phpBB/includes/notification/manager.php1
-rw-r--r--phpBB/includes/search/fulltext_sphinx.php6
-rw-r--r--phpBB/includes/search/sphinx/config_variable.php2
5 files changed, 44 insertions, 72 deletions
diff --git a/phpBB/config/tables.yml b/phpBB/config/tables.yml
index 1191fd0ae1..ec5fec23ad 100644
--- a/phpBB/config/tables.yml
+++ b/phpBB/config/tables.yml
@@ -3,9 +3,9 @@ parameters:
tables.config_text: %core.table_prefix%config_text
tables.ext: %core.table_prefix%ext
tables.log: %core.table_prefix%log
+ tables.migrations: %core.table_prefix%migrations
+ tables.modules: %core.table_prefix%modules
tables.notification_types: %core.table_prefix%notification_types
tables.notifications: %core.table_prefix%notifications
tables.user_notifications: %core.table_prefix%user_notifications
tables.users: %core.table_prefix%users
- tables.migrations: %core.table_prefix%migrations
- tables.modules: %core.table_prefix%modules
diff --git a/phpBB/docs/sphinx.sample.conf b/phpBB/docs/sphinx.sample.conf
index fcaba6dcf3..d1b98d6cbc 100644
--- a/phpBB/docs/sphinx.sample.conf
+++ b/phpBB/docs/sphinx.sample.conf
@@ -1,46 +1,31 @@
source source_phpbb_{SPHINX_ID}_main
{
- type = mysql #mysql or pgsql
- sql_host = localhost #SQL server host sphinx connects to
+ type = mysql # mysql or pgsql
+ sql_host = localhost # SQL server host sphinx connects to
sql_user = username
sql_pass = password
sql_db = db_name
- sql_port = 3306 #optional, default is 3306 for mysql and 5432 for pgsql
+ sql_port = 3306 # optional, default is 3306 for mysql and 5432 for pgsql
sql_query_pre = SET NAMES 'utf8'
- sql_query_pre = UPDATE phpbb_sphinx SET max_doc_id = MAX(post_id) WHERE counter_id = 1
+ sql_query_pre = UPDATE phpbb_sphinx SET max_doc_id = (SELECT MAX(post_id) FROM phpbb_posts) WHERE counter_id = 1
sql_query_range = SELECT MIN(post_id), MAX(post_id) FROM phpbb_posts
sql_range_step = 5000
- sql_query = SELECT
-\
- p.post_id AS id,
-\
- p.forum_id,
-\
- p.topic_id,
-\
- p.poster_id,
-\
- CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,
-\
- p.post_time,
-\
- p.post_subject,
-\
- p.post_subject as title,
-\
- p.post_text as data,
-\
- t.topic_last_post_time,
-\
- 0 as deleted
-\
- FROM phpbb_posts p, phpbb_topics t
-\
- WHERE
-\
- p.topic_id = t.topic_id
-\
- AND p.post_id >= $start AND p.post_id <= $end
+ sql_query = SELECT \
+ p.post_id AS id, \
+ p.forum_id, \
+ p.topic_id, \
+ p.poster_id, \
+ CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post, \
+ p.post_time, \
+ p.post_subject, \
+ p.post_subject as title, \
+ p.post_text as data, \
+ t.topic_last_post_time, \
+ 0 as deleted\
+ FROM phpbb_posts p, phpbb_topics t \
+ WHERE \
+ p.topic_id = t.topic_id \
+ AND p.post_id >= $start AND p.post_id <= $end
sql_query_post =
sql_query_post_index = UPDATE phpbb_sphinx SET max_doc_id = $maxid WHERE counter_id = 1
sql_query_info = SELECT * FROM phpbb_posts WHERE post_id = $id
@@ -55,39 +40,25 @@ source source_phpbb_{SPHINX_ID}_main
}
source source_phpbb_{SPHINX_ID}_delta : source_phpbb_{SPHINX_ID}_main
{
+ sql_query_pre =
sql_query_range =
sql_range_step =
- sql_query = SELECT
-\
- p.post_id AS id,
-\
- p.forum_id,
-\
- p.topic_id,
-\
- p.poster_id,
-\
- CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,
-\
- p.post_time,
-\
- p.post_subject,
-\
- p.post_subject as title,
-\
- p.post_text as data,
-\
- t.topic_last_post_time,
-\
- 0 as deleted
-\
- FROM phpbb_posts p, phpbb_topics t
-\
- WHERE
-\
- p.topic_id = t.topic_id
-\
- AND p.post_id >= ( SELECT max_doc_id FROM phpbb_sphinx WHERE counter_id=1 )
+ sql_query = SELECT \
+ p.post_id AS id, \
+ p.forum_id, \
+ p.topic_id, \
+ p.poster_id, \
+ CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post, \
+ p.post_time, \
+ p.post_subject, \
+ p.post_subject as title, \
+ p.post_text as data, \
+ t.topic_last_post_time, \
+ 0 as deleted \
+ FROM phpbb_posts p, phpbb_topics t \
+ WHERE \
+ p.topic_id = t.topic_id \
+ AND p.post_id >= ( SELECT max_doc_id FROM phpbb_sphinx WHERE counter_id=1 )
sql_query_pre =
}
index index_phpbb_{SPHINX_ID}_main
diff --git a/phpBB/includes/notification/manager.php b/phpBB/includes/notification/manager.php
index ff83d4bb37..4e26234390 100644
--- a/phpBB/includes/notification/manager.php
+++ b/phpBB/includes/notification/manager.php
@@ -256,6 +256,7 @@ class phpbb_notification_manager
SET notification_read = 1
WHERE notification_time <= " . (int) $time .
(($item_type !== false) ? ' AND ' . (is_array($item_type) ? $this->db->sql_in_set('item_type', $item_type) : " item_type = '" . $this->db->sql_escape($item_type) . "'") : '') .
+ (($user_id !== false) ? ' AND ' . (is_array($user_id) ? $this->db->sql_in_set('user_id', $user_id) : 'user_id = ' . (int) $user_id) : '') .
(($item_id !== false) ? ' AND ' . (is_array($item_id) ? $this->db->sql_in_set('item_id', $item_id) : 'item_id = ' . (int) $item_id) : '');
$this->db->sql_query($sql);
}
diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php
index 48445d0794..28761792ec 100644
--- a/phpBB/includes/search/fulltext_sphinx.php
+++ b/phpBB/includes/search/fulltext_sphinx.php
@@ -258,13 +258,13 @@ class phpbb_search_fulltext_sphinx
$config_object = new phpbb_search_sphinx_config($this->config_file_data);
$config_data = array(
'source source_phpbb_' . $this->id . '_main' => array(
- array('type', $this->dbtype),
+ array('type', $this->dbtype . ' # mysql or pgsql'),
// This config value sql_host needs to be changed incase sphinx and sql are on different servers
- array('sql_host', $dbhost),
+ array('sql_host', $dbhost . ' # SQL server host sphinx connects to'),
array('sql_user', $dbuser),
array('sql_pass', $dbpasswd),
array('sql_db', $dbname),
- array('sql_port', $dbport),
+ array('sql_port', $dbport . ' # optional, default is 3306 for mysql and 5432 for pgsql'),
array('sql_query_pre', 'SET NAMES \'utf8\''),
array('sql_query_pre', 'UPDATE ' . SPHINX_TABLE . ' SET max_doc_id = (SELECT MAX(post_id) FROM ' . POSTS_TABLE . ') WHERE counter_id = 1'),
array('sql_query_range', 'SELECT MIN(post_id), MAX(post_id) FROM ' . POSTS_TABLE . ''),
diff --git a/phpBB/includes/search/sphinx/config_variable.php b/phpBB/includes/search/sphinx/config_variable.php
index 35abe281cb..2c1d35a49c 100644
--- a/phpBB/includes/search/sphinx/config_variable.php
+++ b/phpBB/includes/search/sphinx/config_variable.php
@@ -75,6 +75,6 @@ class phpbb_search_sphinx_config_variable
*/
function to_string()
{
- return "\t" . $this->name . ' = ' . str_replace("\n", "\\\n", $this->value) . ' ' . $this->comment . "\n";
+ return "\t" . $this->name . ' = ' . str_replace("\n", " \\\n", $this->value) . ' ' . $this->comment . "\n";
}
}