diff options
author | Andrew Dolgov <[email protected]> | 2017-05-04 15:00:21 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-05-04 15:00:21 +0300 |
commit | a230bf88a9ce4589eeaf2d00226eafb78b4de01c (patch) | |
tree | 0f3656d2249c1de79162ed7e38a539292932f7c4 /classes/article.php | |
parent | 86a8351ca2abbacda557819cefb66379a450103c (diff) |
move to Article:
+ static function purge_orphans($do_output = false) {
move to Feeds
+ static function getGlobalUnread($user_id = false) {
+ static function getCategoryTitle($cat_id) {
+ static function getLabelUnread($label_id, $owner_uid = false) {
Diffstat (limited to 'classes/article.php')
-rw-r--r-- | classes/article.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/classes/article.php b/classes/article.php index e0c8d3e6d..64c04e140 100644 --- a/classes/article.php +++ b/classes/article.php @@ -864,4 +864,17 @@ class Article extends Handler_Protected { return $rv; } + static function purge_orphans($do_output = false) { + + // purge orphaned posts in main content table + $result = db_query("DELETE FROM ttrss_entries WHERE + NOT EXISTS (SELECT ref_id FROM ttrss_user_entries WHERE ref_id = id)"); + + if ($do_output) { + $rows = db_affected_rows($result); + _debug("Purged $rows orphaned posts."); + } + } + + } |