From 1d06634bb84bcaf76df2181a7ba87859dcc26f09 Mon Sep 17 00:00:00 2001 From: wjchen Date: Tue, 23 Jul 2013 21:55:28 +0800 Subject: [PATCH 1/3] Update fever_api.php improve sql and get marked,published,archived items as saved items --- fever/fever_api.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/fever/fever_api.php b/fever/fever_api.php index 46d3f6c..cebd0d4 100755 --- a/fever/fever_api.php +++ b/fever/fever_api.php @@ -489,14 +489,13 @@ class FeverAPI extends Handler { function getUnreadItemIds() { $unreadItemIdsCSV = ""; - $result = $this->dbh->query("SELECT ref_id, unread + $result = $this->dbh->query("SELECT ref_id FROM ttrss_user_entries - WHERE owner_uid = '" . db_escape_string($_SESSION["uid"]) . "'"); // ORDER BY red_id DESC + WHERE owner_uid = '" . db_escape_string($_SESSION["uid"]) . "'" . "AND unread"); // ORDER BY red_id DESC while ($line = $this->dbh->fetch_assoc($result)) { - if (sql_bool_to_bool($line["unread"])) - $unreadItemIdsCSV .= $line["ref_id"] . ","; + $unreadItemIdsCSV .= $line["ref_id"] . ","; } $unreadItemIdsCSV = trim($unreadItemIdsCSV, ","); @@ -506,14 +505,13 @@ class FeverAPI extends Handler { function getSavedItemIds() { $savedItemIdsCSV = ""; - $result = $this->dbh->query("SELECT ref_id, marked + $result = $this->dbh->query("SELECT ref_id FROM ttrss_user_entries - WHERE owner_uid = '" . db_escape_string($_SESSION["uid"]) . "'"); + WHERE owner_uid = '" . db_escape_string($_SESSION["uid"]) . "'" . "AND marked OR published OR feed_id IS NULL"); while ($line = $this->dbh->fetch_assoc($result)) { - if (sql_bool_to_bool($line["marked"])) - $savedItemIdsCSV .= $line["ref_id"] . ","; + $savedItemIdsCSV .= $line["ref_id"] . ","; } $savedItemIdsCSV = trim($savedItemIdsCSV, ","); From 66056a9ee921e87e47349d9e36666a7c6ebe09a5 Mon Sep 17 00:00:00 2001 From: wjchen Date: Tue, 23 Jul 2013 22:14:13 +0800 Subject: [PATCH 2/3] Update fever_api.php Add shared articles to saved items. --- fever/fever_api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fever/fever_api.php b/fever/fever_api.php index cebd0d4..ab7a4e2 100755 --- a/fever/fever_api.php +++ b/fever/fever_api.php @@ -507,7 +507,7 @@ class FeverAPI extends Handler { $savedItemIdsCSV = ""; $result = $this->dbh->query("SELECT ref_id FROM ttrss_user_entries - WHERE owner_uid = '" . db_escape_string($_SESSION["uid"]) . "'" . "AND marked OR published OR feed_id IS NULL"); + WHERE owner_uid = '" . db_escape_string($_SESSION["uid"]) . "'" . "AND marked OR published OR feed_id IS NULL OR uuid != ''"); while ($line = $this->dbh->fetch_assoc($result)) { From 08227666988fee9a799e8e7bc86f88af5724dff9 Mon Sep 17 00:00:00 2001 From: Dave Zaikos Date: Sun, 24 Nov 2013 16:22:49 -0500 Subject: [PATCH 3/3] Changed how the Fever API endpoint is generated in Fever::hook_prefs_tab(). --- fever/init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fever/init.php b/fever/init.php index 74f4766..bbf5be8 100755 --- a/fever/init.php +++ b/fever/init.php @@ -54,7 +54,7 @@ class Fever extends Plugin { print ""; print ""; - print "

" . __("To login with the Fever API, set your server details in your favourite RSS application to: ") . ($_SERVER["HTTPS"] == "on" ? "https://" : "http://") . dirname($_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]) . "/plugins/fever/" . "

"; + print "

" . __("To login with the Fever API, set your server details in your favourite RSS application to: ") . get_self_url_prefix() . "/plugins/fever/" . "

"; print "

" . __("Additional details can be found at ") . "http://www.feedafever.com/api

"; print "

" . __("Note: Due to the limitations of the API and some RSS clients (for example, Reeder on iOS), some features are unavailable: \"Special\" Feeds (Published / Tags / Labels / Fresh / Recent), Nested Categories (hierarchy is flattened)") . "

";