Jump to content

Archived

This topic is now archived and is closed to further replies.

widget

Simple Next Image Button

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.

Share this post


Link to post
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.

Share this post


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

Share this post


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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

×

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.