]> git.wh0rd.org Git - tt-rss.git/commitdiff
disable page navigation when limit == 0
authorAndrew Dolgov <fox@bah.spb.su>
Wed, 21 Feb 2007 07:17:46 +0000 (08:17 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Wed, 21 Feb 2007 07:17:46 +0000 (08:17 +0100)
backend.php
functions.php

index f65e95466be20007e59ae83a322004ce2906ce6a..4aaec48ad3521b12bb6839726d1bdda66b43ddae 100644 (file)
                }
 
                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 "<div id=\"headlinesInnerContainer\">";
 
index f6081b16416ff3b3353031cde58c890890d32524..244c41682e7ecb8761724eb7cc17e1887967dd69 100644 (file)
        
                                $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,
                                        $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);
        
        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;
 
                                        <!-- <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 {