]> git.wh0rd.org Git - tt-rss.git/commitdiff
Add unread category to build-in Search
authorSkyREgit <SkyREgit@users.noreply.github.com>
Thu, 5 Mar 2015 13:26:10 +0000 (15:26 +0200)
committerSkyREgit <SkyREgit@users.noreply.github.com>
Thu, 5 Mar 2015 13:26:10 +0000 (15:26 +0200)
unread:{true,false} - match only unread or read articles

include/functions2.php

index 6d02d01e0407cb3cefe354d636a339181d66d3dc..278c0f3eeba2d56e55b252ed7ac08823a6938932 100644 (file)
                                        else
                                                array_push($query_keywords, "($not (published = false))");
 
+                               } else {
+                                       array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%')
+                                                       OR UPPER(ttrss_entries.content) $not LIKE UPPER('%$k%'))");
+                                       if (!$not) array_push($search_words, $k);
+                               }
+                               break;
+                       case "unread":
+                               if ($commandpair[1]) {
+                                       if ($commandpair[1] == "true")
+                                               array_push($query_keywords, "($not (unread = true))");
+                                       else
+                                               array_push($query_keywords, "($not (unread = false))");
+
                                } else {
                                        array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%')
                                                        OR UPPER(ttrss_entries.content) $not LIKE UPPER('%$k%'))");