global search, update TODO

This commit is contained in:
Andrew Dolgov 2005-10-16 17:16:34 +01:00
parent 9cab3250d6
commit 52b51244c1
4 changed files with 28 additions and 3 deletions

2
TODO
View File

@ -8,4 +8,4 @@ information, see if tags or feeds are required and return only them)
- per-feed update interval - per-feed update interval
- download linked images and store them somewhere in case the links get broken - download linked images and store them somewhere in case the links get broken
- mark item as unread (maybe add combobox in view frame to mark as read/unread/starred) - mark item as unread (maybe add combobox in view frame to mark as read/unread/starred)
- "mark as read" is broken for vfeeds/searches

View File

@ -472,6 +472,8 @@
$search = $_GET["search"]; $search = $_GET["search"];
$search_mode = $_GET["smode"];
if ($search) { if ($search) {
$search_query_part = "(upper(title) LIKE upper('%$search%') $search_query_part = "(upper(title) LIKE upper('%$search%')
OR content LIKE '%$search%') AND"; OR content LIKE '%$search%') AND";
@ -514,7 +516,12 @@
$vfeed_query_part = ""; $vfeed_query_part = "";
if (sprintf("%d", $feed) == 0) { // override query strategy and enable feed display when searching globally
if ($search_mode == "All feeds") {
$query_strategy_part = "id > 0";
$vfeed_query_part = "(SELECT title FROM ttrss_feeds WHERE
id = feed_id) as feed_title,";
} else if (sprintf("%d", $feed) == 0) {
$query_strategy_part = "ttrss_entries.id > 0"; $query_strategy_part = "ttrss_entries.id > 0";
$vfeed_query_part = "(SELECT title FROM ttrss_feeds WHERE $vfeed_query_part = "(SELECT title FROM ttrss_feeds WHERE
id = feed_id) as feed_title,"; id = feed_id) as feed_title,";
@ -538,6 +545,7 @@
$query_strategy_part = "id > 0"; // dumb $query_strategy_part = "id > 0"; // dumb
} }
$order_by = "updated DESC"; $order_by = "updated DESC";
// if ($feed < -10) { // if ($feed < -10) {

View File

@ -9,6 +9,7 @@ var total_unread = 0;
var first_run = true; var first_run = true;
var search_query = ""; var search_query = "";
var search_mode = "";
var display_tags = false; var display_tags = false;
@ -203,6 +204,16 @@ function viewfeed(feed, skip, subop) {
search_query = ""; search_query = "";
} }
var searchmodebox = document.getElementById("searchmodebox");
if (searchmodebox) {
search_mode = searchmodebox.value;
} else {
search_mode = "";
}
setCookie("ttrss_vf_smode", search_mode);
var viewbox = document.getElementById("viewbox"); var viewbox = document.getElementById("viewbox");
var view_mode; var view_mode;
@ -246,7 +257,8 @@ function viewfeed(feed, skip, subop) {
var query = "backend.php?op=viewfeed&feed=" + param_escape(feed) + var query = "backend.php?op=viewfeed&feed=" + param_escape(feed) +
"&skip=" + param_escape(skip) + "&subop=" + param_escape(subop) + "&skip=" + param_escape(skip) + "&subop=" + param_escape(subop) +
"&view=" + param_escape(view_mode) + "&limit=" + limit; "&view=" + param_escape(view_mode) + "&limit=" + limit +
"&smode=" + param_escape(search_mode);
if (search_query != "") { if (search_query != "") {
query = query + "&search=" + param_escape(search_query); query = query + "&search=" + param_escape(search_query);

View File

@ -79,6 +79,11 @@
<input id="searchbox" <input id="searchbox"
onblur="javascript:enableHotkeys()" onfocus="javascript:disableHotkeys()" onblur="javascript:enableHotkeys()" onfocus="javascript:disableHotkeys()"
onchange="javascript:search()"> onchange="javascript:search()">
<select id="searchmodebox">
<option>This feed</option>
<option>All feeds</option>
</select>
<input type="submit" <input type="submit"
class="button" onclick="javascript:search()" value="Search"> class="button" onclick="javascript:search()" value="Search">
<!-- <input type="submit" <!-- <input type="submit"