summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-04-19 15:41:44 +0400
committerAndrew Dolgov <[email protected]>2011-04-19 15:59:28 +0400
commit5300354848df3ad4ee26fc533f8394ee37015994 (patch)
tree03716df6ad272d50152e6bfb86d850dfca3518b8 /functions.php
parent4a06f46dc7953b6f060f0023e630b721c36ae1d8 (diff)
fix searching by date; add search help prompt
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php28
1 files changed, 26 insertions, 2 deletions
diff --git a/functions.php b/functions.php
index 1401cd744..0da69094a 100644
--- a/functions.php
+++ b/functions.php
@@ -3349,13 +3349,37 @@
$not = "";
}
- if (strpos($k, "@") === 0) {
+ $commandpair = split(":", mb_strtolower($k), 2);
+
+ if ($commandpair[0] == "note" && $commandpair[1]) {
+
+ if ($commandpair[1] == "true")
+ array_push($query_keywords, "($not (note IS NOT NULL AND note != ''))");
+ else
+ array_push($query_keywords, "($not (note IS NULL OR note = ''))");
+
+ } else if ($commandpair[0] == "star" && $commandpair[1]) {
+
+ if ($commandpair[1] == "true")
+ array_push($query_keywords, "($not (marked = true))");
+ else
+ array_push($query_keywords, "($not (marked = false))");
+
+ } else if ($commandpair[0] == "pub" && $commandpair[1]) {
+
+ if ($commandpair[1] == "true")
+ array_push($query_keywords, "($not (published = true))");
+ else
+ array_push($query_keywords, "($not (published = false))");
+
+ } else if (strpos($k, "@") === 0) {
$user_tz_string = get_pref($link, 'USER_TIMEZONE', $_SESSION['uid']);
$orig_ts = strtotime(substr($k, 1));
-
$k = date("Y-m-d", convert_timestamp($orig_ts, $user_tz_string, 'UTC'));
+ //$k = date("Y-m-d", strtotime(substr($k, 1)));
+
array_push($query_keywords, "(".SUBSTRING_FOR_DATE."(updated,1,LENGTH('$k')) $not = '$k')");
} else if ($match_on == "both") {
array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%')