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 .= "";