From ab3d0b9926f469540ac3d414b953a595aa5fec3e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 1 Nov 2005 08:47:03 +0100 Subject: store last feed update error in the database (SCHEMA UPDATED), display warning box in preferences on feed update error --- functions.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'functions.php') diff --git a/functions.php b/functions.php index 5057d23c4..2fdd13220 100644 --- a/functions.php +++ b/functions.php @@ -92,8 +92,11 @@ if (WEB_DEMO_MODE) return; + $feed = db_escape_string($feed); + error_reporting(0); $rss = fetch_rss($feed_url); + error_reporting (E_ERROR | E_WARNING | E_PARSE); db_query($link, "BEGIN"); @@ -349,8 +352,13 @@ } } - db_query($link, "UPDATE ttrss_feeds SET last_updated = NOW() WHERE id = '$feed'"); + db_query($link, "UPDATE ttrss_feeds + SET last_updated = NOW(), last_error = '' WHERE id = '$feed'"); + } else { + $error_msg = db_escape_string(magpie_error()); + db_query($link, + "UPDATE ttrss_feeds SET last_error = '$error_msg' WHERE id = '$feed'"); } db_query($link, "COMMIT"); -- cgit v1.2.3-54-g00ecf