Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Helping with PHP Navigation!

    Hello all.

    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

    and: http://www.movie-links.org/watch/tv-shows

    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: admin@movie-links.org

    Thanks
    ChaneyBoi

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 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) + 1 is what you need.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •