limit number of loaded headlines

This commit is contained in:
Andrew Dolgov 2005-09-05 13:54:07 +01:00
parent bb7cfaceb1
commit cb1083a1f6
3 changed files with 25 additions and 1 deletions

View file

@ -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

View file

@ -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);

View file

@ -59,6 +59,15 @@
<option>Starred</option>
</select>
&nbsp;Limit:
<select id="limitbox" onchange="javascript:viewCurrentFeed(0, '')">
<option>15</option>
<option>30</option>
<option>60</option>
<option>All</option>
</select>
&nbsp;Feed: <a class="button"
href="javascript:viewCurrentFeed(0, 'ForceUpdate')">Update</a>