summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/functions.php b/functions.php
index 0c0fc047f..a2e29655b 100644
--- a/functions.php
+++ b/functions.php
@@ -24,12 +24,20 @@
db_query($link, "BEGIN");
- $result = db_query($link, "SELECT feed_url,id,last_updated FROM ttrss_feeds");
+ $result = db_query($link, "SELECT feed_url,id,
+ substring(last_updated,1,19) as last_updated,
+ update_interval FROM ttrss_feeds");
while ($line = db_fetch_assoc($result)) {
-// if (!$line["last_updated"] || time() - strtotime($line["last_updated"]) > 1800) {
+ $upd_intl = $line["update_interval"];
+
+ if (!$upd_intl) $upd_intl = MIN_UPDATE_INTERVAL;
+
+ if (!$line["last_updated"] ||
+ time() - strtotime($line["last_updated"]) > ($upd_intl * 60)) {
+
update_rss_feed($link, $line["feed_url"], $line["id"]);
-// }
+ }
}
purge_old_posts($link);