Steve Yelvington wrote:
See http://stonemountain.yi.org/README for a brief discussion of why linear discussions usually work better than threaded.
But in general, a technique for supporting tree structures would look like this:
Every object has a unique ID and a parentID.
A root object has a parentID=0. To make a child object, set the parentID to the ID of the parent.
Write a recursive function to retrieve/display objects and their children. In other words:
function findstuff($id)
{
// do SQL to find all where id=$id
// print out the result (or links, etc)
// then ...
// for each item in the result set
findstuff($parentID);
}
With a little bit of formatting, the result might look like this:
Foo
Re: Foo
You're an idiot (was Re: Foo)
Re: Foo
Bar
Re: Bar
Re: Bar
Re: Bar
Rebar is for concrete (was Re: Bar)
Re: Bar
How do you format it so that it looks like above or like the way it is set in PHP Builder? Please help.
Thankyou.
--bav--