From bfd78ed71c3264579e2d8a8bfc6b2f1ae88a6db9 Mon Sep 17 00:00:00 2001 From: kelson42 Date: Sun, 3 Apr 2011 11:32:51 +0000 Subject: [PATCH] + possible now to navigate trhough all the results --- src/common/kiwix/searcher.cpp | 10 +++++++--- static/results.tmpl | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/common/kiwix/searcher.cpp b/src/common/kiwix/searcher.cpp index 52ba64960..1a548ca4e 100644 --- a/src/common/kiwix/searcher.cpp +++ b/src/common/kiwix/searcher.cpp @@ -175,14 +175,18 @@ namespace kiwix { // pages CDT pagesCDT(CDT::ARRAY_VAL); - unsigned int pageCount = this->estimatedResultCount / this->resultCountPerPage + 1; + + unsigned int pageStart = this->resultStart / this->resultCountPerPage >= 5 ? this->resultStart / this->resultCountPerPage - 4 : 0; + + unsigned int pageCount = this->estimatedResultCount / this->resultCountPerPage + 1 - pageStart; if (pageCount > 10) pageCount = 10; else if (pageCount == 1) pageCount = 0; - - for (unsigned int i=0; iresultCountPerPage; page["end"] = (i+1) * this->resultCountPerPage; diff --git a/static/results.tmpl b/static/results.tmpl index 2144530fb..dd5b0b971 100644 --- a/static/results.tmpl +++ b/static/results.tmpl @@ -114,7 +114,7 @@