Jump to content

Recommended Posts

personally i'd go with the adding of a new field - i.e, parent_id - and keep all the forums and subforums in the same table. This way, if you decided (for example) to add a 'forum description', or perform a restructure, then you're only handling a single table and not two.

 

Also when it comes to dealing with stuff like posts/topics/forum permissions, etc, having a single, consistent table will be much easier to code for.

 

id
active (ENUM, y or n)
parent_id
title
description
...etc...

Link to comment
https://forums.phpfreaks.com/topic/41185-forum-software-help/#findComment-199694
Share on other sites

  • 3 weeks later...

personally i'd go with the adding of a new field - i.e, parent_id - and keep all the forums and subforums in the same table. This way, if you decided (for example) to add a 'forum description', or perform a restructure, then you're only handling a single table and not two.

 

Also when it comes to dealing with stuff like posts/topics/forum permissions, etc, having a single, consistent table will be much easier to code for.

 

id
active (ENUM, y or n)
parent_id
title
description
...etc...

 

I agree with this, just assign a parent_id of 0 to all top level forums, then all others can use the unique id as their parent id. One of my big projects right now uses XMB forums and that's the way they do it. I have also used it for a simplified structure for a resource browser that uses a directory structure.

 

The subforum table is very discouraged, because what happens if you want to create sub-sub-forums, or sub-sub-sub forums. Then you are multiplying your workload.

Link to comment
https://forums.phpfreaks.com/topic/41185-forum-software-help/#findComment-211318
Share on other sites

  • 4 weeks later...

yea, creating one table for all the forums i would think is the most efficient way of doing this.  I will mostly likely be build my own forum system for my project management system and that is the way i would ever consider doing the forum table.  This way you don't limit yourself on how many subforums you can have and does make coding easier besuase you will only have 1 table to deal with wether is it a top level forum and a sub forum.

Link to comment
https://forums.phpfreaks.com/topic/41185-forum-software-help/#findComment-227060
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.