1. This code does not presume to be the best way to write forums. In fact it
has some crazy things in it that could be done better. It's the result of somewhat
random hacking, while I learned some interesting things from ASP.NET 2.0 Website Programming Problems-Design - Solution
The database tables have cascading delete relations in them, thus if you drop (delete)
a topic (forum), you will also drop all its threads and messages. If you drop a thread,
all the messages will go too.
There is a threaded hierarchy in the messages table (parentmsgid) which allows you
to build a threaded view (for example using the tree control). It's not used in this code,
but it's there. That's why there's a Threads table too. If you delete the only message in a
thread without using the DeleteMessage stored procedure, you will leave an orphaned thread
in the threads table.
Sections are actually also forums. They can have threads inside them that only admins
can reach (via the jump column in the forum management page). One use of this might be to
allow moderators to have a private forum pertaining to a whole section. You could of course also
use an invisible forum for this purpose. The invisible forum is mainly there so you can create a
forum and get it all set up with FAQs and whatnot before you make it visible to users.
I suggest you start with increments of 10,20,30 and so on so you can easily insert
new forums or sections between existing ones.
Try Atlas - wrapping the threads gridview inside an update panel works a treat
Are there bugs? Almost certainly. But it works pretty well. If you find anything awful,
let me know at http://m.aatechsources.com/ :)
If you find the code is useful to you, please drop me a line at email@example.com