From 472782e8bff08df698a3c3f87ee3fc9f7e16b06f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 19 Sep 2006 05:14:27 +0100 Subject: optimize catchup selected, add CatchupSelected subop in viewfeed --- functions.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'functions.php') 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"]); + } + } + ?> -- cgit v1.2.3