From 140aae812a7d83af8125bfbe13c75e20eee1fdcb Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 16 Nov 2005 10:47:22 +0100 Subject: [PATCH] ugly hack to selectively disable feed purging --- backend.php | 9 +++++++++ functions.php | 2 +- prefs.js | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/backend.php b/backend.php index 7781828a..c0b20b1d 100644 --- a/backend.php +++ b/backend.php @@ -825,6 +825,9 @@ if (strtoupper($purge_intl) == "DEFAULT") $purge_intl = 0; + if (strtoupper($purge_intl) == "DISABLED") + $purge_intl = -1; + $result = db_query($link, "UPDATE ttrss_feeds SET title = '$feed_title', feed_url = '$feed_link', update_interval = '$upd_intl', @@ -958,6 +961,9 @@ if ($line["purge_interval"] == "0") $line["purge_interval"] = "Default"; + if ($line["purge_interval"] < 0) + $line["purge_interval"] = "Disabled"; + print "" . $line["purge_interval"] . ""; @@ -977,6 +983,9 @@ if ($line["purge_interval"] == "0") $line["purge_interval"] = "Default"; + if ($line["purge_interval"] < 0) + $line["purge_interval"] = "Disabled"; + print "" . $line["purge_interval"] . ""; } else { diff --git a/functions.php b/functions.php index 4ab9ac7d..7d603e9c 100644 --- a/functions.php +++ b/functions.php @@ -14,7 +14,7 @@ if ($purge_interval == 0) $purge_interval = PURGE_OLD_DAYS; - if ($purge_interval != 0) { + if ($purge_interval > 0) { if (DB_TYPE == "pgsql") { db_query($link, "DELETE FROM ttrss_entries WHERE diff --git a/prefs.js b/prefs.js index 5c6f7a7f..b9973fd2 100644 --- a/prefs.js +++ b/prefs.js @@ -466,7 +466,7 @@ function feedEditSave() { // notify("Saving feed."); - if (upd_intl < 0) { +/* if (upd_intl < 0) { notify("Update interval must be >= 0 (0 = default)"); return; } @@ -474,7 +474,7 @@ function feedEditSave() { if (purge_intl < 0) { notify("Purge days must be >= 0 (0 = default)"); return; - } + } */ if (link.length == 0) { notify("Feed link cannot be blank."); -- 2.39.5