@@ -416,7 +416,7 @@ |
||
| 416 | 416 | * Return a variable if it is set, otherwise default |
| 417 | 417 | * |
| 418 | 418 | * @param mixed $var The variable to test |
| 419 | - * @param mixed $default The default value to use |
|
| 419 | + * @param false|string $default The default value to use |
|
| 420 | 420 | * @return mixed The value of the variable if set, otherwise default value |
| 421 | 421 | * @access protected |
| 422 | 422 | */ |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | public $u_action; |
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | - * ACP module constructor |
|
| 59 | - * |
|
| 60 | - * @access public |
|
| 61 | - */ |
|
| 58 | + * ACP module constructor |
|
| 59 | + * |
|
| 60 | + * @access public |
|
| 61 | + */ |
|
| 62 | 62 | public function __construct() |
| 63 | 63 | { |
| 64 | 64 | global $phpbb_container; |
@@ -81,12 +81,12 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | - * Main ACP module |
|
| 85 | - * |
|
| 86 | - * @param int $id |
|
| 87 | - * @param string $mode |
|
| 88 | - * @access public |
|
| 89 | - */ |
|
| 84 | + * Main ACP module |
|
| 85 | + * |
|
| 86 | + * @param int $id |
|
| 87 | + * @param string $mode |
|
| 88 | + * @access public |
|
| 89 | + */ |
|
| 90 | 90 | public function main($id, $mode) |
| 91 | 91 | { |
| 92 | 92 | $this->user->add_lang('acp/common'); |
@@ -256,11 +256,11 @@ discard block |
||
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | /** |
| 259 | - * Check if config field values exceed 255 chars |
|
| 260 | - * |
|
| 261 | - * @return null |
|
| 262 | - * @access protected |
|
| 263 | - */ |
|
| 259 | + * Check if config field values exceed 255 chars |
|
| 260 | + * |
|
| 261 | + * @return null |
|
| 262 | + * @access protected |
|
| 263 | + */ |
|
| 264 | 264 | protected function validate_config_length() |
| 265 | 265 | { |
| 266 | 266 | $arg_list = func_get_args(); |
@@ -274,12 +274,12 @@ discard block |
||
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | /** |
| 277 | - * Check form key, trigger error if invalid |
|
| 278 | - * |
|
| 279 | - * @param string $form_key The form key value |
|
| 280 | - * @return null |
|
| 281 | - * @access protected |
|
| 282 | - */ |
|
| 277 | + * Check form key, trigger error if invalid |
|
| 278 | + * |
|
| 279 | + * @param string $form_key The form key value |
|
| 280 | + * @return null |
|
| 281 | + * @access protected |
|
| 282 | + */ |
|
| 283 | 283 | protected function check_form_key($form_key) |
| 284 | 284 | { |
| 285 | 285 | if (!check_form_key($form_key)) |
@@ -289,11 +289,11 @@ discard block |
||
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | /** |
| 292 | - * Get forums list |
|
| 293 | - * |
|
| 294 | - * @return array forum data rows |
|
| 295 | - * @access protected |
|
| 296 | - */ |
|
| 292 | + * Get forums list |
|
| 293 | + * |
|
| 294 | + * @return array forum data rows |
|
| 295 | + * @access protected |
|
| 296 | + */ |
|
| 297 | 297 | protected function get_forum_list() |
| 298 | 298 | { |
| 299 | 299 | $sql = 'SELECT forum_id, forum_name, similar_topic_forums |
@@ -308,13 +308,13 @@ discard block |
||
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | /** |
| 311 | - * Calculate the time in seconds based on requested time period length |
|
| 312 | - * |
|
| 313 | - * @param int $length user entered value |
|
| 314 | - * @param string $type years, months, weeks, days (y|m|w|d) |
|
| 315 | - * @return int time in seconds |
|
| 316 | - * @access protected |
|
| 317 | - */ |
|
| 311 | + * Calculate the time in seconds based on requested time period length |
|
| 312 | + * |
|
| 313 | + * @param int $length user entered value |
|
| 314 | + * @param string $type years, months, weeks, days (y|m|w|d) |
|
| 315 | + * @return int time in seconds |
|
| 316 | + * @access protected |
|
| 317 | + */ |
|
| 318 | 318 | protected function set_pst_time($length, $type = 'y') |
| 319 | 319 | { |
| 320 | 320 | $type = isset($this->times[$type]) ? $type : 'y'; |
@@ -323,24 +323,24 @@ discard block |
||
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | /** |
| 326 | - * Get the correct time period length value for the form |
|
| 327 | - * |
|
| 328 | - * @param int $time as a timestamp |
|
| 329 | - * @param string $type years, months, weeks, days (y|m|w|d) |
|
| 330 | - * @return int time converted to the given $type |
|
| 331 | - * @access protected |
|
| 332 | - */ |
|
| 326 | + * Get the correct time period length value for the form |
|
| 327 | + * |
|
| 328 | + * @param int $time as a timestamp |
|
| 329 | + * @param string $type years, months, weeks, days (y|m|w|d) |
|
| 330 | + * @return int time converted to the given $type |
|
| 331 | + * @access protected |
|
| 332 | + */ |
|
| 333 | 333 | protected function get_pst_time($time, $type = '') |
| 334 | 334 | { |
| 335 | 335 | return isset($this->times[$type]) ? (int) round($time / $this->times[$type]) : 0; |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | /** |
| 339 | - * Check for FULLTEXT index support |
|
| 340 | - * |
|
| 341 | - * @return bool True if FULLTEXT is fully supported, false otherwise |
|
| 342 | - * @access protected |
|
| 343 | - */ |
|
| 339 | + * Check for FULLTEXT index support |
|
| 340 | + * |
|
| 341 | + * @return bool True if FULLTEXT is fully supported, false otherwise |
|
| 342 | + * @access protected |
|
| 343 | + */ |
|
| 344 | 344 | protected function fulltext_support_enabled() |
| 345 | 345 | { |
| 346 | 346 | if ($this->fulltext->is_supported()) |
@@ -352,11 +352,11 @@ discard block |
||
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | /** |
| 355 | - * Enable FULLTEXT support for the topic_title |
|
| 356 | - * |
|
| 357 | - * @return null |
|
| 358 | - * @access protected |
|
| 359 | - */ |
|
| 355 | + * Enable FULLTEXT support for the topic_title |
|
| 356 | + * |
|
| 357 | + * @return null |
|
| 358 | + * @access protected |
|
| 359 | + */ |
|
| 360 | 360 | protected function enable_fulltext_support() |
| 361 | 361 | { |
| 362 | 362 | if (!$this->fulltext->is_mysql()) |
@@ -379,13 +379,13 @@ discard block |
||
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | /** |
| 382 | - * Return a variable if it is set, otherwise default |
|
| 383 | - * |
|
| 384 | - * @param mixed $var The variable to test |
|
| 385 | - * @param mixed $default The default value to use |
|
| 386 | - * @return mixed The value of the variable if set, otherwise default value |
|
| 387 | - * @access protected |
|
| 388 | - */ |
|
| 382 | + * Return a variable if it is set, otherwise default |
|
| 383 | + * |
|
| 384 | + * @param mixed $var The variable to test |
|
| 385 | + * @param mixed $default The default value to use |
|
| 386 | + * @return mixed The value of the variable if set, otherwise default value |
|
| 387 | + * @access protected |
|
| 388 | + */ |
|
| 389 | 389 | protected function isset_or_default($var, $default) |
| 390 | 390 | { |
| 391 | 391 | return (isset($var)) ? $var : $default; |
@@ -21,23 +21,23 @@ discard block |
||
| 21 | 21 | protected $similar_topics; |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | - * Constructor |
|
| 25 | - * |
|
| 26 | - * @param \vse\similartopics\core\similar_topics $similar_topics |
|
| 27 | - * @access public |
|
| 28 | - */ |
|
| 24 | + * Constructor |
|
| 25 | + * |
|
| 26 | + * @param \vse\similartopics\core\similar_topics $similar_topics |
|
| 27 | + * @access public |
|
| 28 | + */ |
|
| 29 | 29 | public function __construct(\vse\similartopics\core\similar_topics $similar_topics) |
| 30 | 30 | { |
| 31 | 31 | $this->similar_topics = $similar_topics; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * Assign functions defined in this class to event listeners in the core |
|
| 36 | - * |
|
| 37 | - * @return array |
|
| 38 | - * @static |
|
| 39 | - * @access public |
|
| 40 | - */ |
|
| 35 | + * Assign functions defined in this class to event listeners in the core |
|
| 36 | + * |
|
| 37 | + * @return array |
|
| 38 | + * @static |
|
| 39 | + * @access public |
|
| 40 | + */ |
|
| 41 | 41 | static public function getSubscribedEvents() |
| 42 | 42 | { |
| 43 | 43 | return array( |
@@ -47,12 +47,12 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | - * Display similar topics |
|
| 51 | - * |
|
| 52 | - * @param object $event The event object |
|
| 53 | - * @return null |
|
| 54 | - * @access public |
|
| 55 | - */ |
|
| 50 | + * Display similar topics |
|
| 51 | + * |
|
| 52 | + * @param object $event The event object |
|
| 53 | + * @return null |
|
| 54 | + * @access public |
|
| 55 | + */ |
|
| 56 | 56 | public function display_similar_topics($event) |
| 57 | 57 | { |
| 58 | 58 | // Return early if no reason to display similar topics |
@@ -65,12 +65,12 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | - * Add custom permissions language variables |
|
| 69 | - * |
|
| 70 | - * @param object $event The event object |
|
| 71 | - * @return null |
|
| 72 | - * @access public |
|
| 73 | - */ |
|
| 68 | + * Add custom permissions language variables |
|
| 69 | + * |
|
| 70 | + * @param object $event The event object |
|
| 71 | + * @return null |
|
| 72 | + * @access public |
|
| 73 | + */ |
|
| 74 | 74 | public function add_permissions($event) |
| 75 | 75 | { |
| 76 | 76 | $permissions = $event['permissions']; |
@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | - * Add a FULLTEXT index to phpbb_topics.topic_title |
|
| 67 | - */ |
|
| 66 | + * Add a FULLTEXT index to phpbb_topics.topic_title |
|
| 67 | + */ |
|
| 68 | 68 | public function add_topic_title_fulltext() |
| 69 | 69 | { |
| 70 | 70 | $fulltext = $this->get_fulltext(); |
@@ -78,8 +78,8 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | - * Drop the FULLTEXT index on phpbb_topics.topic_title |
|
| 82 | - */ |
|
| 81 | + * Drop the FULLTEXT index on phpbb_topics.topic_title |
|
| 82 | + */ |
|
| 83 | 83 | public function drop_topic_title_fulltext() |
| 84 | 84 | { |
| 85 | 85 | $fulltext = $this->get_fulltext(); |
@@ -93,10 +93,10 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | - * Get an instance of the fulltext class |
|
| 97 | - * |
|
| 98 | - * @return \vse\similartopics\core\fulltext_support |
|
| 99 | - */ |
|
| 96 | + * Get an instance of the fulltext class |
|
| 97 | + * |
|
| 98 | + * @return \vse\similartopics\core\fulltext_support |
|
| 99 | + */ |
|
| 100 | 100 | public function get_fulltext() |
| 101 | 101 | { |
| 102 | 102 | return new \vse\similartopics\core\fulltext_support($this->db); |
@@ -40,9 +40,9 @@ |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | - * Drop the FULLTEXT index on phpbb_topics.topic_title |
|
| 44 | - * Convert phpbb_topics back to the original storage engine |
|
| 45 | - */ |
|
| 43 | + * Drop the FULLTEXT index on phpbb_topics.topic_title |
|
| 44 | + * Convert phpbb_topics back to the original storage engine |
|
| 45 | + */ |
|
| 46 | 46 | public function revert_fulltext_changes() |
| 47 | 47 | { |
| 48 | 48 | $fulltext = new \vse\similartopics\core\fulltext_support($this->db); |
@@ -19,31 +19,31 @@ discard block |
||
| 19 | 19 | protected $engine; |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | - * Constructor |
|
| 23 | - * |
|
| 24 | - * @param \phpbb\db\driver\driver_interface |
|
| 25 | - * @access public |
|
| 26 | - */ |
|
| 22 | + * Constructor |
|
| 23 | + * |
|
| 24 | + * @param \phpbb\db\driver\driver_interface |
|
| 25 | + * @access public |
|
| 26 | + */ |
|
| 27 | 27 | public function __construct(\phpbb\db\driver\driver_interface $db) |
| 28 | 28 | { |
| 29 | 29 | $this->db = $db; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | - * Check if the database is using MySQL |
|
| 34 | - * |
|
| 35 | - * @return bool True if is mysql, false otherwise |
|
| 36 | - */ |
|
| 33 | + * Check if the database is using MySQL |
|
| 34 | + * |
|
| 35 | + * @return bool True if is mysql, false otherwise |
|
| 36 | + */ |
|
| 37 | 37 | public function is_mysql() |
| 38 | 38 | { |
| 39 | 39 | return ($this->db->get_sql_layer() == 'mysql4' || $this->db->get_sql_layer() == 'mysqli'); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | - * Check for FULLTEXT index support |
|
| 44 | - * |
|
| 45 | - * @return bool True if FULLTEXT is supported, false otherwise |
|
| 46 | - */ |
|
| 43 | + * Check for FULLTEXT index support |
|
| 44 | + * |
|
| 45 | + * @return bool True if FULLTEXT is supported, false otherwise |
|
| 46 | + */ |
|
| 47 | 47 | public function is_supported() |
| 48 | 48 | { |
| 49 | 49 | // FULLTEXT is supported on InnoDB since MySQL 5.6.4 according to |
@@ -52,20 +52,20 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | - * Get the database storage engine name |
|
| 56 | - * |
|
| 57 | - * @return string The storage engine name |
|
| 58 | - */ |
|
| 55 | + * Get the database storage engine name |
|
| 56 | + * |
|
| 57 | + * @return string The storage engine name |
|
| 58 | + */ |
|
| 59 | 59 | public function get_engine() |
| 60 | 60 | { |
| 61 | 61 | return (isset($this->engine)) ? $this->engine : $this->set_engine(); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | - * Set the database storage engine name |
|
| 66 | - * |
|
| 67 | - * @return string The storage engine name |
|
| 68 | - */ |
|
| 65 | + * Set the database storage engine name |
|
| 66 | + * |
|
| 67 | + * @return string The storage engine name |
|
| 68 | + */ |
|
| 69 | 69 | public function set_engine() |
| 70 | 70 | { |
| 71 | 71 | $this->engine = ''; |
@@ -90,11 +90,11 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | - * Check if a field is a FULLTEXT index |
|
| 94 | - * |
|
| 95 | - * @param string $field name of a field |
|
| 96 | - * @return bool True if field is a FULLTEXT index, false otherwise |
|
| 97 | - */ |
|
| 93 | + * Check if a field is a FULLTEXT index |
|
| 94 | + * |
|
| 95 | + * @param string $field name of a field |
|
| 96 | + * @return bool True if field is a FULLTEXT index, false otherwise |
|
| 97 | + */ |
|
| 98 | 98 | public function index($field = 'topic_title') |
| 99 | 99 | { |
| 100 | 100 | $sql = 'SHOW INDEX |
@@ -87,11 +87,11 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | - * Is similar topics available? |
|
| 91 | - * |
|
| 92 | - * @return bool True if available, false otherwise |
|
| 93 | - * @access public |
|
| 94 | - */ |
|
| 90 | + * Is similar topics available? |
|
| 91 | + * |
|
| 92 | + * @return bool True if available, false otherwise |
|
| 93 | + * @access public |
|
| 94 | + */ |
|
| 95 | 95 | public function is_available() |
| 96 | 96 | { |
| 97 | 97 | return !empty($this->config['similar_topics']) && // is enabled |
@@ -103,29 +103,29 @@ discard block |
||
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | - * Is the forum available for displaying similar topics |
|
| 107 | - * |
|
| 108 | - * @param int $forum_id A forum identifier |
|
| 109 | - * @return bool True if available, false otherwise |
|
| 110 | - * @access public |
|
| 111 | - */ |
|
| 106 | + * Is the forum available for displaying similar topics |
|
| 107 | + * |
|
| 108 | + * @param int $forum_id A forum identifier |
|
| 109 | + * @return bool True if available, false otherwise |
|
| 110 | + * @access public |
|
| 111 | + */ |
|
| 112 | 112 | public function forum_available($forum_id) |
| 113 | 113 | { |
| 114 | 114 | return !in_array($forum_id, explode(',', $this->config['similar_topics_hide'])); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
| 118 | - * Get similar topics by matching topic titles |
|
| 119 | - * |
|
| 120 | - * NOTE: Currently requires MySQL due to the use of FULLTEXT indexes |
|
| 121 | - * and MATCH and AGAINST and UNIX_TIMESTAMP. MySQL FULLTEXT has built-in |
|
| 122 | - * English ignore words. We use phpBB's ignore words for non-English |
|
| 123 | - * languages. We also remove any admin-defined special ignore words. |
|
| 124 | - * |
|
| 125 | - * @param array $topic_data Array with topic data |
|
| 126 | - * @return null |
|
| 127 | - * @access public |
|
| 128 | - */ |
|
| 118 | + * Get similar topics by matching topic titles |
|
| 119 | + * |
|
| 120 | + * NOTE: Currently requires MySQL due to the use of FULLTEXT indexes |
|
| 121 | + * and MATCH and AGAINST and UNIX_TIMESTAMP. MySQL FULLTEXT has built-in |
|
| 122 | + * English ignore words. We use phpBB's ignore words for non-English |
|
| 123 | + * languages. We also remove any admin-defined special ignore words. |
|
| 124 | + * |
|
| 125 | + * @param array $topic_data Array with topic data |
|
| 126 | + * @return null |
|
| 127 | + * @access public |
|
| 128 | + */ |
|
| 129 | 129 | public function display_similar_topics($topic_data) |
| 130 | 130 | { |
| 131 | 131 | $topic_title = $this->clean_topic_title($topic_data['topic_title']); |
@@ -203,12 +203,12 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | /** |
| 206 | - * Event to modify the sql_array for similar topics |
|
| 207 | - * |
|
| 208 | - * @event vse.similartopics.get_topic_data |
|
| 209 | - * @var array sql_array SQL array to get similar topics data |
|
| 210 | - * @since 1.3.0 |
|
| 211 | - */ |
|
| 206 | + * Event to modify the sql_array for similar topics |
|
| 207 | + * |
|
| 208 | + * @event vse.similartopics.get_topic_data |
|
| 209 | + * @var array sql_array SQL array to get similar topics data |
|
| 210 | + * @since 1.3.0 |
|
| 211 | + */ |
|
| 212 | 212 | $vars = array('sql_array'); |
| 213 | 213 | extract($this->dispatcher->trigger_event('vse.similartopics.get_topic_data', compact($vars))); |
| 214 | 214 | |
@@ -296,13 +296,13 @@ discard block |
||
| 296 | 296 | ); |
| 297 | 297 | |
| 298 | 298 | /** |
| 299 | - * Event to modify the similar topics template block |
|
| 300 | - * |
|
| 301 | - * @event vse.similartopics.modify_topicrow |
|
| 302 | - * @var array row Array with similar topic data |
|
| 303 | - * @var array topic_row Template block array |
|
| 304 | - * @since 1.3.0 |
|
| 305 | - */ |
|
| 299 | + * Event to modify the similar topics template block |
|
| 300 | + * |
|
| 301 | + * @event vse.similartopics.modify_topicrow |
|
| 302 | + * @var array row Array with similar topic data |
|
| 303 | + * @var array topic_row Template block array |
|
| 304 | + * @since 1.3.0 |
|
| 305 | + */ |
|
| 306 | 306 | $vars = array('row', 'topic_row'); |
| 307 | 307 | extract($this->dispatcher->trigger_event('vse.similartopics.modify_topicrow', compact($vars))); |
| 308 | 308 | |
@@ -327,12 +327,12 @@ discard block |
||
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | /** |
| 330 | - * Clean topic title (and if needed, ignore-words) |
|
| 331 | - * |
|
| 332 | - * @param string $text The topic title |
|
| 333 | - * @return string The topic title |
|
| 334 | - * @access public |
|
| 335 | - */ |
|
| 330 | + * Clean topic title (and if needed, ignore-words) |
|
| 331 | + * |
|
| 332 | + * @param string $text The topic title |
|
| 333 | + * @return string The topic title |
|
| 334 | + * @access public |
|
| 335 | + */ |
|
| 336 | 336 | public function clean_topic_title($text) |
| 337 | 337 | { |
| 338 | 338 | // Strip quotes, ampersands |
@@ -347,12 +347,12 @@ discard block |
||
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | /** |
| 350 | - * Remove any non-english and/or custom defined ignore-words |
|
| 351 | - * |
|
| 352 | - * @param string $text The topic title |
|
| 353 | - * @return string The topic title |
|
| 354 | - * @access protected |
|
| 355 | - */ |
|
| 350 | + * Remove any non-english and/or custom defined ignore-words |
|
| 351 | + * |
|
| 352 | + * @param string $text The topic title |
|
| 353 | + * @return string The topic title |
|
| 354 | + * @access protected |
|
| 355 | + */ |
|
| 356 | 356 | protected function strip_stop_words($text) |
| 357 | 357 | { |
| 358 | 358 | $words = array(); |
@@ -380,12 +380,12 @@ discard block |
||
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | /** |
| 383 | - * Helper function to split string into an array of words |
|
| 384 | - * |
|
| 385 | - * @param string $text String of plain text words |
|
| 386 | - * @return array Array of plaintext words |
|
| 387 | - * @access protected |
|
| 388 | - */ |
|
| 383 | + * Helper function to split string into an array of words |
|
| 384 | + * |
|
| 385 | + * @param string $text String of plain text words |
|
| 386 | + * @return array Array of plaintext words |
|
| 387 | + * @access protected |
|
| 388 | + */ |
|
| 389 | 389 | protected function make_word_array($text) |
| 390 | 390 | { |
| 391 | 391 | // Strip out any non-alpha-numeric characters using PCRE regex syntax |
@@ -405,33 +405,33 @@ discard block |
||
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | /** |
| 408 | - * Check if English is the current user's language |
|
| 409 | - * |
|
| 410 | - * @return bool True if lang is 'en' or 'en_us', false otherwise |
|
| 411 | - * @access protected |
|
| 412 | - */ |
|
| 408 | + * Check if English is the current user's language |
|
| 409 | + * |
|
| 410 | + * @return bool True if lang is 'en' or 'en_us', false otherwise |
|
| 411 | + * @access protected |
|
| 412 | + */ |
|
| 413 | 413 | protected function english_lang() |
| 414 | 414 | { |
| 415 | 415 | return ($this->user->lang_name == 'en' || $this->user->lang_name == 'en_us'); |
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | /** |
| 419 | - * Check if custom ignore words have been defined for similar topics |
|
| 420 | - * |
|
| 421 | - * @return bool True or false |
|
| 422 | - * @access protected |
|
| 423 | - */ |
|
| 419 | + * Check if custom ignore words have been defined for similar topics |
|
| 420 | + * |
|
| 421 | + * @return bool True or false |
|
| 422 | + * @access protected |
|
| 423 | + */ |
|
| 424 | 424 | protected function has_ignore_words() |
| 425 | 425 | { |
| 426 | 426 | return !empty($this->config['similar_topics_words']); |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | /** |
| 430 | - * Check if the database layer is MySQL4 or later |
|
| 431 | - * |
|
| 432 | - * @return bool True is MySQL4 or later, false otherwise |
|
| 433 | - * @access protected |
|
| 434 | - */ |
|
| 430 | + * Check if the database layer is MySQL4 or later |
|
| 431 | + * |
|
| 432 | + * @return bool True is MySQL4 or later, false otherwise |
|
| 433 | + * @access protected |
|
| 434 | + */ |
|
| 435 | 435 | protected function is_mysql() |
| 436 | 436 | { |
| 437 | 437 | return ($this->db->get_sql_layer() == 'mysql4' || $this->db->get_sql_layer() == 'mysqli'); |
@@ -57,12 +57,12 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | - * Assign functions defined in this class to event listeners in the core |
|
| 61 | - * |
|
| 62 | - * @return array |
|
| 63 | - * @static |
|
| 64 | - * @access public |
|
| 65 | - */ |
|
| 60 | + * Assign functions defined in this class to event listeners in the core |
|
| 61 | + * |
|
| 62 | + * @return array |
|
| 63 | + * @static |
|
| 64 | + * @access public |
|
| 65 | + */ |
|
| 66 | 66 | static public function getSubscribedEvents() |
| 67 | 67 | { |
| 68 | 68 | return array( |
@@ -72,12 +72,12 @@ discard block |
||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
| 75 | - * Get user's Similar Topics option and display it in UCP Prefs View page |
|
| 76 | - * |
|
| 77 | - * @param object $event The event object |
|
| 78 | - * @return null |
|
| 79 | - * @access public |
|
| 80 | - */ |
|
| 75 | + * Get user's Similar Topics option and display it in UCP Prefs View page |
|
| 76 | + * |
|
| 77 | + * @param object $event The event object |
|
| 78 | + * @return null |
|
| 79 | + * @access public |
|
| 80 | + */ |
|
| 81 | 81 | public function ucp_prefs_get_data($event) |
| 82 | 82 | { |
| 83 | 83 | // Request the user option vars and add them to the data array |
@@ -97,12 +97,12 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
| 100 | - * Add user's Similar Topics option state into the sql_array |
|
| 101 | - * |
|
| 102 | - * @param object $event The event object |
|
| 103 | - * @return null |
|
| 104 | - * @access public |
|
| 105 | - */ |
|
| 100 | + * Add user's Similar Topics option state into the sql_array |
|
| 101 | + * |
|
| 102 | + * @param object $event The event object |
|
| 103 | + * @return null |
|
| 104 | + * @access public |
|
| 105 | + */ |
|
| 106 | 106 | public function ucp_prefs_set_data($event) |
| 107 | 107 | { |
| 108 | 108 | $event['sql_ary'] = array_merge($event['sql_ary'], array( |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * |
|
| 4 | - * Precise Similar Topics |
|
| 5 | - * |
|
| 6 | - * @copyright (c) 2015 Matt Friedman |
|
| 7 | - * @license GNU General Public License, version 2 (GPL-2.0) |
|
| 8 | - * |
|
| 9 | - */ |
|
| 3 | + * |
|
| 4 | + * Precise Similar Topics |
|
| 5 | + * |
|
| 6 | + * @copyright (c) 2015 Matt Friedman |
|
| 7 | + * @license GNU General Public License, version 2 (GPL-2.0) |
|
| 8 | + * |
|
| 9 | + */ |
|
| 10 | 10 | |
| 11 | 11 | namespace vse\similartopics; |
| 12 | 12 | |