Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: threaded display of replies

by Masem (Monsignor)
on Apr 28, 2001 at 00:14 UTC ( [id://76255]=note: print w/replies, xml ) Need Help??


in reply to threaded display of replies

Assuming that all the data contains is the node number and the node number of the parent node, you simply cannot find all children; you can only work backwards up from a node to the parent.

However, and where it will get messy, is to take the child node, find it's parent (and all nodes in between), then increament on the node number starting with the ultimate parent node; if the parent of that node is one that is in the thread already, add it to the thread. This will get trees like:

P +--1 +--2 +--3 +--4 +--5 <- the current node +--6 +--7 +--8
Without increamenting on the node number, you cannot get 6, 7 and 8. Nor would you get 2.


Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://76255]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2025-07-11 12:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.