建立论坛的有效方式 [英] Efficient way to build a forum
问题描述
你好。
这不是一个PHP问题,但我想你们应该知道;-)
我正在使用Borland Delphi的
WebServices为我的一个朋友建立一个论坛。这将是一个相当小的一个,只有大约十人,旧的
帖子将在3个月后删除。
来自Delphi方面,我知道怎么做但是我不确定在保存线程时如何保持分层结构
。现在,我会将每个帖子(以及每个回复)存储在服务器上的单独的.txt中,写下
它的ID和时间戳进入并记住这是孩子的帖子(如果有的话)。
必须有更好的方法。所以有人能告诉我这个任务是如何在PHP中完成的?
?请不要发布任何PHP源代码,我只想知道
通常如何做,我会尝试用Delphi来做。
提前致谢
Mike
Hi there.
This is not really a PHP-question, but I think you guys should know that ;-)
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.
Thanks in advance
Mike
推荐答案
2003年11月20日星期四09:33: 33 +0100,Michael Trojanek
< tr*@adv.magwien.gv.at>写道:
On Thu, 20 Nov 2003 09:33:33 +0100, "Michael Trojanek"
<tr*@adv.magwien.gv.at> wrote:
我正在使用Borland Delphi的Web服务为我的一个朋友建立一个论坛。这将是一个相当小的一个,只有大约十个人,旧的
帖子将在3个月后被删除。
从德尔福方面,我知道如何做但我'在保存线程时,我不确定如何保持层次结构。现在,我会将每个帖子(以及每个回复)存储在服务器上的单独的.txt中,写下它的ID和时间戳并记住它的子帖子( s)(如果有的话)。
必须有更好的方法。那么有谁能告诉我这个任务是如何在PHP中完成的?请不要发布任何PHP源代码,我只是想知道
通常是怎么做的,我会尝试用Delphi来做。
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.
在PHP中,它通常是数据库驱动的。
最简单的方法是使用主题表和帖子表。 posts表中的每一行
可能指向一个父帖子,或者它自己(如果它是根帖子的
),并且主题表用于stagelast post,
" num replylies"列出主题时要避免开销。
您通常也会将邮件正文放在一个单独的表中。
您可以在顶部构建当然还有主题部分等,但是
以上解释了基础知识。
kafooey
- ka ***** @ nospam.yahoo.co.uk
- http://www.pluggedout.com/blog
每个答案都有其父级的id。
id = 0表示线程头(没有父级)。
递归函数可以在消息中找到它们的方式树非常容易。
更好地使用数据库而不是平面文件来存储消息。
Nicolas
Each answer has the id of its parent.
id = 0 for heads of threads (no parent).
Recursive functions can find their ways in the messages tree very easily.
Better use a database than flat files to store the messages.
Nicolas
Nicolas写道:
Nicolas wrote:
每个答案都有其父级的id。
id = 0表示线程头(没有父级)。
我还会包含一个线程ID来轻松选择所有相关消息。
递归函数可以很容易地在消息树中找到它们的方式。
最好使用数据库而不是平面文件来存储消息。
绝对
Nicolas
Each answer has the id of its parent.
id = 0 for heads of threads (no parent).
I would also include a thread id to select all related messages easily.
Recursive functions can find their ways in the messages tree very easily.
Better use a database than flat files to store the messages.
Definitely
Nicolas
这篇关于建立论坛的有效方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!