diff --git a/backend.php b/backend.php
index 39f2e6033..e35e7f6ee 100644
--- a/backend.php
+++ b/backend.php
@@ -233,6 +233,7 @@
$feed = $_GET["feed"];
$skip = $_GET["skip"];
$subop = $_GET["subop"];
+ $view_mode = $_GET["view"];
if (!$skip) $skip = 0;
@@ -270,17 +271,33 @@
print "
Search:
- Reset
- |
";
+ onchange=\"javascript:search($feed);\"> ";
+
+ print " Reset";
+
+ print " View: ";
+
+ print_select("viewbox", $view_mode, array("All Posts", "Starred"),
+ "onchange=\"javascript:viewfeed('$feed', '$skip', '');\"");
+
+ print "";
+
print "
" . $line["title"] . " |
";
$search = $_GET["search"];
- if (search) {
+ if ($search) {
$search_query_part = "(upper(title) LIKE upper('%$search%')
OR content LIKE '%$search%') AND";
+ } else {
+ $search_query_part = "";
+ }
+
+ $view_query_part = "";
+
+ if ($view_mode == "Starred") {
+ $view_query_part = " marked = true AND ";
}
$result = pg_query("SELECT count(id) AS total_entries
@@ -298,6 +315,7 @@
ttrss_entries
WHERE
$search_query_part
+ $view_query_part
feed_id = '$feed' ORDER BY updated DESC LIMIT ".HEADLINES_PER_PAGE." OFFSET $skip");
$lnum = 0;
diff --git a/functions.php b/functions.php
index d572ee780..e6ef6589a 100644
--- a/functions.php
+++ b/functions.php
@@ -297,8 +297,8 @@
}
- function print_select($id, $default, $values) {
- print "