Browse Source

Add unread category to build-in Search

unread:{true,false} - match only unread or read articles
SkyREgit 9 years ago
parent
commit
95a95b0a40
1 changed files with 13 additions and 0 deletions
  1. 13 0
      include/functions2.php

+ 13 - 0
include/functions2.php

@@ -360,6 +360,19 @@
 					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%'))");
+					if (!$not) array_push($search_words, $k);
+				}
+				break;
 			default:
 				if (strpos($k, "@") === 0) {