Jump to content


Photo

Simple Next Image Button


  • Please log in to reply
6 replies to this topic

#1 widget

widget
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts

Posted 16 September 2006 - 01:48 AM

Hi, I've been searching the site to no avail for what I need.
First off my site is www.ringaroot.com 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.



#2 widget

widget
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts

Posted 16 September 2006 - 04:09 AM

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

Simply fixed by adding the code

<a href="jokedetail.php?id=<?=$id+1?>">NEXT


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.

#3 michaellunsford

michaellunsford
  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 16 September 2006 - 04:26 AM

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.

#4 widget

widget
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts

Posted 16 September 2006 - 04:07 PM

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.

#5 michaellunsford

michaellunsford
  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 16 September 2006 - 04:17 PM

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.

#6 widget

widget
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts

Posted 17 September 2006 - 06:15 AM

I know what I have to do, trouble is I dont know how to do it.

#7 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 17 September 2006 - 07:31 AM

key word to search for: pagination
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users