Webmastersite.net
Register Log In

NEXT button in comments.php

Comments on NEXT button in comments.php

david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Jul 24, 2005 - 12:39 AM:

Hello,

I have an online documentation that I would need a NEXT and PREVIOUS button for, in the link details (comments.php) page. I have an extra field for each link (for internal tracking) that is their chapter number. This is a number, such as 01,02,03...11,12,13 etc.

Since I called the field CHAPTER, is there such a thing like {NEXTCHAPTER} and {PREVIOUSCHAPTER} that I could create, which would know the next incrementing number in that field?

OR

Something like {PREVIOUSCHAPTER+1} or something along those lines? Something to tell an A HREF that the link is to point to the link that is THISLINKCHAPTER+1 ? In this case, how would it know that after 09, comes 10 and not 010?

OR any other trick that I missed when reading the manual?

THanks
David
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jul 24, 2005 - 12:39 PM:

Except for your leading 0s, <?php echo {LINKCHAPTER} + 1; ?> would work. You'll have to figure out how to detect the ending though.
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Jul 24, 2005 - 12:44 PM:

That's perfect. That's what I needed. I can use that. smiling face

Thx again Paul.
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Jul 24, 2005 - 1:09 PM:

Hmmm... maybe not.

Ok, so I can figure out what is the next chapter, but I cannot use that in a URL, since the URL is off of the ID of the link. Is there anything like 'GET ID of link in current category WHERE LINKCHAPTER + 1' ? Or something like that?

I mean, besides literally placing the links into the database in the correct order, there is no way to create such NEXT and PREVIOUS buttons? Anybody?

Thanks
David
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jul 24, 2005 - 7:05 PM:

You're talking about adding a noticable load to pages there, and it's basically a custom project anyway. And I don't see what the purpose of your 'chapter' is when it wouldn't specify what book it's a chapter of. Sounds like you're trying to create a linked list really, so it should contain a pointer to the next link, but that's a whole different script of sorts and I don't see why it wouldn't make a lot more sense to put all chapters of the same book under one subcategory (or even all under one link).
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Jul 24, 2005 - 7:29 PM:

K. sad

In that case, is there something like {LINKLISTOFTHISSUBCATEGORY} or something that would list the title of the links within a subcategory.

Let me explain what I am trying to do here.

I have a series of online manuals. I placed the different books in categories. Then I placed the Main chapters under them as sub-categories. Then I placed links into each of these subcategories for the actual pages (subchapters if you will). Since this is a book, the pages must come in sequential order. This is not possible to achieve, because the natural sorting seems to be 1,10,11,12,2,3,4.... . That is wrong in the case of this book, since it has to be 8,9,10,11... .

So I created an extra link field, called chapter. This is a hidden field that I use only for the sorting on display. See, this way I can assign a 01,02,03... to the pages, and therefore they appear in normal order.

Anyways, what the problem is, is that when you are viewing the details of a link (reading the page), I would need something that can go to the next and previous link (page). What you suggest would still not solve my problem.

So, in this case, is there a way to display the title of the links that reside in the same subcategory? Sort of like a top list for the current subcategory.

Thanks
David
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jul 26, 2005 - 1:03 AM:

In that case, is there something like {LINKLISTOFTHISSUBCATEGORY} or something that would list the title of the links within a subcategory.

That would be a fairly simple toplist, I'd think. Just a condition catid={LINKCATID} if being used on comments/details page.

This is not possible to achieve, because the natural sorting seems to be 1,10,11,12,2,3,4

That means you created the field as a text field. If you'd created it as an integer, or you simply go into phpmyadmin now and make an integer, it would sort like integers do.
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Jul 26, 2005 - 1:33 AM:

Can I say, DUH! You know, I have thought about that, but no idea why I didn't use integers for this problem
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.