]> git.wh0rd.org - tt-rss.git/blobdiff - functions.php
more functional keyboard navigation, auto page flipping, updated README, auto post...
[tt-rss.git] / functions.php
index 0d668eda65e690d311a05a6de64ba3e6ea4e99af..46d010237942451874f386d552a3ab6fa488dd94 100644 (file)
@@ -1,6 +1,13 @@
 <?
        require_once 'config.php';
 
+       function purge_old_posts() {
+               if (PURGE_OLD_DAYS) {
+                       $result = pg_query("DELETE FROM ttrss_entries WHERE
+                               date_entered < NOW() - INTERVAL '30 days'");
+               }
+       }
+
        function update_all_feeds($link, $fetch) {
 
                if (WEB_DEMO_MODE) return;
@@ -23,6 +30,8 @@
                        update_rss_feed($link, $line["feed_url"], $line["id"]);
                }
 
+               purge_old_posts();
+
                pg_query("COMMIT");
 
        }