diff options
author | Andrew Dolgov <[email protected]> | 2010-11-10 21:56:28 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2010-11-10 21:56:28 +0300 |
commit | f8fb44989f4b2cfb54f0f161acf2314c9d7b6d72 (patch) | |
tree | 8d048a5ba5c52710b6a7366d5fd96754774e7a36 /functions.php | |
parent | 773adf8b424b0b6e8b871c23a44afff0ed177cc0 (diff) |
js: code cleanup, disable some debugging
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 12 |
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; + } + } ?> |