dude, if you want your own forum to work with your existing user accounts and do it all in one big table, here you go:
table schema:
create table postings (
message_id INT NOT NULL PRIMARY KEY auto_increment,
owner_id INT,
headline varchar(255),
body TEXT,
thread INT,
forum INT,
in_reply_to INT,
date_posted timestamp(14),
owner_name varchar(64),
owner_email varchar(255)
);
create table forums (
forum_id INT NOT NULL PRIMARY KEY auto_increment,
name varchar(255),
description(255)
);
ok... there is your tables.
I'll assume you already have a login system for your site, and store the user id in a variable called $saved_id, the name in $saved_name, and email in $saved_email. if not, a login system is simple
<?php
if($action=="view_all_forums") {
view_all_forums();
} elseif($action=="view_forum") {
view_forum($forum_id);
} elseif($action=="view_thread") {
view_thread($thread_id);
} elseif($action=="view_message") {
view_message($message_id);
} elseif($action=="show_add_new_message") {
show_add_new_message($in_reply_to_message_id);
} elseif($action=="add_new_message") {
add_new_message($in_reply_to_message_id, $headline, $body);
} elseif($action=="show_add_new_forum") {
show_add_new_forum();
} elseif($action=="add_new_forum") {
add_new_forum($new_forum_name);
} else {
view_all_forums();
}
function view_all_forums() {
// duh
}
function view_forum($forum_id) {
// get the top 100 or so posts from this forum and show them.
SELECT * FROM posting ORDER BY date_posted DESC LIMIT 100
}
this is too trivial and time consuming to go on... i will guarantee this structure is TERRIBLE and will become unusable after around 100000 posts with active use. if you want one table, this is pretty simple... otherwise take phorum and build a registration system into it if there isn't one... not really rocket science
?>