diff options
author | Andrew Dolgov <[email protected]> | 2006-09-19 05:14:27 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2006-09-19 05:14:27 +0100 |
commit | 472782e8bff08df698a3c3f87ee3fc9f7e16b06f (patch) | |
tree | e6bb4a92194ab3046c7850237ac54cae8230606e /functions.php | |
parent | 39ddbaa1c4067ebac770e7ed923dcee12dbfe3ce (diff) |
optimize catchup selected, add CatchupSelected subop in viewfeed
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/functions.php b/functions.php index 03e511d9f..bb80cac57 100644 --- a/functions.php +++ b/functions.php @@ -2586,4 +2586,30 @@ } } } + + function catchupArticlesById($link, $ids, $cmode) { + + $tmp_ids = array(); + + foreach ($ids as $id) { + array_push($tmp_ids, "ref_id = '$id'"); + } + + $ids_qpart = join(" OR ", $tmp_ids); + + if ($cmode == 0) { + db_query($link, "UPDATE ttrss_user_entries SET + unread = false,last_read = NOW() + WHERE ($ids_qpart) AND owner_uid = " . $_SESSION["uid"]); + } else if ($cmode == 1) { + db_query($link, "UPDATE ttrss_user_entries SET + unread = true + WHERE ($ids_qpart) AND owner_uid = " . $_SESSION["uid"]); + } else { + db_query($link, "UPDATE ttrss_user_entries SET + unread = NOT unread,last_read = NOW() + WHERE ($ids_qpart) AND owner_uid = " . $_SESSION["uid"]); + } + } + ?> |