diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-07-27 16:43:51 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-07-27 16:43:51 +0000 |
commit | a2cd2c4de3cd147bf880663e7115a7cef46ae45f (patch) | |
tree | bc08b10b61e69b5b7158b67f2827ac85648f64c3 /phpBB/includes | |
parent | 789675c740b0870819d0823103fedba54b6b188d (diff) | |
download | forums-a2cd2c4de3cd147bf880663e7115a7cef46ae45f.tar forums-a2cd2c4de3cd147bf880663e7115a7cef46ae45f.tar.gz forums-a2cd2c4de3cd147bf880663e7115a7cef46ae45f.tar.bz2 forums-a2cd2c4de3cd147bf880663e7115a7cef46ae45f.tar.xz forums-a2cd2c4de3cd147bf880663e7115a7cef46ae45f.zip |
oops
git-svn-id: file:///svn/phpbb/trunk@2761 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/functions_posting.php | 84 |
1 files changed, 4 insertions, 80 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 32578370f1..1ab63294ad 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -816,9 +816,6 @@ function clean_words($mode, &$entry, &$stopword_list, &$synonym_list) $entry = str_replace('-', ' not ', $entry); } - // Replace numbers on their own - $entry = preg_replace('/\b[0-9]+\b/', ' ', $entry); - // // Filter out strange characters like ^, $, &, change "it's" to "its" // @@ -831,8 +828,8 @@ function clean_words($mode, &$entry, &$stopword_list, &$synonym_list) { $entry = str_replace('*', ' ', $entry); - // 'words' that consist of <=3 or >=25 characters are removed. - $entry = preg_replace('/\b([a-z0-9]{1,3}|[a-z0-9]{20,})\b/',' ', $entry); + // 'words' that consist of <=2 or >=20 characters are removed. + $entry = preg_replace('/\b([a-z0-9]{1,2}|[a-z0-9]{20,})\b/',' ', $entry); } if ( !empty($stopword_list) ) @@ -868,7 +865,7 @@ function split_words(&$entry, $mode = 'post') $match = ( $mode == 'post' ) ? '/\b(\w[\w\']*\w+|\w+?)\b/' : '/(\*?[\w]+\*?)|\b([\w]+)\b/'; preg_match_all($match, $entry, $split_entries); - return $split_entries[1]; + return array_unique($split_entries[1]); } function add_search_words($post_id, $post_text, $post_title = '') @@ -884,7 +881,7 @@ function add_search_words($post_id, $post_text, $post_title = '') $word = array(); $word_insert_sql = array(); - while ( list($word_in, $search_matches) = @each($search_raw_words) ) + foreach ( $search_raw_words as $word_in => $search_matches ) { $word_insert_sql[$word_in] = ''; if ( !empty($search_matches) ) @@ -1187,79 +1184,6 @@ function remove_search_post($post_id_sql) } // -// Username search -// -function username_search($search_match) -{ - global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path; - global $starttime, $gen_simple_header; - - $gen_simple_header = TRUE; - - $username_list = ''; - if ( !empty($search_match) ) - { - $username_search = preg_replace('/\*/', '%', trim(strip_tags($search_match))); - - $sql = "SELECT username - FROM " . USERS_TABLE . " - WHERE username LIKE '" . str_replace("\'", "''", $username_search) . "' - ORDER BY username"; - if ( !($result = $db->sql_query($sql)) ) - { - message_die(GENERAL_ERROR, 'Could not obtain search results', '', __LINE__, __FILE__, $sql); - } - - if ( $row = $db->sql_fetchrow($result) ) - { - do - { - $username_list .= '<option value="' . $row['username'] . '">' . $row['username'] . '</option>'; - } - while ( $row = $db->sql_fetchrow($result) ); - } - else - { - $username_list .= '<option>' . $lang['No_match']. '</option>'; - } - $db->sql_freeresult($result); - } - - $page_title = $lang['Search']; - include($phpbb_root_path . 'includes/page_header.'.$phpEx); - - $template->set_filenames(array( - 'search_user_body' => 'search_username.tpl') - ); - - $template->assign_vars(array( - 'USERNAME' => ( !empty($search_match) ) ? $search_match : '', - - 'L_CLOSE_WINDOW' => $lang['Close_window'], - 'L_SEARCH_USERNAME' => $lang['Find_username'], - 'L_UPDATE_USERNAME' => $lang['Select_username'], - 'L_SELECT' => $lang['Select'], - 'L_SEARCH' => $lang['Search'], - 'L_SEARCH_EXPLAIN' => $lang['Search_author_explain'], - 'L_CLOSE_WINDOW' => $lang['Close_window'], - - 'S_USERNAME_OPTIONS' => $username_list, - 'S_SEARCH_ACTION' => "search.$phpEx$SID&mode=searchuser") - ); - - if ( $username_list != '' ) - { - $template->assign_block_vars('switch_select_name', array()); - } - - $template->pparse('search_user_body'); - - include($phpbb_root_path . 'includes/page_tail.'.$phpEx); - - return; -} - -// // Fill smiley templates (or just the variables) with smileys // Either in a window or inline // |