diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-08 12:23:04 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-08 12:23:04 +0000 |
commit | 2aaf2d80f1cbc2a6ad4a1b4b5ef97c3494d6a0bd (patch) | |
tree | 2c9eee36920ed0fed40c80f8f4b3976af4a6ae68 /mod/search/start.php | |
parent | 59b6967f1c2788331c8c56931d32b8afe3e0396c (diff) | |
download | elgg-2aaf2d80f1cbc2a6ad4a1b4b5ef97c3494d6a0bd.tar.gz elgg-2aaf2d80f1cbc2a6ad4a1b4b5ef97c3494d6a0bd.tar.bz2 |
updated search plugin for new html/css
git-svn-id: http://code.elgg.org/elgg/trunk@8075 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/search/start.php')
-rw-r--r-- | mod/search/start.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/mod/search/start.php b/mod/search/start.php index 4f57a64c5..401bf84a5 100644 --- a/mod/search/start.php +++ b/mod/search/start.php @@ -249,8 +249,8 @@ function search_highlight_words($words, $string) { $replace_html = array( 'strong' => rand(10000, 99999), 'class' => rand(10000, 99999), - 'searchMatch' => rand(10000, 99999), - 'searchMatchColor' => rand(10000, 99999) + 'search-highlight' => rand(10000, 99999), + 'search-highlight-color' => rand(10000, 99999) ); foreach ($words as $word) { @@ -262,16 +262,17 @@ function search_highlight_words($words, $string) { $search = "/($word)/i"; + // @todo // must replace with placeholders in case one of the search terms is // in the html string. // later, will replace the placeholders with the actual html. // Yeah this is hacky. I'm tired. $strong = $replace_html['strong']; $class = $replace_html['class']; - $searchMatch = $replace_html['searchMatch']; - $searchMatchColor = $replace_html['searchMatchColor']; + $highlight = $replace_html['search-highlight']; + $color = $replace_html['search-highlight-color']; - $replace = "<$strong $class=\"$searchMatch $searchMatchColor{$i}\">$1</$strong>"; + $replace = "<$strong $class=\"$highlight $color{$i}\">$1</$strong>"; $string = preg_replace($search, $replace, $string); $i++; } |