feed_id = '$feed' ORDER BY updated DESC LIMIT ".HEADLINES_PER_PAGE." OFFSET $skip");
$lnum = 0;
+
+ $num_unread = 0;
while ($line = pg_fetch_assoc($result)) {
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 = " ";
}
- if ($line["unread"] == "t")
+ if ($line["unread"] == "t") {
$class .= "Unread";
+ ++$num_unread;
+ }
$id = $line["id"];
$feed_id = $line["feed_id"];
print " Mark as read: ";
- print "<a class=\"button\"
- href=\"javascript:catchupPage($feed);\">This Page</a>";
- print " ";
+ if ($num_unread > 0) {
+ print "<a class=\"button\" id=\"btnCatchupPage\"
+ href=\"javascript:catchupPage($feed);\">This Page</a>";
+ print " ";
+ } else {
+ print "<a class=\"disabledButton\">This Page</a>";
+ print " ";
+ }
+
print "<a class=\"button\"
href=\"javascript:viewfeed($feed, $skip, 'MarkAllRead');\">All Posts</a>";
param_escape(rows.toString());
notify("Marking this page as read...");
+
+ var button = document.getElementById("btnCatchupPage");
+
+ button.className = "disabledButton";
+ button.href = "";
xmlhttp.open("GET", query_str, true);
xmlhttp.onreadystatechange=notify_callback;