Skip to content

Commit

Permalink
Properly fill current page number to new server side pagination template
Browse files Browse the repository at this point in the history
When current page is automatically reset to zero because of a new search
request.
  • Loading branch information
luccioman committed Mar 5, 2019
1 parent 384c371 commit 093ea95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion htroot/yacysearch.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ <h4 class="linktitle">
#(resultTable)#::</table>::</table>#(/resultTable)# #(resultTable)#::</table>::</table>#(/resultTable)#
<!-- linklist end --> <!-- linklist end -->


<!--#include virtual="yacysearchpagination.html?eventID=#[eventID]#&maximumRecords=#[count]#&jsResort=#(jsResort)#false::true#(/jsResort)##(authSearch)#::&auth#(/authSearch)#" --> <!--#include virtual="yacysearchpagination.html?eventID=#[eventID]#&maximumRecords=#[count]#&offset=#[offset]#&jsResort=#(jsResort)#false::true#(/jsResort)##(authSearch)#::&auth#(/authSearch)#" -->


</div> <!-- close main --> </div> <!-- close main -->


Expand Down
2 changes: 1 addition & 1 deletion htroot/yacysearchpagination.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static serverObjects respond(final RequestHeader header, final serverObje
prop.put("pagination_pages", 0); prop.put("pagination_pages", 0);
prop.put("pagination_nextDisabled", true); prop.put("pagination_nextDisabled", true);
} else { } else {
final int startRecord = post.getInt("startRecord", post.getInt("offset", post.getInt("start", 0))); final int startRecord = post.getInt("offset", 0);
final int totalCount = theSearch.getResultCount(); final int totalCount = theSearch.getResultCount();


final int activePage = (int) Math.floor(startRecord / (double) itemsPerPage); final int activePage = (int) Math.floor(startRecord / (double) itemsPerPage);
Expand Down

0 comments on commit 093ea95

Please sign in to comment.