summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/functions.php b/functions.php
index e44d0ea3f..43c2afa25 100644
--- a/functions.php
+++ b/functions.php
@@ -3178,6 +3178,8 @@
$data['num_feeds'] = (int) $num_feeds;
+ $data['last_article_id'] = getLastArticleId($link);
+
if (ENABLE_UPDATE_DAEMON) {
$data['daemon_is_running'] = (int) file_is_locked("update_daemon.lock");
@@ -7006,4 +7008,14 @@
}
}
+ function getLastArticleId($link) {
+ $result = db_query($link, "SELECT MAX(ref_id) AS id FROM ttrss_user_entries
+ WHERE owner_uid = " . $_SESSION["uid"]);
+
+ if (db_num_rows($result) == 1) {
+ return db_fetch_result($result, 0, "id");
+ } else {
+ return -1;
+ }
+ }
?>