1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-25 10:41:29 +00:00

prefs: rudimentary multiple keyword search

This commit is contained in:
Andrew Dolgov
2009-10-07 15:12:21 +04:00
parent 4b67e71e7d
commit 1638fc4e13
4 changed files with 56 additions and 12 deletions

View File

@@ -1184,9 +1184,21 @@
$_SESSION["pref_sort_feeds"] = $feeds_sort;
if ($feed_search) {
$search_qpart = "(UPPER(F1.title) LIKE UPPER('%$feed_search%') OR
UPPER(C1.title) LIKE UPPER('%$feed_search%') OR
UPPER(F1.feed_url) LIKE UPPER('%$feed_search%')) AND";
$feed_search = split(" ", $feed_search);
$tokens = array();
foreach ($feed_search as $token) {
$token = trim($token);
array_push($tokens, "(UPPER(F1.title) LIKE UPPER('%$token%') OR
UPPER(C1.title) LIKE UPPER('%$token%') OR
UPPER(F1.feed_url) LIKE UPPER('%$token%'))");
}
$search_qpart = "(" . join($tokens, " AND ") . ") AND ";
} else {
$search_qpart = "";
}