widget Posted September 16, 2006 Share Posted September 16, 2006 Hi, I've been searching the site to no avail for what I need.First off my site is [url=http://www.ringaroot.com]www.ringaroot.com[/url] have a look and you will then understand what Im talking about.Say a user visits a certain category and clicks a title to view, in order to view another they have to start all over again which sucks.I would like to add next and previous links to every image page so the user can simply click next to view the next image in that category.The script is a joke script from dot com builder if anyone is familiar with their stuff.I can post requested codes - didnt want to swamp the post with code right from the get go.Any help is much appreciated. Quote Link to comment Share on other sites More sharing options...
widget Posted September 16, 2006 Author Share Posted September 16, 2006 Ok I've managed the NEXT and PREVIOUS button - I feel so proud lolSimply fixed by adding the code[quote]<a href="jokedetail.php?id=<?=$id+1?>">NEXT [/quote]This works beautifully until you reach the last image. Is there a way to do an if else statement that will stop the next button showing if there is no entry for that ID number?Also I need to have the NEXT link go to the next image in that category, not just the next image IDAgain, any help is much appreciated. Quote Link to comment Share on other sites More sharing options...
michaellunsford Posted September 16, 2006 Share Posted September 16, 2006 if you're using a database to retrieve the images based on category, you'd need to duplicate that database query on the image page to determine the previous and next buttons. Quote Link to comment Share on other sites More sharing options...
widget Posted September 16, 2006 Author Share Posted September 16, 2006 Are there such programs out there that help you easily create database queries for html output?I've managed to add clickable thumbs :) but I'm still not sure on the whole category next and back links. Quote Link to comment Share on other sites More sharing options...
michaellunsford Posted September 16, 2006 Share Posted September 16, 2006 you're passing the id in the URL, you could also pass the category (or whatever database search criteria you're using). Have the art page duplicate your query. You can loop through the results until you find the id they're looking at, then use the previous and next record's IDs in your previous and next links. Quote Link to comment Share on other sites More sharing options...
widget Posted September 17, 2006 Author Share Posted September 17, 2006 I know what I have to do, trouble is I dont know how to do it. Quote Link to comment Share on other sites More sharing options...
.josh Posted September 17, 2006 Share Posted September 17, 2006 key word to search for: pagination Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.