View Single Post
Old 02-09-2013, 02:07 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Looks to me that someone did a bad job of pagination implementation AND/OR rewrite for the pages.
From what I can tell, the pagination should be based on incrementing counts, page 1, page 2, page 3, etc. Each time I manually specify the page number in that format I receive a different list of items; however, the pagination at the bottom remains at 1 until I hit 16 where it rolls to 2.
Pagination usually works via multipliers. You choose 16 items and are on page one, so you paginate (using mysql) as LIMIT 0, 16. Then you roll to page 2, and paginate from LIMIT 16, 16. Three would be LIMIT 32, 16. But the pages here work in steps of 16, so I don't know if its going exact and taking that 16 from the querstring to do LIMIT 16,16, or if its trying to calculate the start using the 16 as the page number. From what I can tell, it's attempting to recalculate the given number as the page number and not the starting number.
You can verify that; the movies one appears to be calculating based on the page being the page number and not the offset, and the tv shows looks to be doing the same, but that is only the case if you have 17 tv shows since I can bring up only one record when I type in 2 instead of 16. That looks to me to be the case; I can take movies to page 70, which would be 69*16 + 12 on that page for a total of 1116 entries (assuming all pages between produce results).

The the problem is relatively simple; its the pagination functionality. In specific, its the links that are created to move the pages. You'll need to track down the pagination functionality; you are looking for where you use LIMIT queries with input variables and you are either needing to remove any multiplier by 16 (or a variable representing the number of items to show), or dividing by 16 (again, the variable if you have it) so as to generate the proper page. (int)($count / 16) + 1 is what you need.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote