]> git.wh0rd.org - tt-rss.git/commitdiff
store last feed update error in the database (SCHEMA UPDATED), display warning box...
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 1 Nov 2005 07:47:03 +0000 (08:47 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 1 Nov 2005 07:47:03 +0000 (08:47 +0100)
backend.php
functions.php
schema/ttrss_schema_mysql.sql
schema/ttrss_schema_pgsql.sql
tt-rss.css
tt-rss_compact.css

index 8b8a90709735f631055142f3612f1f3abe3a5faa..611b67b38805b611a45ff33e891cf13708a9e490 100644 (file)
                        }
                }
 
+               $result = db_query($link, "SELECT id,title,feed_url,last_error 
+                       FROM ttrss_feeds WHERE last_error != ''");
+
+               if (db_num_rows($result) > 0) {
+               
+                       print "<div class=\"warning\">";
+               
+                       print "<b>Feeds with update errors:</b>";
+
+                       print "<ul class=\"nomarks\">";
+                                               
+                       while ($line = db_fetch_assoc($result)) {
+                               print "<li>" . $line["title"] . " (" . $line["feed_url"] . "): " . 
+                                       $line["last_error"];
+                       }
+
+                       print "</ul>";
+                       print "</div>";
+
+               }
+
                print "<table class=\"prefAddFeed\"><tr>
                        <td><input id=\"fadd_link\"></td>
                        <td colspan=\"4\" align=\"right\">
index 5057d23c4db3f650ad0b191203910a1e06361789..2fdd132206b5667753c4d5e18f5c9782358d2a4f 100644 (file)
 
                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");
                                }
                        }
 
-                       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");
index 7abccc305889d1d0384e140f0b2f392575a1dd29..26ace74c243d8b237c12806ac6999b9267f8aad1 100644 (file)
@@ -7,7 +7,8 @@ create table ttrss_feeds (id integer not null auto_increment primary key,
        feed_url varchar(250) unique not null, 
        icon_url varchar(250) not null default '',
        update_interval integer not null default 0,
-       last_updated datetime default '') TYPE=InnoDB;
+       last_updated datetime default '',
+       last_error text not null default '') TYPE=InnoDB;
 
 insert into ttrss_feeds (title,feed_url) values ('Footnotes', 'http://gnomedesktop.org/node/feed');
 insert into ttrss_feeds (title,feed_url) values ('Freedesktop.org', 'http://planet.freedesktop.org/rss20.xml');
index bb971d2dd7ac633e0e20d071a50d8fbc17b47948..cc9cec5dcc846f8e2e5ab5e1887df04a37921472 100644 (file)
@@ -7,7 +7,8 @@ create table ttrss_feeds (id serial not null primary key,
        feed_url varchar(250) unique not null, 
        icon_url varchar(250) not null default '',
        update_interval integer not null default 0,
-       last_updated timestamp default null);
+       last_updated timestamp default null,
+       last_error text not null default '');
 
 insert into ttrss_feeds (title,feed_url) values ('Footnotes', 'http://gnomedesktop.org/node/feed');
 insert into ttrss_feeds (title,feed_url) values ('Freedesktop.org', 'http://planet.freedesktop.org/rss20.xml');
index dd55bbc70a129860e60c37891ee30dbb2b514852..46654b85089c8add39625d451f389b2102db36c8 100644 (file)
@@ -443,3 +443,18 @@ input.prefsTabSelected {
 input.prefsTab:hover {
        background : white;
 }
+
+div.warning {
+       background : #fffff0;
+       border : 1px solid #c0c0c0;
+       padding : 5px;
+       margin : 5px;
+       font-size : x-small;
+}
+
+ul.nomarks {
+       list-style-type : none;
+       margin : 0px;
+       padding : 10px; 
+}
+
index 29bf8e3d508cfaa20c6f6bfd36c0468c6bf838a8..deec0e39e0dfacdd096def85dd848fc4a0c373e3 100644 (file)
@@ -473,3 +473,18 @@ input.prefsTabSelected {
 input.prefsTab:hover {
        background : white;
 }
+
+div.warning {
+       background : #fffff0;
+       border : 1px solid #c0c0c0;
+       padding : 5px;
+       margin : 5px;
+       font-size : x-small;
+}
+
+ul.nomarks {
+       list-style-type : none;
+       margin : 0px;
+       padding : 10px; 
+}
+