From e6d1c0a06a904a5fead7271cb6a1e152439fe22e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 22 Aug 2005 10:54:21 +0100 Subject: disable some buttons in headline navbar --- backend.php | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'backend.php') diff --git a/backend.php b/backend.php index c9ca89053..f862d540d 100644 --- a/backend.php +++ b/backend.php @@ -162,6 +162,11 @@ OR content LIKE '%$search%') AND"; } + $result = pg_query("SELECT count(id) AS total_entries + FROM ttrss_entries WHERE feed_id = '$feed'"); + + $total_entries = pg_fetch_result($result, 0, "total_entries"); + $result = pg_query("SELECT id,title,updated,unread,feed_id, EXTRACT(EPOCH FROM last_read) AS last_read_ts, @@ -216,11 +221,21 @@ $prev_skip = $skip - HEADLINES_PER_PAGE; print "Navigate: "; - print "Previous Page"; + + if ($prev_skip >= 0) { + print "Previous Page"; + } else { + print "Previous Page"; + } print " "; - print "Next Page"; + + if ($next_skip < $total_entries) { + print "Next Page"; + } else { + print "Next Page"; + } print " "; print "Refresh Page"; -- cgit v1.2.3-54-g00ecf