summaryrefslogtreecommitdiff
path: root/backend.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-08-26 07:18:48 +0100
committerAndrew Dolgov <[email protected]>2005-08-26 07:18:48 +0100
commite1123aee35789042d768ca0597cbb04455b87496 (patch)
tree4087f36f8eb7b1eccec7809454b99f43f83e5088 /backend.php
parent961513a3bb7de5e1d0e214710645046d977cd110 (diff)
disable btnCatchupPage when there is nothing to catchup
Diffstat (limited to 'backend.php')
-rw-r--r--backend.php19
1 files changed, 15 insertions, 4 deletions
diff --git a/backend.php b/backend.php
index 1ae88917e..83d86458f 100644
--- a/backend.php
+++ b/backend.php
@@ -293,6 +293,8 @@
feed_id = '$feed' ORDER BY updated DESC LIMIT ".HEADLINES_PER_PAGE." OFFSET $skip");
$lnum = 0;
+
+ $num_unread = 0;
while ($line = pg_fetch_assoc($result)) {
@@ -300,12 +302,15 @@
if ($line["last_read_ts"] < $line["updated_ts"] && $line["unread"] == "f") {
$update_pic = "<img src=\"images/updated.png\" alt=\"Updated\">";
+ ++$num_unread;
} else {
$update_pic = "&nbsp;";
}
- if ($line["unread"] == "t")
+ if ($line["unread"] == "t") {
$class .= "Unread";
+ ++$num_unread;
+ }
$id = $line["id"];
$feed_id = $line["feed_id"];
@@ -365,9 +370,15 @@
print "&nbsp;&nbsp;Mark as read: ";
- print "<a class=\"button\"
- href=\"javascript:catchupPage($feed);\">This Page</a>";
- print "&nbsp;";
+ if ($num_unread > 0) {
+ print "<a class=\"button\" id=\"btnCatchupPage\"
+ href=\"javascript:catchupPage($feed);\">This Page</a>";
+ print "&nbsp;";
+ } else {
+ print "<a class=\"disabledButton\">This Page</a>";
+ print "&nbsp;";
+ }
+
print "<a class=\"button\"
href=\"javascript:viewfeed($feed, $skip, 'MarkAllRead');\">All Posts</a>";