How the subforums work

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
parry60
Registered User
Posts: 5
Joined: Fri May 09, 2003 9:00 pm

How the subforums work

Post by parry60 »

Little question here.
Quite a while ago, I asked how the jumpbox was able to categorize the forums into pretty looking indents. I have since read the source and am now completely confused.
So here's my question: what do the right_id and left_id fields in the database do?

Thanks,
Will
-----BEGIN GEEK CODE BLOCK-----
GCS d- s:- a---- C++++ UL++++ P+ L+++ E- W+++ N+ o K+ w---
O- M+ V-- PS+++ PE-- Y+ PGP t 5 X R tv-- b++ DI+ D+
G e-- h! r-- y
------END GEEK CODE BLOCK------

Dean
Registered User
Posts: 3
Joined: Mon Feb 11, 2002 8:47 pm

Re: How the subforums work

Post by Dean »

Have a search for the field names in the source code, then you might be able to see what the code is doing.

hasten
Registered User
Posts: 63
Joined: Mon Mar 31, 2003 7:49 am

Re: How the subforums work

Post by hasten »

I've only skimmed through the phpBB 2.1 code, but it looks like they're using a tree structure to store and retrieve the forum categories.

This article on SitePoint explains how tree structures work in conjunction with databases.

Hope this helps. I was wondering about how subforums work, too.

hasten
Registered User
Posts: 63
Joined: Mon Mar 31, 2003 7:49 am

Re: How the subforums work

Post by hasten »

I've read the article I referred to in the previous post, and I've looked at the phpBB code.

God I love this new forum/subforum implementation. It uses something called the Modified Preorder Tree Traversal algorithm. You pay a higher insert perfomance penalty, but new forums/subforums will only be created seldomly. Plus, the administrator will be the only person inserting new forums/subforums, and

On the other hand, selecting forums and their ancestors will be used far more often. In phpBB 2.2, it's fast, requiring only one, simple query (*stops to marvel at the developer's choice to use a tree structure, why didn't I think of that?*).

phpBB 2.2's forum/subforums implementation also allows for an unlimited subforums, and allows for the forums to go as in deep as you can imagine.

Compared to vBulletin 3.0, phpBB's implementation is much cleaner. vB 3.0 does not employ a tree structure to store forum categories. Instead, each forum/subforum keeps a comma seperated list of parent forums in a varchar(250) field, and a list of a comma seperated list of child forums in a varchar(250) field. Eww... it's really unclean.

IPB 1.3 does not support subforums. It's only in IBP 2.0 that subforums are supported, but that version is only in its alpha phase. I haven't looked at IPB's implementation yet.

Roberdin
Registered User
Posts: 1546
Joined: Wed Apr 09, 2003 8:44 pm
Location: London, United Kingdom

Re: How the subforums work

Post by Roberdin »

hasten wrote:IPB 1.3 does not support subforums. It's only in IBP 2.0 that subforums are supported, but that version is only in its alpha phase. I haven't looked at IPB's implementation yet.
I can assure you it does, but only to a limited number of levels.
Rob

hasten
Registered User
Posts: 63
Joined: Mon Mar 31, 2003 7:49 am

Re: How the subforums work

Post by hasten »

Roberdin wrote:I can assure you it does, but only to a limited number of levels.
Oh. Thanks for the correction.

User avatar
psoTFX
Registered User
Posts: 1984
Joined: Tue Jul 03, 2001 8:50 pm
Contact:

Re: How the subforums work

Post by psoTFX »

One level

Roberdin
Registered User
Posts: 1546
Joined: Wed Apr 09, 2003 8:44 pm
Location: London, United Kingdom

Re: How the subforums work

Post by Roberdin »

If ur gonna do something, at least do it well. :)
Rob

parry60
Registered User
Posts: 5
Joined: Fri May 09, 2003 9:00 pm

Re: How the subforums work

Post by parry60 »

Wow.
When I'm done implementing this in my blogger, I'm putting a psoTFX worship in a comment block. :)
-----BEGIN GEEK CODE BLOCK-----
GCS d- s:- a---- C++++ UL++++ P+ L+++ E- W+++ N+ o K+ w---
O- M+ V-- PS+++ PE-- Y+ PGP t 5 X R tv-- b++ DI+ D+
G e-- h! r-- y
------END GEEK CODE BLOCK------

User avatar
psoTFX
Registered User
Posts: 1984
Joined: Tue Jul 03, 2001 8:50 pm
Contact:

Re: How the subforums work

Post by psoTFX »

You best put an Ashe comment too :) I came up with the approach but Ashe was the one who then put the basic code in place.

Post Reply