diff --git a/TODO b/TODO
index 82b7dea9e..98aacd64d 100644
--- a/TODO
+++ b/TODO
@@ -8,4 +8,4 @@ information, see if tags or feeds are required and return only them)
- per-feed update interval
- 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 as read" is broken for vfeeds/searches
diff --git a/backend.php b/backend.php
index 7ade2fb67..6fe21b923 100644
--- a/backend.php
+++ b/backend.php
@@ -472,6 +472,8 @@
$search = $_GET["search"];
+ $search_mode = $_GET["smode"];
+
if ($search) {
$search_query_part = "(upper(title) LIKE upper('%$search%')
OR content LIKE '%$search%') AND";
@@ -514,7 +516,12 @@
$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";
$vfeed_query_part = "(SELECT title FROM ttrss_feeds WHERE
id = feed_id) as feed_title,";
@@ -538,6 +545,7 @@
$query_strategy_part = "id > 0"; // dumb
}
+
$order_by = "updated DESC";
// if ($feed < -10) {
diff --git a/tt-rss.js b/tt-rss.js
index 919b0bd45..26218889e 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -9,6 +9,7 @@ var total_unread = 0;
var first_run = true;
var search_query = "";
+var search_mode = "";
var display_tags = false;
@@ -203,6 +204,16 @@ function viewfeed(feed, skip, subop) {
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 view_mode;
@@ -246,7 +257,8 @@ function viewfeed(feed, skip, subop) {
var query = "backend.php?op=viewfeed&feed=" + param_escape(feed) +
"&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 != "") {
query = query + "&search=" + param_escape(search_query);
diff --git a/tt-rss.php b/tt-rss.php
index 0bf146c1e..d5271b84f 100644
--- a/tt-rss.php
+++ b/tt-rss.php
@@ -79,6 +79,11 @@
+
+