summaryrefslogtreecommitdiff
path: root/classes/article.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-01-22 22:32:17 +0400
committerAndrew Dolgov <[email protected]>2013-01-22 22:32:17 +0400
commit87d7e8507a4a41c4e0d7a4f2d54fe48f3a6f72cb (patch)
tree569db7d16c8f1d529d382039b1ead0d6e0c46c68 /classes/article.php
parent04f60eb729e1444bb3363677584c8179050403c4 (diff)
split some more functions from functions.php
Diffstat (limited to 'classes/article.php')
-rw-r--r--classes/article.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/classes/article.php b/classes/article.php
index 16619c9ad..0cb7073b5 100644
--- a/classes/article.php
+++ b/classes/article.php
@@ -52,7 +52,7 @@ class Article extends Handler_Protected {
return;
}
- catchupArticleById($this->link, $id, 0);
+ $this->catchupArticleById($this->link, $id, 0);
if (!$_SESSION["bw_limit"]) {
foreach ($cids as $cid) {
@@ -63,7 +63,27 @@ class Article extends Handler_Protected {
}
print json_encode($articles);
+ }
+
+ private function catchupArticleById($link, $id, $cmode) {
+
+ if ($cmode == 0) {
+ db_query($link, "UPDATE ttrss_user_entries SET
+ unread = false,last_read = NOW()
+ WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
+ } else if ($cmode == 1) {
+ db_query($link, "UPDATE ttrss_user_entries SET
+ unread = true
+ WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
+ } else {
+ db_query($link, "UPDATE ttrss_user_entries SET
+ unread = NOT unread,last_read = NOW()
+ WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
+ }
+ $feed_id = getArticleFeed($link, $id);
+ ccache_update($link, $feed_id, $_SESSION["uid"]);
}
+
}