On Thu, 20 Nov 2003 09:33:33 +0100, "Michael Trojanek"
<tro@adv.magwien.gv.at> wrote:
[color=blue]
>I am building a forum for a friend of mine using Borland Delphi's
>WebServices. It will be a rather small one, for just about ten people, older
>postings will be deleted after 3 months.
>
>From the Delphi-side, I know how to do it but I'm not sure about how to keep
>the hierachical structure when saving the threads. Right now, I would store
>each post (and therefore each reply) in a seperate .txt on the server, write
>it's ID and timestamp into and remember it's child-post(s) (if it has one).
>
>There has to be a better way. So could anyone tell me how this task is
>accomplished in PHP? Please don't post any PHP-source, I just want to know
>how it is usually done and I'll try to do that using Delphi.[/color]
In PHP it's usually database driven.
The easiest way is to have a topics table and a posts table. Each row
in the posts table may point to a parent post, or to itself (if it's
the root post), and the topics table is used to stage "last post",
"num replies" etc to avoid overhead when listing topics.
You would normally put the message bodies in a seperate table too.
You can build on top of that of course with topic sections etc, but
the above explains the basics.
kafooey
-
kafooey@nospam.yahoo.co.uk
-
http://www.pluggedout.com/blog