Jump to content

Simple Next Image Button


widget

Recommended Posts

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.

Link to comment
Share on other sites

Ok I've managed the NEXT and PREVIOUS button - I feel so proud  lol

Simply 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 ID

Again, any help is much appreciated.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.