SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot Narfotic's Avatar
    Join Date
    Aug 2003
    Location
    Antwerp, Flanders, BE , EU
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Make next/previous page buttons

    Hey, I got a nice photogalleryscript that's called Lucidgallery, but I'm missing one thing.
    I want next/previous page buttons on my thumbnailpages.
    That's not that hard, but I don't want them appearing when there is no next/previous page.

    You can check out the gallery (don't mind the missing thumbs) here: http://www.narfotic.be/photos/show.p...lery=my%20pics

    as you can see in the right bottom I already got the pagelinks and placed a next button, but this buttons also appears on the last page.

    I don't know what part of my code you need to help me, but just tell me and I'll post it.

    Thanks

  2. #2
    Mal Reynolds Mandibal's Avatar
    Join Date
    Aug 2003
    Location
    Columbus
    Posts
    718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Get the total number of images/thumbnails and store that in a session var and check this var against the total number of images that have been displayed.
    ex:
    10 thumbs a page.
    20 total images.
    on page 2 you know you've displayed 20 images so you dont display the next button.
    Erh

  3. #3
    SitePoint Zealot Narfotic's Avatar
    Join Date
    Aug 2003
    Location
    Antwerp, Flanders, BE , EU
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mkay, probably should have mentioned that I'm quite a newbie in php, so this is not helping me much. I need an actual code.

  4. #4
    SitePoint Zealot Narfotic's Avatar
    Join Date
    Aug 2003
    Location
    Antwerp, Flanders, BE , EU
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When you're at the first page no page-variabel is displayed in your adress-bar.
    When you're at the second page, it displays: &p=1
    Third: &p=2

    can i do it with this?
    so for the previousbutton it should be something like:
    if p=null , don't show it
    and for the next it should check if there is another p behind that page.

    How do you put this in code?

  5. #5
    SitePoint Zealot Narfotic's Avatar
    Join Date
    Aug 2003
    Location
    Antwerp, Flanders, BE , EU
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anyone?

  6. #6
    PHP manual bot bronze trophy Gaheris's Avatar
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A very old but still usable article. Sitepoint IMHO has some too (apart from the thousands of posts about this subject in the forums).


Bookmarks

Posting Permissions

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