summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-08-25 14:04:57 +0100
committerAndrew Dolgov <[email protected]>2005-08-25 14:04:57 +0100
commitc3a8d71ad42e1cfc72db5bb0f43789935220e6db (patch)
tree3d9962a9c6d650a6e75f9efd21bcc0816ac74e11 /functions.php
parent9cfc649af5e3a397f530475a16a2ae51965e948b (diff)
more functional keyboard navigation, auto page flipping, updated README, auto post cleanup (PURGE_OLD_DAYS), schema updated
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/functions.php b/functions.php
index 0d668eda6..46d010237 100644
--- a/functions.php
+++ b/functions.php
@@ -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");
}