1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 07:25:54 +00:00

split some more functions from functions.php

This commit is contained in:
Andrew Dolgov
2013-01-22 22:32:17 +04:00
parent 04f60eb729
commit 87d7e8507a
8 changed files with 666 additions and 655 deletions

View File

@@ -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"]);
}
}