]> git.wh0rd.org - tt-rss.git/commitdiff
support term highlighting in cdm title
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 31 Jul 2013 12:41:06 +0000 (16:41 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 31 Jul 2013 12:41:06 +0000 (16:41 +0400)
classes/feeds.php

index 874f767887a03421693b2fdc712e3d1de973d5ab..9aa75bbe8c460bba20481193efb7d0374b1364a7 100644 (file)
@@ -561,6 +561,13 @@ class Feeds extends Handler_Protected {
 
                                        $reply['content'] .= "</div>";
 
+                                       if ($highlight_words && count($highlight_words > 0)) {
+                                               foreach ($highlight_words as $word) {
+                                                       $line["title"] = preg_replace("/(\Q$word\E)/i",
+                                                               "<span class=\"highlight\">$1</span>", $line["title"]);
+                                               }
+                                       }
+
                                        $reply['content'] .= "<span id=\"RTITLE-$id\"
                                                onclick=\"return cdmClicked(event, $id);\"
                                                class=\"titleWrap $hlc_suffix\">