Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Search Pagination Weirdness

Hey guys,

I integrated a vanilla forum into my main site and am quite happy with the results so far. While adapting the pagination in the search results I encountered some weird behaviour:

  • Pagination is not numbered, but displayed as prev/next links only. As far as I understand there are two pagination types, but I did not find a suitable solution to change search results to numbered pagination as for example on this forum.
  • The Pagination is endless - although there are limited search results, pagination continues. If, for example, you search for 'test' on my forum like this: https://forum.sormena.org/search?Search=test there are no results but there is a "next" button showing up. As far as I can tell, this is due to lines 406-409 in class.pagermodule.php:

    $HasNext = true;
    if ($this->CurrentRecords !== false && $this->CurrentRecords < $this->Limit) {
        $HasNext = false;
    }
    

'$this->CurrentRecords' is false, so $HasNext is true, even if there are no records at all. Seems like a bug to me?

Anyway, rather then using prev/next pagination I'd like to switch to numbered pagination in the first place. Is there any way to have this configured? I made no adaptions to the search functionality at all and until now I did not patch any core files, so if there is a clean way of setting this up the right way I'd be glad to know about!

Thanx for your help in advance!

Sign In or Register to comment.