From 95a82c0843d5515727763049bf2a5fd8e402978d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 21 Feb 2007 08:17:46 +0100 Subject: disable page navigation when limit == 0 --- backend.php | 3 ++- functions.php | 26 +++++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/backend.php b/backend.php index f65e95466..4aaec48ad 100644 --- a/backend.php +++ b/backend.php @@ -406,7 +406,8 @@ } print_headline_subtoolbar($link, $feed_site_url, $feed_title, false, - $rtl_content, $feed, $cat_view, $search, $match_on, $search_mode, $offset); + $rtl_content, $feed, $cat_view, $search, $match_on, $search_mode, + $offset, $limit); print "
"; diff --git a/functions.php b/functions.php index f6081b164..244c41682 100644 --- a/functions.php +++ b/functions.php @@ -2380,6 +2380,10 @@ $content_query_part = "content as content_preview,"; + if ($limit_query_part) { + $offset_query_part = "OFFSET $offset"; + } + $query = "SELECT guid, ttrss_entries.id,ttrss_entries.title, @@ -2400,7 +2404,7 @@ $search_query_part $view_query_part $query_strategy_part ORDER BY $order_by - $limit_query_part OFFSET $offset"; + $limit_query_part $offset_query_part"; $result = db_query($link, $query); @@ -2710,7 +2714,7 @@ function print_headline_subtoolbar($link, $feed_site_url, $feed_title, $bottom = false, $rtl_content = false, $feed_id = 0, $is_cat = false, $search = false, $match_on = false, - $search_mode = false, $offset = 0) { + $search_mode = false, $offset = 0, $limit = 0) { $user_page_offset = $offset + 1; @@ -2779,13 +2783,17 @@ - -
  • Next page
      -
    • Previous page
    • -
    • First page
  • - - + Next -->"; + + if ($limit != 0) { + print " +
  • Next page
      +
    • Previous page
    • +
    • First page
  • + "; + } + + print " "; } else { -- cgit v1.2.3