From cb1083a1f6e13222b173c72e0627907aa978fd5f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 5 Sep 2005 13:54:07 +0100 Subject: [PATCH] limit number of loaded headlines --- backend.php | 5 +++++ tt-rss.js | 12 +++++++++++- tt-rss.php | 9 +++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/backend.php b/backend.php index 88d19641f..c25410d9a 100644 --- a/backend.php +++ b/backend.php @@ -249,6 +249,7 @@ $subop = $_GET["subop"]; $view_mode = $_GET["view"]; $addheader = $_GET["addheader"]; + $limit = $_GET["limit"]; if (!$skip) $skip = 0; @@ -338,6 +339,10 @@ if (!$addheader) { $limit_query_part = "LIMIT ".HEADLINES_PER_PAGE." OFFSET $skip"; + } else { + if ($limit != "All") { + $limit_query_part = "LIMIT " . $limit; + } } $result = pg_query("SELECT diff --git a/tt-rss.js b/tt-rss.js index 9b18b79c2..b2adeb1ce 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -229,6 +229,16 @@ function viewfeed(feed, skip, subop) { view_mode = "All Posts"; } + var limitbox = document.getElementById("limitbox"); + + var limit; + + if (limitbox) { + limit = limitbox.value; + } else { + limit = "All"; + } + if (skip < 0 || skip > total_feed_entries) { return; } @@ -260,7 +270,7 @@ function viewfeed(feed, skip, subop) { var query = "backend.php?op=viewfeed&feed=" + param_escape(feed) + "&skip=" + param_escape(skip) + "&subop=" + param_escape(subop) + - "&view=" + param_escape(view_mode); + "&view=" + param_escape(view_mode) + "&limit=" + limit; if (search_query != "") { query = query + "&search=" + param_escape(search_query); diff --git a/tt-rss.php b/tt-rss.php index b30c4fcce..385ea487e 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -59,6 +59,15 @@ +  Limit: + + +  Feed: Update