Completed
Pull Request — master (#23)
by
unknown
02:00
created
ext.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
 					{
41 41
 						$this->container->get('user')->add_lang_ext('vse/similartopics', 'info_acp_similar_topics');
42 42
 						$this->container->get('template')->assign_var('L_EXTENSION_ENABLE_SUCCESS', $this->container->get('user')->lang['EXTENSION_ENABLE_SUCCESS'] .
43
-								$this->container->get('user')->lang['PST_LOG_CREATE_INDEX'] );
43
+								$this->container->get('user')->lang['PST_LOG_CREATE_INDEX']);
44 44
 					}
45 45
 				}
46 46
 
Please login to merge, or discard this patch.
migrations/release_postgres_support.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	{
27 27
 		return array(
28 28
 			array('config.add', array('similar_topics_postgres_ts_name',
29
-				($this->config->offsetExists('fulltext_postgres_ts_name')? $this->config['fulltext_postgres_ts_name'] : 'simple')
29
+				($this->config->offsetExists('fulltext_postgres_ts_name') ? $this->config['fulltext_postgres_ts_name'] : 'simple')
30 30
 			))
31 31
 		);
32 32
 	}
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 		if ($fulltext->is_postgres() && !empty($indexes))
56 56
 		{
57
-			foreach($indexes as $index)
57
+			foreach ($indexes as $index)
58 58
 			{
59 59
 				$sql = 'DROP INDEX ' . $index;
60 60
 				$this->db->sql_query($sql);
Please login to merge, or discard this patch.
acp/similar_topics_module.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 					if ($this->fulltext->is_postgres())
175 175
 					{
176 176
 						$ts_name = $this->request->variable('pst_postgres_ts_name',
177
-								($this->config->offsetExists('fulltext_postgres_ts_name')? $this->config['fulltext_postgres_ts_name'] : 'simple'));
177
+								($this->config->offsetExists('fulltext_postgres_ts_name') ? $this->config['fulltext_postgres_ts_name'] : 'simple'));
178 178
 						$this->config->set('similar_topics_postgres_ts_name', $ts_name);
179 179
 						$this->create_postgres_index($ts_name);
180 180
 					}
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 		$indexed = false;
424 424
 		// Prevent adding extra indeces.
425 425
 
426
-		foreach($this->fulltext->get_pg_indexes() as $index)
426
+		foreach ($this->fulltext->get_pg_indexes() as $index)
427 427
 		{
428 428
 			if ($index == TOPICS_TABLE . '_' . $ts_name . '_topic_title')
429 429
 			{
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -428,7 +428,9 @@
 block discarded – undo
428 428
 			if ($index == TOPICS_TABLE . '_' . $ts_name . '_topic_title')
429 429
 			{
430 430
 				$indexed = true;
431
-			} else {
431
+			}
432
+			else
433
+			{
432 434
 				$sql = 'DROP INDEX ' . $index;
433 435
 				$this->db->sql_query($sql);
434 436
 			}
Please login to merge, or discard this patch.
core/fulltext_support.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@
 block discarded – undo
140 140
 			$ts_name = $config['similar_topics_postgres_ts_name'];
141 141
 			foreach ($this->get_pg_indexes($field) AS $index)
142 142
 			{
143
-				if ($index == TOPICS_TABLE . '_' . $ts_name . '_' .$field)
143
+				if ($index == TOPICS_TABLE . '_' . $ts_name . '_' . $field)
144 144
 				{
145 145
 					$is_index = true;
146 146
 					break;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@
 block discarded – undo
138 138
 		{
139 139
 			global $config;
140 140
 			$ts_name = $config['similar_topics_postgres_ts_name'];
141
-			foreach ($this->get_pg_indexes($field) AS $index)
141
+			foreach ($this->get_pg_indexes($field) as $index)
142 142
 			{
143 143
 				if ($index == TOPICS_TABLE . '_' . $ts_name . '_' .$field)
144 144
 				{
Please login to merge, or discard this patch.
core/similar_topics.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -147,17 +147,17 @@
 block discarded – undo
147 147
 		$select = $where = $unix_ts = '';
148 148
 		if ($this->is_postgres())
149 149
 		{
150
-			$ts_query_text	= $this->db->sql_escape(str_replace(' ', '|',  $topic_title));
150
+			$ts_query_text = $this->db->sql_escape(str_replace(' ', '|', $topic_title));
151 151
 			$ts_name		= $this->config['similar_topics_postgres_ts_name'];
152 152
 			$select			= "f.forum_id, f.forum_name, t.*,
153 153
 				ts_rank_cd(to_tsvector('$ts_name', t.topic_title), '$ts_query_text', 32) AS score";
154
-			$where			= "ts_rank_cd(to_tsvector('$ts_name', t.topic_title), '$ts_query_text', 32) >= " . (float) $sensitivity ;
154
+			$where = "ts_rank_cd(to_tsvector('$ts_name', t.topic_title), '$ts_query_text', 32) >= " . (float) $sensitivity;
155 155
 			$unix_ts		= 'extract(epoch from current_timestamp)::integer';
156 156
 		} else {
157 157
 			$select = "f.forum_id, f.forum_name, t.*,
158 158
 				MATCH (t.topic_title) AGAINST ('" . $this->db->sql_escape($topic_title) . "') AS score";
159 159
 			$where = "MATCH (t.topic_title) AGAINST ('" . $this->db->sql_escape($topic_title) . "') >= " . (float) $sensitivity;
160
-			$unix_ts		= 'UNIX_TIMESTAMP()';
160
+			$unix_ts = 'UNIX_TIMESTAMP()';
161 161
 		}
162 162
 
163 163
 		// Similar Topics query
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -153,7 +153,9 @@
 block discarded – undo
153 153
 				ts_rank_cd(to_tsvector('$ts_name', t.topic_title), '$ts_query_text', 32) AS score";
154 154
 			$where			= "ts_rank_cd(to_tsvector('$ts_name', t.topic_title), '$ts_query_text', 32) >= " . (float) $sensitivity ;
155 155
 			$unix_ts		= 'extract(epoch from current_timestamp)::integer';
156
-		} else {
156
+		}
157
+		else
158
+		{
157 159
 			$select = "f.forum_id, f.forum_name, t.*,
158 160
 				MATCH (t.topic_title) AGAINST ('" . $this->db->sql_escape($topic_title) . "') AS score";
159 161
 			$where = "MATCH (t.topic_title) AGAINST ('" . $this->db->sql_escape($topic_title) . "') >= " . (float) $sensitivity;
Please login to merge, or discard this patch.