From f57306733217145c7345ef2fe6238efd6a480014 Mon Sep 17 00:00:00 2001 From: Neil Blakey-Milner Date: Tue, 16 Nov 2004 12:53:33 +0000 Subject: [PATCH] Fix off-by-one in whether to display the 'Next' button. --- lib/visualpatterns/PatternBrowsableSearchResults.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/visualpatterns/PatternBrowsableSearchResults.inc b/lib/visualpatterns/PatternBrowsableSearchResults.inc index a4879ea..4a98580 100644 --- a/lib/visualpatterns/PatternBrowsableSearchResults.inc +++ b/lib/visualpatterns/PatternBrowsableSearchResults.inc @@ -205,14 +205,14 @@ class PatternBrowseableSearchResults { $sToRender .= "\n"; $sToRender .= "\n"; // Display only the next button - if (($this->iStartIndex + $this->iResultsToDisplay) < $iTotalResults && $this->iStartIndex == 1) { + if (($this->iStartIndex + $this->iResultsToDisplay - 1) < $iTotalResults && $this->iStartIndex == 1) { $sToRender .= "             "; $sToRender .= ""; $sToRender .= ""; $sToRender .= "\n"; } // Display both the next and the previous buttons - else if (($this->iStartIndex + $this->iResultsToDisplay) < $iTotalResults && $this->iStartIndex > 1) { + else if (($this->iStartIndex + $this->iResultsToDisplay - 1) < $iTotalResults && $this->iStartIndex > 1) { $sToRender .= ""; $sToRender .= "graphicsUrl/widgets/previous.gif\" onClick=\"setActionAndSubmit('" . $_SERVER["PHP_SELF"] . "?fStartIndex=" . ($this->iStartIndex - $this->iResultsToDisplay) . $this->sQueryString . "')\" />"; $sToRender .= ""; -- libgit2 0.21.4