summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2006-12-01 07:26:05 +0100
committerAndrew Dolgov <[email protected]>2006-12-01 07:26:05 +0100
commita3656a415f2e557014eef45a395ad19e10771ff5 (patch)
tree4e98a66596d2aea71a5eda6c980cdb7853c9c021
parentd96d11f4ff0f796cd1dc948bab69241d07326f56 (diff)
tweak feed errors notification
-rw-r--r--modules/popup-dialog.php30
-rw-r--r--modules/pref-feeds.php27
-rw-r--r--prefs.js4
-rw-r--r--tt-rss.css6
4 files changed, 46 insertions, 21 deletions
diff --git a/modules/popup-dialog.php b/modules/popup-dialog.php
index 02282f46b..d3933ae77 100644
--- a/modules/popup-dialog.php
+++ b/modules/popup-dialog.php
@@ -240,6 +240,36 @@
}
+ if ($id == "feedUpdateErrors") {
+
+ print "<div id=\"infoBoxTitle\">Update Errors</div>";
+ print "<div class=\"infoBoxContents\">";
+
+ print "These feeds have not been updated because of errors:";
+
+ $result = db_query($link, "SELECT id,title,feed_url,last_error
+ FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]);
+
+ print "<ul class='nomarks'>";
+
+ while ($line = db_fetch_assoc($result)) {
+ print "<li><b>" . $line["title"] . "</b> (" . $line["feed_url"] . "): " .
+ "<em>" . $line["last_error"] . "</em>";
+ }
+
+ print "</ul>";
+ print "</div>";
+
+ print "<div align='center'>";
+
+ print "<input class=\"button\"
+ type=\"submit\" onclick=\"return closeInfoBox()\"
+ value=\"Close\">";
+
+ print "</div>";
+
+ }
+
print "</div>";
}
?>
diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php
index af8fd0936..0572978dd 100644
--- a/modules/pref-feeds.php
+++ b/modules/pref-feeds.php
@@ -710,31 +710,16 @@
if ($quiet) return;
-// print "<h3>Edit Feeds</h3>";
-
- $result = db_query($link, "SELECT id,title,feed_url,last_error
+ $result = db_query($link, "SELECT COUNT(id) AS num_errors
FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]);
- if (db_num_rows($result) > 0) {
-
- print "<div class=\"warning\">";
-
-// print"<img class=\"closeButton\"
-// onclick=\"javascript:hideParentElement(this);\" src=\"images/close.png\">";
-
- print "<a href=\"javascript:showBlockElement('feedUpdateErrors')\">
- <b>Some feeds have update errors (click for details)</b></a>";
-
- print "<ul id=\"feedUpdateErrors\" class=\"nomarks\">";
-
- while ($line = db_fetch_assoc($result)) {
- print "<li>" . $line["title"] . " (" . $line["feed_url"] . "): " .
- $line["last_error"];
- }
+ $num_errors = db_fetch_result($result, 0, "num_errors");
- print "</ul>";
- print "</div>";
+ if ($num_errors > 0) {
+ print "<a href=\"javascript:showFeedsWithErrors()\"
+ class=\"feedUpdErrLink\">Some feeds have update errors (click
+ for details)</a>";
}
$feed_search = db_escape_string($_GET["search"]);
diff --git a/prefs.js b/prefs.js
index 85ae91afc..6b772b1cd 100644
--- a/prefs.js
+++ b/prefs.js
@@ -1544,3 +1544,7 @@ function editFeedCats() {
xmlhttp.onreadystatechange=infobox_callback;
xmlhttp.send(null);
}
+
+function showFeedsWithErrors() {
+ displayDlg('feedUpdateErrors');
+}
diff --git a/tt-rss.css b/tt-rss.css
index 3459ac386..fa99ebfe0 100644
--- a/tt-rss.css
+++ b/tt-rss.css
@@ -1307,3 +1307,9 @@ div.return a:hover {
bottom : 2px;
right : 2px;
}
+
+a.feedUpdErrLink {
+ color : #ff0000;
+ display : block;
+ margin-bottom : 0.5em;
+}