set last_read to NOW() when publishing, order published feed by last read by default, allow overriding order in recently read feed

This commit is contained in:
Andrew Dolgov 2012-09-10 10:27:51 +04:00
parent 8cdc185ba4
commit 46b781491b
2 changed files with 6 additions and 3 deletions

View File

@ -276,7 +276,7 @@ class RPC extends Handler_Protected {
} }
$result = db_query($this->link, "UPDATE ttrss_user_entries SET $result = db_query($this->link, "UPDATE ttrss_user_entries SET
published = $pub published = $pub, last_read = NOW()
WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]); WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
$pubsub_result = false; $pubsub_result = false;

View File

@ -2412,6 +2412,8 @@
$query_strategy_part = "published = true"; $query_strategy_part = "published = true";
$vfeed_query_part = "ttrss_feeds.title AS feed_title,"; $vfeed_query_part = "ttrss_feeds.title AS feed_title,";
$allow_archived = true; $allow_archived = true;
if (!$override_order) $override_order = "last_read DESC, updated DESC";
} else { } else {
$vfeed_query_part = "ttrss_feeds.title AS feed_title,"; $vfeed_query_part = "ttrss_feeds.title AS feed_title,";
@ -2424,7 +2426,8 @@
} else if ($feed == -6) { // recently read } else if ($feed == -6) { // recently read
$query_strategy_part = "unread = false AND last_read IS NOT NULL"; $query_strategy_part = "unread = false AND last_read IS NOT NULL";
$vfeed_query_part = "ttrss_feeds.title AS feed_title,"; $vfeed_query_part = "ttrss_feeds.title AS feed_title,";
$override_order = "last_read DESC";
if (!$override_order) $override_order = "last_read DESC";
} else if ($feed == -3) { // fresh virtual feed } else if ($feed == -3) { // fresh virtual feed
$query_strategy_part = "unread = true AND score >= 0"; $query_strategy_part = "unread = true AND score >= 0";
@ -2997,7 +3000,7 @@
WHERE ($ids_qpart) AND owner_uid = " . $_SESSION["uid"]); WHERE ($ids_qpart) AND owner_uid = " . $_SESSION["uid"]);
} else if ($cmode == 1) { } else if ($cmode == 1) {
db_query($link, "UPDATE ttrss_user_entries SET db_query($link, "UPDATE ttrss_user_entries SET
published = true published = true,last_read = NOW()
WHERE ($ids_qpart) AND owner_uid = " . $_SESSION["uid"]); WHERE ($ids_qpart) AND owner_uid = " . $_SESSION["uid"]);
} else { } else {
db_query($link, "UPDATE ttrss_user_entries SET db_query($link, "UPDATE ttrss_user_entries SET