Hmmm. Perhaps I should have put this in the databases forum, but now I don't see how to delete it...
I want a php-based forum I can install as the contents of a DIV, rather than as a independent page (no HTML, HEAD and BODY) There are a few simple ones out there, but none that support a "hierarchical, threaded message" view, which I also want.
So I'm thinking about writing my own bare bones but threaded forum.
Perhaps this could be done with three tables: user, forum and post,
where the post.parent_post_id would be zero for thread heads.
post.indent_count would be one more than the indent_count for the parent_post_id.
Ordering the display, so all the first level children of post_id = X would appear both indented and below the parent subject line could be ddone with an enormously expensive recursive procedure. But I doubt that's a good idea.
There must be a way to use a table similar to what is below, combined with "order by" and "group by" ....perhaps using a cursor or two, to pull out the posts in the requisite order, and where post.indent_count kludges the hierarchical display
...or am I barking up an impossible tree?
CREATE TABLE post (
post_id int(4) NOT NULL auto_increment,
forum_id int(4) NOT NULL references forum(fid),
user_id int(4) NOT NULL references thread_user(uid),
parent_post_id int(4) NOT NULL default 0 references comment(cid),
indent_count int(4) NOT NULL default 0,
title varchar(96) NOT NULL,
PRIMARY KEY (post_id)