@@ -105,8 +105,7 @@ |
||
| 105 | 105 | if ($event['folder_id'] == PRIVMSGS_OUTBOX) |
| 106 | 106 | { |
| 107 | 107 | $this->fulltext_search->index_remove($event['msg_ids']); |
| 108 | - } |
|
| 109 | - else |
|
| 108 | + } else |
|
| 110 | 109 | { |
| 111 | 110 | $sql = 'SELECT COUNT(msg_id) as count, msg_id |
| 112 | 111 | FROM ' . PRIVMSGS_TO_TABLE . ' |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | $this->search_helper = $phpbb_container->get('anavaro.pmsearch.search.helper'); |
| 31 | 31 | |
| 32 | - switch($mode) |
|
| 32 | + switch ($mode) |
|
| 33 | 33 | { |
| 34 | 34 | default: |
| 35 | 35 | //Let's see indexing |
@@ -55,14 +55,14 @@ discard block |
||
| 55 | 55 | { |
| 56 | 56 | $config->set('pmsearch_search', 1); |
| 57 | 57 | } |
| 58 | - $this->tpl_name = 'acp_pmsearch'; |
|
| 59 | - $this->page_title = 'PMSEARCH_ADMIN'; |
|
| 58 | + $this->tpl_name = 'acp_pmsearch'; |
|
| 59 | + $this->page_title = 'PMSEARCH_ADMIN'; |
|
| 60 | 60 | |
| 61 | 61 | $template->assign_var('PM_INDEX', $config['pmsearch_pm_index']); |
| 62 | 62 | $template->assign_var('PM_SEARCH', $config['pmsearch_search']); |
| 63 | - $template->assign_var('U_ACTION', append_sid("index.php?i=".$id."&mode=".$mode)); |
|
| 63 | + $template->assign_var('U_ACTION', append_sid("index.php?i=" . $id . "&mode=" . $mode)); |
|
| 64 | 64 | |
| 65 | - if($config['pmsearch_pm_index']) |
|
| 65 | + if ($config['pmsearch_pm_index']) |
|
| 66 | 66 | { |
| 67 | 67 | $action_index = $request->variable('action_index', ''); |
| 68 | 68 | $this->state = explode(',', $config['search_pm_indexing_state']); |
@@ -38,8 +38,7 @@ discard block |
||
| 38 | 38 | if ($pm_index == '1') |
| 39 | 39 | { |
| 40 | 40 | $config->set('pmsearch_pm_index', 0); |
| 41 | - } |
|
| 42 | - else if ($pm_index == '2') |
|
| 41 | + } else if ($pm_index == '2') |
|
| 43 | 42 | { |
| 44 | 43 | $config->set('pmsearch_pm_index', 1); |
| 45 | 44 | } |
@@ -50,8 +49,7 @@ discard block |
||
| 50 | 49 | if ($pm_search == '1') |
| 51 | 50 | { |
| 52 | 51 | $config->set('pmsearch_search', 0); |
| 53 | - } |
|
| 54 | - else if ($pm_index == '2') |
|
| 52 | + } else if ($pm_index == '2') |
|
| 55 | 53 | { |
| 56 | 54 | $config->set('pmsearch_search', 1); |
| 57 | 55 | } |
@@ -177,8 +175,7 @@ discard block |
||
| 177 | 175 | $this->save_state(); |
| 178 | 176 | meta_refresh(1, append_sid($this->u_action . '&action_index=create&skip_rows=' . $post_counter)); |
| 179 | 177 | trigger_error($user->lang('SEARCH_INDEX_CREATE_REDIRECT', (int) $row_count, $post_counter) . $user->lang('SEARCH_INDEX_CREATE_REDIRECT_RATE', $rows_per_second)); |
| 180 | - } |
|
| 181 | - else |
|
| 178 | + } else |
|
| 182 | 179 | { |
| 183 | 180 | $this->state = array(''); |
| 184 | 181 | add_log('admin', 'LOG_PMSEARCH_INDEX_CREATED', $name); |
@@ -214,8 +211,7 @@ discard block |
||
| 214 | 211 | if ($n && sizeof($statistics[$n - 1]) < 3) |
| 215 | 212 | { |
| 216 | 213 | $statistics[$n - 1] += array('statistic_2' => $statistic, 'value_2' => $value); |
| 217 | - } |
|
| 218 | - else |
|
| 214 | + } else |
|
| 219 | 215 | { |
| 220 | 216 | $statistics[] = array('statistic_1' => $statistic, 'value_1' => $value); |
| 221 | 217 | } |
@@ -219,8 +219,8 @@ discard block |
||
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | // Handle +, - without preceeding whitespace character |
| 222 | - $match = array('#(\S)\+#', '#(\S)-#'); |
|
| 223 | - $replace = array('$1 +', '$1 +'); |
|
| 222 | + $match = array('#(\S)\+#', '#(\S)-#'); |
|
| 223 | + $replace = array('$1 +', '$1 +'); |
|
| 224 | 224 | |
| 225 | 225 | $keywords = preg_replace($match, $replace, $keywords); |
| 226 | 226 | |
@@ -913,7 +913,7 @@ discard block |
||
| 913 | 913 | |
| 914 | 914 | if (sizeof($title_word_ids)) |
| 915 | 915 | { |
| 916 | - $sql = 'UPDATE ' . PRIVMSGS_TABLE . '_swl' . ' |
|
| 916 | + $sql = 'UPDATE ' . PRIVMSGS_TABLE . '_swl' . ' |
|
| 917 | 917 | SET word_count = word_count - 1 |
| 918 | 918 | WHERE ' . $this->db->sql_in_set('word_id', $title_word_ids) . ' |
| 919 | 919 | AND word_count > 0'; |
@@ -1070,8 +1070,8 @@ discard block |
||
| 1070 | 1070 | |
| 1071 | 1071 | protected function get_stats() |
| 1072 | 1072 | { |
| 1073 | - $this->stats['total_words'] = $this->db->get_estimated_row_count(PRIVMSGS_TABLE . '_swl'); |
|
| 1074 | - $this->stats['total_matches'] = $this->db->get_estimated_row_count(PRIVMSGS_TABLE . '_swm'); |
|
| 1073 | + $this->stats['total_words'] = $this->db->get_estimated_row_count(PRIVMSGS_TABLE . '_swl'); |
|
| 1074 | + $this->stats['total_matches'] = $this->db->get_estimated_row_count(PRIVMSGS_TABLE . '_swm'); |
|
| 1075 | 1075 | } |
| 1076 | 1076 | |
| 1077 | 1077 | /** |
@@ -1103,7 +1103,7 @@ discard block |
||
| 1103 | 1103 | $messages_to_table => 'mt', |
| 1104 | 1104 | ), |
| 1105 | 1105 | |
| 1106 | - 'WHERE' => 'msg.msg_id = mt.msg_id AND (((msg.author_id = ' . $this->user->data['user_id'] . ' AND msg.to_address LIKE \'u_' . $target_id .'\') OR (msg.author_id = ' . $target_id . ' AND msg.to_address LIKE \'u_' . $this->user->data['user_id'] .'\')) AND mt.user_id = ' . $this->user->data['user_id'] . ')', |
|
| 1106 | + 'WHERE' => 'msg.msg_id = mt.msg_id AND (((msg.author_id = ' . $this->user->data['user_id'] . ' AND msg.to_address LIKE \'u_' . $target_id . '\') OR (msg.author_id = ' . $target_id . ' AND msg.to_address LIKE \'u_' . $this->user->data['user_id'] . '\')) AND mt.user_id = ' . $this->user->data['user_id'] . ')', |
|
| 1107 | 1107 | |
| 1108 | 1108 | ); |
| 1109 | 1109 | |
@@ -112,8 +112,7 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | break; |
| 114 | 114 | } |
| 115 | - } |
|
| 116 | - else |
|
| 115 | + } else |
|
| 117 | 116 | { |
| 118 | 117 | switch ($keywords[$i]) |
| 119 | 118 | { |
@@ -290,13 +289,11 @@ discard block |
||
| 290 | 289 | { |
| 291 | 290 | $id_words[] = '\'' . $this->db->sql_escape(str_replace('*', '%', $word_part)) . '\''; |
| 292 | 291 | $non_common_words[] = $word_part; |
| 293 | - } |
|
| 294 | - else if (isset($words[$word_part])) |
|
| 292 | + } else if (isset($words[$word_part])) |
|
| 295 | 293 | { |
| 296 | 294 | $id_words[] = $words[$word_part]; |
| 297 | 295 | $non_common_words[] = $word_part; |
| 298 | - } |
|
| 299 | - else |
|
| 296 | + } else |
|
| 300 | 297 | { |
| 301 | 298 | $len = utf8_strlen($word_part); |
| 302 | 299 | if ($len < $this->word_length['min'] || $len > $this->word_length['max']) |
@@ -311,8 +308,7 @@ discard block |
||
| 311 | 308 | if (sizeof($id_words) > 1) |
| 312 | 309 | { |
| 313 | 310 | $this->{$mode . '_ids'}[] = $id_words; |
| 314 | - } |
|
| 315 | - else |
|
| 311 | + } else |
|
| 316 | 312 | { |
| 317 | 313 | $mode = ($mode == 'must_exclude_one') ? 'must_not_contain' : $mode; |
| 318 | 314 | $this->{$mode . '_ids'}[] = $id_words[0]; |
@@ -334,18 +330,15 @@ discard block |
||
| 334 | 330 | if ($len >= $this->word_length['min'] && $len <= $this->word_length['max']) |
| 335 | 331 | { |
| 336 | 332 | $this->{$mode . '_ids'}[] = '\'' . $this->db->sql_escape(str_replace('*', '%', $word)) . '\''; |
| 337 | - } |
|
| 338 | - else |
|
| 333 | + } else |
|
| 339 | 334 | { |
| 340 | 335 | $this->common_words[] = $word; |
| 341 | 336 | } |
| 342 | - } |
|
| 343 | - else |
|
| 337 | + } else |
|
| 344 | 338 | { |
| 345 | 339 | $this->{$mode . '_ids'}[] = $words[$word]; |
| 346 | 340 | } |
| 347 | - } |
|
| 348 | - else |
|
| 341 | + } else |
|
| 349 | 342 | { |
| 350 | 343 | if (!isset($common_ids[$word])) |
| 351 | 344 | { |
@@ -496,8 +489,7 @@ discard block |
||
| 496 | 489 | $word_ids[] = "w$w_num.word_id"; |
| 497 | 490 | |
| 498 | 491 | $w_num++; |
| 499 | - } |
|
| 500 | - else |
|
| 492 | + } else |
|
| 501 | 493 | { |
| 502 | 494 | $word_ids[] = $id; |
| 503 | 495 | } |
@@ -507,8 +499,7 @@ discard block |
||
| 507 | 499 | |
| 508 | 500 | unset($word_id_sql); |
| 509 | 501 | unset($word_ids); |
| 510 | - } |
|
| 511 | - else if (is_string($subquery)) |
|
| 502 | + } else if (is_string($subquery)) |
|
| 512 | 503 | { |
| 513 | 504 | $sql_array['FROM'][$swl_table][] = 'w' . $w_num; |
| 514 | 505 | |
@@ -517,8 +508,7 @@ discard block |
||
| 517 | 508 | |
| 518 | 509 | $group_by = true; |
| 519 | 510 | $w_num++; |
| 520 | - } |
|
| 521 | - else |
|
| 511 | + } else |
|
| 522 | 512 | { |
| 523 | 513 | $sql_where[] = "m$m_num.word_id = $subquery"; |
| 524 | 514 | } |
@@ -771,8 +761,7 @@ discard block |
||
| 771 | 761 | $words['add']['title'] = array_diff($split_title, array_keys($cur_words['title'])); |
| 772 | 762 | $words['del']['post'] = array_diff(array_keys($cur_words['post']), $split_text); |
| 773 | 763 | $words['del']['title'] = array_diff(array_keys($cur_words['title']), $split_title); |
| 774 | - } |
|
| 775 | - else |
|
| 764 | + } else |
|
| 776 | 765 | { |
| 777 | 766 | $words['add']['post'] = $split_text; |
| 778 | 767 | $words['add']['title'] = $split_title; |
@@ -818,8 +807,7 @@ discard block |
||
| 818 | 807 | $this->db->sql_return_on_error(false); |
| 819 | 808 | } |
| 820 | 809 | unset($new_words, $sql_ary); |
| 821 | - } |
|
| 822 | - else |
|
| 810 | + } else |
|
| 823 | 811 | { |
| 824 | 812 | $this->db->sql_transaction('begin'); |
| 825 | 813 | } |
@@ -902,8 +890,7 @@ discard block |
||
| 902 | 890 | if ($row['title_match']) |
| 903 | 891 | { |
| 904 | 892 | $title_word_ids[] = $row['word_id']; |
| 905 | - } |
|
| 906 | - else |
|
| 893 | + } else |
|
| 907 | 894 | { |
| 908 | 895 | $message_word_ids[] = $row['word_id']; |
| 909 | 896 | } |
@@ -35,9 +35,9 @@ discard block |
||
| 35 | 35 | switch ($mode) |
| 36 | 36 | { |
| 37 | 37 | case 'search': |
| 38 | - $this->tpl_name = 'ucp_pmsearch'; |
|
| 38 | + $this->tpl_name = 'ucp_pmsearch'; |
|
| 39 | 39 | $template->assign_vars(array( |
| 40 | - 'S_UCP_ACTION' => append_sid("ucp.php?i=".$id."&mode=".$mode) |
|
| 40 | + 'S_UCP_ACTION' => append_sid("ucp.php?i=" . $id . "&mode=" . $mode) |
|
| 41 | 41 | )); |
| 42 | 42 | |
| 43 | 43 | $terms = $request->variable('terms', 'any'); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $search_count = $this->search->user_search($keywords, $id_ary, $startFrom, $this->config['search_block_size']); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if ($search_count > 0 ) |
|
| 84 | + if ($search_count > 0) |
|
| 85 | 85 | { |
| 86 | 86 | // Let's get additional info |
| 87 | 87 | $page_array = array(); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $db->sql_freeresult($result); |
| 121 | 121 | // ... one for the authors on this page |
| 122 | 122 | $authors_array = array(); |
| 123 | - $sql = 'SELECT user_id, username, user_colour FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $author_uid_arrray); |
|
| 123 | + $sql = 'SELECT user_id, username, user_colour FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $author_uid_arrray); |
|
| 124 | 124 | $result = $db->sql_query($sql); |
| 125 | 125 | while ($row = $db->sql_fetchrow($result)) |
| 126 | 126 | { |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | 'SENT_TIME' => $user->format_date($VAR['msg_time']), |
| 141 | 141 | 'MESSAGE_AUTHOR_FULL' => ($authors_array[$VAR['msg_author']]['user_colour'] ? '<a href="./memberlist.php?mode=viewprofile&u=' . $VAR['msg_author'] . '" class="username-coloured" style="color: #' . $authors_array[$VAR['msg_author']]['user_colour'] . ';">' . $authors_array[$VAR['msg_author']]['username'] . '</a>' : '<a href="./memberlist.php?mode=viewprofile&u=' . $VAR['msg_author'] . '" class="username">' . $authors_array[$VAR['msg_author']]['username'] . '</a>'), |
| 142 | 142 | )); |
| 143 | - $count ++; |
|
| 143 | + $count++; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | $pagination = $phpbb_container->get('pagination'); |
@@ -65,8 +65,7 @@ discard block |
||
| 65 | 65 | //$search_count = $this->search->keyword_search('norma', 'all', 'all', array('msg_id' => 'a'), 'msg_id', 'd', 0, array($user_id), '', $id_ary, $startFrom, 25); |
| 66 | 66 | $search_count = $this->search->keyword_search('norma', 'all', 'all', array('msg_id' => 'a'), 'msg_id', 'd', 0, array(), '', '', $user_id, '', $id_ary, $startFrom, $this->config['search_block_size']); |
| 67 | 67 | |
| 68 | - } |
|
| 69 | - else |
|
| 68 | + } else |
|
| 70 | 69 | { |
| 71 | 70 | // So do we have user_id or username? |
| 72 | 71 | if (!is_numeric($keywords)) |
@@ -152,8 +151,7 @@ discard block |
||
| 152 | 151 | $template->assign_vars(array( |
| 153 | 152 | 'S_KEYWORDS' => $authors_array[$keywords]['username'] |
| 154 | 153 | )); |
| 155 | - } |
|
| 156 | - else |
|
| 154 | + } else |
|
| 157 | 155 | { |
| 158 | 156 | $template->assign_vars(array( |
| 159 | 157 | 'S_KEYWORDS' => $keywords |
@@ -164,9 +162,7 @@ discard block |
||
| 164 | 162 | 'TOTAL_MESSAGES' => $search_count, |
| 165 | 163 | 'HAS_RESULTS' => 1, |
| 166 | 164 | )); |
| 167 | - } |
|
| 168 | - |
|
| 169 | - else |
|
| 165 | + } else |
|
| 170 | 166 | { |
| 171 | 167 | trigger_error('NO_RESULTS_FOUND'); |
| 172 | 168 | } |