summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.php-dist5
-rw-r--r--functions.php16
-rw-r--r--modules/pref-feeds.php27
-rw-r--r--modules/pref-prefs.php5
-rw-r--r--update_daemon2.php4
-rw-r--r--update_daemon_loop.php4
-rw-r--r--update_feeds.php2
7 files changed, 44 insertions, 19 deletions
diff --git a/config.php-dist b/config.php-dist
index c5417ec24..78f1a2b3f 100644
--- a/config.php-dist
+++ b/config.php-dist
@@ -201,6 +201,11 @@
// Displays an URL for users to provide feedback or comments regarding
// this instance of tt-rss. Can lead to a forum, contact email, etc.
+ define('FORCE_ARTICLE_PURGE', 0);
+ // When this option is not 0, users ability to control feed purging
+ // intervals is disabled and all articles (which are not starred)
+ // older than this amount of days are purged.
+
define('CONFIG_VERSION', 18);
// Expected config version. Please update this option in config.php
// if necessary (after migrating all new options from this file).
diff --git a/functions.php b/functions.php
index 962057e33..565c5d103 100644
--- a/functions.php
+++ b/functions.php
@@ -147,8 +147,13 @@
if (!$owner_uid) return;
- $purge_unread = get_pref($link, "PURGE_UNREAD_ARTICLES",
- $owner_uid, false);
+ if (FORCE_ARTICLE_PURGE == 0) {
+ $purge_unread = get_pref($link, "PURGE_UNREAD_ARTICLES",
+ $owner_uid, false);
+ } else {
+ $purge_unread = true;
+ $purge_interval = FORCE_ARTICLE_PURGE;
+ }
if (!$purge_unread) $query_limit = " unread = false AND ";
@@ -252,7 +257,7 @@
// print "Feed $feed_id: purge interval = $purge_interval\n";
}
- if ($purge_interval > 0) {
+ if ($purge_interval > 0 || FORCE_ARTICLE_PURGE) {
purge_feed($link, $feed_id, $purge_interval, $do_output);
}
}
@@ -1423,9 +1428,12 @@
_debug("update_rss_feed: updating counters cache...");
}
- ccache_update($link, $feed, $owner_uid);
+ // disabled, purge_feed() does that...
+ //ccache_update($link, $feed, $owner_uid);
}
+ purge_feed($link, $feed, 0, true);
+
db_query($link, "UPDATE ttrss_feeds
SET last_updated = NOW(), last_error = '' WHERE id = '$feed'");
diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php
index 8b715e48f..532a8f531 100644
--- a/modules/pref-feeds.php
+++ b/modules/pref-feeds.php
@@ -276,15 +276,19 @@
print_select_hash("update_method", $update_method, $update_methods);
}
- /* Purge intl */
+ if (FORCE_ARTICLE_PURGE == 0) {
- print "<br/>";
+ /* Purge intl */
+
+ print "<br/>";
+
+ $purge_interval = db_fetch_result($result, 0, "purge_interval");
- $purge_interval = db_fetch_result($result, 0, "purge_interval");
+ print __('Article purging:') . " ";
- print __('Article purging:') . " ";
+ print_select_hash("purge_interval", $purge_interval, $purge_intervals);
- print_select_hash("purge_interval", $purge_interval, $purge_intervals);
+ }
print "</div>";
print "<div class=\"dlgSec\">".__("Authentication")."</div>";
@@ -469,14 +473,17 @@
/* Purge intl */
- print "<br/>";
+ if (FORCE_ARTICLE_PURGE != 0) {
- print __('Article purging:') . " ";
+ print "<br/>";
- print_select_hash("purge_interval", $purge_interval, $purge_intervals,
- "disabled");
+ print __('Article purging:') . " ";
- batch_edit_cbox("purge_interval");
+ print_select_hash("purge_interval", $purge_interval, $purge_intervals,
+ "disabled");
+
+ batch_edit_cbox("purge_interval");
+ }
print "</div>";
print "<div class=\"dlgSec\">".__("Authentication")."</div>";
diff --git a/modules/pref-prefs.php b/modules/pref-prefs.php
index 987a093c0..80a63cb9e 100644
--- a/modules/pref-prefs.php
+++ b/modules/pref-prefs.php
@@ -15,6 +15,11 @@
$prefs_blacklist = array("HIDE_FEEDLIST", "SYNC_COUNTERS", "ENABLE_LABELS");
+ if (FORCE_ARTICLE_PURGE != 0) {
+ array_push($prefs_blacklist, "PURGE_OLD_DAYS");
+ array_push($prefs_blacklist, "PURGE_UNREAD_ARTICLES");
+ }
+
if ($subop == "change-password") {
$old_pw = $_POST["OLD_PASSWORD"];
diff --git a/update_daemon2.php b/update_daemon2.php
index 45ba2fbf2..777b835ab 100644
--- a/update_daemon2.php
+++ b/update_daemon2.php
@@ -164,8 +164,8 @@
// FIXME : $last_purge is of no use in a multiprocess update.
// FIXME : We ALWAYS purge old posts.
- _debug("Purging old posts (random 30 feeds)...");
- global_purge_old_posts($link, true, 30);
+ //_debug("Purging old posts (random 30 feeds)...");
+ //global_purge_old_posts($link, true, 30);
// Call to the feed batch update function
// or regenerate feedbrowser cache
diff --git a/update_daemon_loop.php b/update_daemon_loop.php
index d3c760d87..668b19abc 100644
--- a/update_daemon_loop.php
+++ b/update_daemon_loop.php
@@ -63,11 +63,11 @@
die;
}
- if (time() - $last_purge > PURGE_INTERVAL) {
+/* if (time() - $last_purge > PURGE_INTERVAL) {
_debug("Purging old posts (random 30 feeds)...");
global_purge_old_posts($link, true, 30);
$last_purge = time();
- }
+ } */
// Call to the feed batch update function
// or regenerate feedbrowser cache
diff --git a/update_feeds.php b/update_feeds.php
index 2bb91dc30..e08c6f392 100644
--- a/update_feeds.php
+++ b/update_feeds.php
@@ -39,7 +39,7 @@
init_connection($link);
// Purge all posts (random 30 feeds)
- global_purge_old_posts($link, true, 30);
+ //global_purge_old_posts($link, true, 30);
// Update all feeds needing a update.
update_daemon_common($link);