Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Helping with PHP Navigation!
02-09-2013, 12:53 PM #1
- Join Date
- Feb 2013
- Thanked 0 Times in 0 Posts
Helping with PHP Navigation!
I'm new the this forum and need some help in getting my website fixed.
The problem is the navigation of the pages on my website, i brought a movie script from scripteen and this is the only main problem i have had with the script and they won't help.
Take a look at this page: http://www.movie-links.org/watch/movies
Now the problem with these pages is the navigation as the bottom of the pages, the movie page works for like 4 or 5 pages but after a while it doesn't find any movies which is a lie because i have over 1000+ movies.
The tv shows page doesn't even find the second page of tv shows.
Does anyone know the problem with my site?
Feel free to contact me at: email@example.com
02-09-2013, 02:07 PM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,650 Times in 2,619 Posts
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) + 1is what you need.PHP Code:
header('HTTP/1.1 420 Enhance Your Calm');