]> git.wh0rd.org - tt-rss.git/commitdiff
fix searching by date; add search help prompt
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 19 Apr 2011 11:41:44 +0000 (15:41 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 19 Apr 2011 11:59:28 +0000 (15:59 +0400)
functions.php
modules/popup-dialog.php

index 1401cd744bdfd60ecec9734f408a0ff7a1f60b77..0da69094af03060933f4678aca48d416a071ace7 100644 (file)
                                $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%')
index 1f98edadb49b0a45d83d1d654fb0622b24b0bbaf..2eb63af9dd166d613634094681704a50234ab06c 100644 (file)
 
                        print "</div>";
 
-                       print "<div class=\"dlgButtons\">
-                       <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').execute()\">".__('Search')."</button>
+                       print "<div class=\"dlgButtons\">";
+
+                       if (!SPHINX_ENABLED) {
+                               print "<div style=\"float : left\">
+                                       <a class=\"visibleLink\" target=\"_blank\" href=\"http://tt-rss.org/redmine/wiki/tt-rss/SearchSyntax\">Search syntax</a>
+                                       </div>";
+                       }
+
+                       print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').execute()\">".__('Search')."</button>
                        <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').hide()\">".__('Cancel')."</button>
                        </div>";
                }