summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-01-19 10:38:16 +0100
committerAndrew Dolgov <[email protected]>2007-01-19 10:38:16 +0100
commit203de776e0185414049441ef831063a5a198fd5b (patch)
tree4ac8f10afde2b54be0765ba369c03252ce58d47b
parentc1a0b534154e75829c8ae0fa08b1c659acff9b5f (diff)
implement (disabled) support for page skipping in headline view
-rw-r--r--backend.php12
-rw-r--r--feedlist.js20
-rw-r--r--functions.php12
3 files changed, 39 insertions, 5 deletions
diff --git a/backend.php b/backend.php
index 01cfe0a53..05a9957af 100644
--- a/backend.php
+++ b/backend.php
@@ -299,6 +299,9 @@
$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 = "";
@@ -382,7 +385,10 @@
$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];
@@ -401,10 +407,12 @@
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%\">";
diff --git a/feedlist.js b/feedlist.js
index caffc9387..9b47ce490 100644
--- a/feedlist.js
+++ b/feedlist.js
@@ -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);
diff --git a/functions.php b/functions.php
index bbcfdce36..3811a9a19 100644
--- a/functions.php
+++ b/functions.php
@@ -2371,7 +2371,7 @@
}
$content_query_part = "content as content_preview,";
-
+
$query = "SELECT
guid,
ttrss_entries.id,ttrss_entries.title,
@@ -2694,7 +2694,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) {
+ $search_mode = false, $offset = 0) {
if (!$bottom) {
$class = "headlinesSubToolbar";
@@ -2713,6 +2713,14 @@
$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\">".