Login   Register  
PHP Classes
elePHPant
Icontem

bug fix in the pagination

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Little Paginator  >  All threads  >  bug fix in the pagination  >  (Un) Subscribe thread alerts  
Subject:bug fix in the pagination
Summary:number of pages displayed is wrong
Messages:2
Author:Marco Rossi
Date:2013-02-19 09:15:10
Update:2013-02-23 02:48:30
 

  1. bug fix in the pagination   Reply   Report abuse  
Picture of Marco Rossi
Marco Rossi
2013-02-19 09:15:10
Hi, great class, but we have to fix just some things like the number of the displayed pages when you are in the middle, for example:

$total = 191;
$results_per_page = 10;

if you go to page number 16 the displayed pages are 10,
if you go to page number 17 are 9
if you go to page number 18 are 8
if you go to page number 19 are 7
if you go to page number 20 are 6

in my opinion the number of the page must to be ever 10.

How we can fix it?

Thank you!
Regards
Marco

  2. Re: bug fix in the pagination   Reply   Report abuse  
Picture of Cody Roodaka
Cody Roodaka
2013-02-23 02:48:30 - In reply to message 1 from Marco Rossi
Hi! thanks for comment, The class uses pure mathematics to calculate the number of pages to show.

Example with yours values:

$total = 191;
$results_per_page = 10;
// in this case a total of 19 pages.

Well, the class is ready to not show pages 'nonexistent' what happens reductions resulting nodes, for example:

// if you're on page 11, you will see this
First Prev 6 7 8 9 10 [11] 12 13 14 15 Next Last

// Now, if you're on page 18, you will see this:
First Prev 13 14 15 16 17 [18] 19 Next Last
// The amount reduced because the pages 20, 21 and 22 do not exist (whether to display null values ​​then be displayed)

I hope I explained well, in any case I am at your disposal :)

Excuse my english, I'm Argentinian.