PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have some code that Creates 'PREVIOUS' and 'NEXT' links for my page depending on the positions within a sitemap. The code works by reading the sitemap into an array and then setting the links to the previous and next records within the sitemap:
I think I may be assuming (incorrrectly) that "preceding-sibling" and "following-sibling" work in the same way. The "following-sibling" is getting out the next record. However I read that "preceding-sibling" will select all the sibling elements before the context node. Wheras I would only want the immiedately preceding/previous record, how could I do this?
Then have code that checks to make sure that is valid, so that if previous = -1 it returns no link or the last one, and that if next = more than the number of pages, there is no link, or it goes to the first page. Is this what you need?