Author Topic: Forward-Back links  (Read 1195 times)

0 Members and 1 Guest are viewing this topic.

NickM

  • Guest
Forward-Back links
on: Thu, 17. October 2002 - 14:27:28
Is there an easy way to move forward and backward through a sorted list created from a dbase table. E.g where you have an HTML  table of information and you would like to move forward to a new page that contains the next lot of information, or backward to the previous one.
If this was an alphabetically sorted table on the page and you started with B then you would want to go forward to C or backward to A.
Would __ROWNUM__ be of any help?
 :(

NickM

  • Guest
Forward-Back links
Reply #1 on: Mon, 21. October 2002 - 11:48:03
:cry: Hmm... No responses to my query. Perhaps it did not make sense.
Perhaps it is more a PHP issue?
All I want to do is put forward and back arrows on a page so the viewer can move to a new page.
I create a list for an estate agent and this list is in alphabetical order.
When a visitor clicks on one of the properties on the list he is taken to that page which contains the details about the property.
What I want to do is provide forward-backward arrows so the visitor can move along the list of properties, viewing property details from these pages (rather than going back to the list each time to select another property).
Anyone got a solution/suggestion/help link that I can follow up?
Seeing that the list and the details page are created using a dbase and vLib, I thought there might be a way to carry the necessary information via the URL?

Offline ClausVB

  • Administrator
  • Hero Member
  • *****
  • Posts: 566
    • Homepage: clausvb.de
Forward-Back links
Reply #2 on: Mon, 21. October 2002 - 12:24:50
I did not answer because your post is one big:

talk, talk, talk, talk

without paragraphs and structure. I find that difficult to read.

Make an example in pure HTML, please link it here and I will look at it.

Best regards,
Claus

NickM

  • Guest
Forward-Back links
Reply #3 on: Mon, 21. October 2002 - 12:36:27
Please forgive me. I am only new to this forum (or any forum).

I can't provide code because i don't know how to do it!

How do you move sequentially from page to page.

Page 1-> Page 2 ->Page 3

Is this better?

NickM

  • Guest
Forward-Back links
Reply #4 on: Mon, 21. October 2002 - 12:42:42
Have a look at how the arrows function here

http://www.robertgordon.com.au/homes2.html

Offline ClausVB

  • Administrator
  • Hero Member
  • *****
  • Posts: 566
    • Homepage: clausvb.de
Forward-Back links
Reply #5 on: Mon, 21. October 2002 - 13:14:01
Ok, now I know what you mean.

One part can be solved with vlibTemplate, but I think the other is a PHP problem. If you don't know how to do that, you have to go to another forum, because imho PHP, SQL & HTML questions cannot be posted here.

If I understood correctly
- first page = 1 arrow to the right
- next N pages = 2 arrows
- last page = 1 arrow to the left

I would solve this in PHP:
Code: [Select]

if $row$i == 0



  $href = homes1.html



elseif $row$i 0 AND $row$i $last_element



  $href = homes2.html



else

if $row$i == $last_element



  $href = homes3.html





$href indicates which Template to use or which address to jump to.

How you build $row and get $last_element is a PHP problem.

The template for "homes2.html" could be used to display all contents from
($row[$i] > 0 AND $row[$i] < $last_element)
by creating a loop.

Best regards,
Claus

Offline ClausVB

  • Administrator
  • Hero Member
  • *****
  • Posts: 566
    • Homepage: clausvb.de
Forward-Back links
Reply #6 on: Mon, 21. October 2002 - 13:25:49
You could use
"__FIRST__ - is true when you are currently on the first row of the loop."
and
"__LAST__ - is true when you are on the last row of the loop"

I would find the template structure more difficult, than to use three different templates.

But that's just my opinion. You are free to do what you want :-).

Best regards,
Claus

releasedj

  • Guest
Forward-Back links
Reply #7 on: Thu, 24. October 2002 - 10:44:13
Ah, the age old Prev/Next links.

This isn't something that vlibTemplate can control. You can use vlibTemplate to produce this effect but how you do it is up to you.

I think this is such a general programming issue that it's impossible to give you a definitive answer, and also that isn't really the job of this forum.

Regards,

Kelvin

PS: Sorry for the delayed response, I've just been away for a week.

NickM

  • Guest
Forward-Back links
Reply #8 on: Thu, 24. October 2002 - 12:37:49
Thanks to both of you for the gentle push off this forum. I found some php code that will do what I want and I'll incorporate vLib to get the HTML looking nice.