]> git.wh0rd.org - tt-rss.git/commitdiff
implement (disabled) support for page skipping in headline view
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 19 Jan 2007 09:38:16 +0000 (10:38 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 19 Jan 2007 09:38:16 +0000 (10:38 +0100)
backend.php
feedlist.js
functions.php

index 01cfe0a531dae1e1af043e149a1b2f552d38d588..05a9957af144e5055658139e8357b9e80161e936 100644 (file)
                $limit = db_escape_string($_GET["limit"]);
                $cat_view = db_escape_string($_GET["cat"]);
                $next_unread_feed = db_escape_string($_GET["nuf"]);
+               $offset = db_escape_string($_GET["skip"]);
+
+               if (!$offset) $offset = 0;
 
                if ($subop == "undefined") $subop = "";
 
                        $match_on = "both";
                }
 
-               $qfh_ret = queryFeedHeadlines($link, $feed, $limit, $view_mode, $cat_view, $search, $search_mode, $match_on);
+               $real_offset = $offset * $limit;
+
+               $qfh_ret = queryFeedHeadlines($link, $feed, $limit, $view_mode, $cat_view, 
+                       $search, $search_mode, $match_on, false, $real_offset);
 
                $result = $qfh_ret[0];
                $feed_title = $qfh_ret[1];
                if (db_num_rows($result) > 0) {
 
                        print_headline_subtoolbar($link, $feed_site_url, $feed_title, false, 
-                               $rtl_content, $feed, $cat_view, $search, $match_on, $search_mode);
+                               $rtl_content, $feed, $cat_view, $search, $match_on, $search_mode, $offset);
 
                        print "<div id=\"headlinesInnerContainer\">";
 
+#                      print "\{$offset}";
+
                        if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) {
                                print "<table class=\"headlinesList\" id=\"headlinesList\" 
                                        cellspacing=\"0\" width=\"100%\">";
index caffc9387deca6c75d245353e97eb4e868700044..9b47ce4901679273bffd5b4209bc54c41b0c90a9 100644 (file)
@@ -14,9 +14,23 @@ function feedlist_callback() {
        }
 }
 
-function viewfeed(feed, subop, is_cat, subop_param, skip_history) {
+var page_offset = 0;
+
+function viewFeedGoPage(i) {
+       page_offset = page_offset + i;
+
+       if (page_offset < 0) page_offset = 0;
+
+       viewfeed(getActiveFeedId(), undefined, undefined, undefined,
+               undefined, page_offset);
+
+}
+
+function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
        try {
 
+               if (!offset) page_offset = 0;
+
                enableHotkeys();
 
                if (!skip_history) {
@@ -84,6 +98,10 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history) {
                        query = query + "&cat=1";
                }
 
+               if (offset) {
+                       query = query + "&skip=" + offset;
+               }
+
                if (navigator.userAgent.match("Opera")) {
                        var date = new Date();
                        var timestamp = Math.round(date.getTime() / 1000);
index bbcfdce360ca62f053f5c4b4fd2ccaa12023dd09..3811a9a1951566a98ee09a431ebb8543bed1e5f7 100644 (file)
                                }
        
                                $content_query_part = "content as content_preview,";
-                               
+
                                $query = "SELECT 
                                                guid,
                                                ttrss_entries.id,ttrss_entries.title,
        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) {
+                       $search_mode = false, $offset = 0) {
 
                        if (!$bottom) {
                                $class = "headlinesSubToolbar";
                                $rtl_cpart = "";
                        }
 
+#                      if ($offset > 0) {
+#                              $prev_page_link = "<a title=\"Previous Page\" href=\"javascript:viewFeedGoPage(-1)\">&lt;&lt;</a>";
+#                      } else {
+#                              $prev_page_link = "&lt;&lt;";
+#                      }
+#                      $r_offset = $offset + 1;
+#                      $next_page_link = "[$r_offset] <a title=\"Next Page\" href=\"javascript:viewFeedGoPage(1)\">&gt;&gt;</a>";
+
                        if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) {
 
                                print "<td class=\"headlineActions$rtl_cpart\">".