limit number of loaded headlines
This commit is contained in:
parent
bb7cfaceb1
commit
cb1083a1f6
3 changed files with 25 additions and 1 deletions
|
@ -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
|
||||
|
|
12
tt-rss.js
12
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);
|
||||
|
|
|
@ -59,6 +59,15 @@
|
|||
<option>Starred</option>
|
||||
</select>
|
||||
|
||||
Limit:
|
||||
|
||||
<select id="limitbox" onchange="javascript:viewCurrentFeed(0, '')">
|
||||
<option>15</option>
|
||||
<option>30</option>
|
||||
<option>60</option>
|
||||
<option>All</option>
|
||||
</select>
|
||||
|
||||
Feed: <a class="button"
|
||||
href="javascript:viewCurrentFeed(0, 'ForceUpdate')">Update</a>
|
||||
|
||||
|
|
Loading…
Reference in a new issue