diff options
author | Andrew Dolgov <[email protected]> | 2007-02-21 08:17:46 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2007-02-21 08:17:46 +0100 |
commit | 95a82c0843d5515727763049bf2a5fd8e402978d (patch) | |
tree | c841a2d4e71265c96dde8d132b75014a7f883204 /functions.php | |
parent | 93135102c111bb15e85fd7e463be2e8581d79bbf (diff) |
disable page navigation when limit == 0
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 26 |
1 files changed, 17 insertions, 9 deletions
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 @@ <!-- <li class=\"top2\"> Page: <a href=\"$page_prev_link\">Previous</a>, - <a href=\"$page_next_link\">Next</a></li> --> - - <li class=\"top\"><a href=\"$page_next_link\">Next page</a><ul> - <li onclick=\"$page_prev_link\">Previous page</li> - <li onclick=\"$page_first_link\">First page</li></ul></li> - </ul> - + <a href=\"$page_next_link\">Next</a></li> -->"; + + if ($limit != 0) { + print " + <li class=\"top\"><a href=\"$page_next_link\">Next page</a><ul> + <li onclick=\"$page_prev_link\">Previous page</li> + <li onclick=\"$page_first_link\">First page</li></ul></li> + </ul>"; + } + + print " </td>"; } else { |