implement (disabled) support for page skipping in headline view
This commit is contained in:
parent
c1a0b53415
commit
203de776e0
12
backend.php
12
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%\">";
|
||||
|
|
20
feedlist.js
20
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);
|
||||
|
|
|
@ -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)\"><<</a>";
|
||||
# } else {
|
||||
# $prev_page_link = "<<";
|
||||
# }
|
||||
# $r_offset = $offset + 1;
|
||||
# $next_page_link = "[$r_offset] <a title=\"Next Page\" href=\"javascript:viewFeedGoPage(1)\">>></a>";
|
||||
|
||||
if (!get_pref($link, 'COMBINED_DISPLAY_MODE')) {
|
||||
|
||||
print "<td class=\"headlineActions$rtl_cpart\">".
|
||||
|
|
Loading…
Reference in New Issue