Hey,
can me tell someone for which, the columns "left_id" and "right_id" in the table "forums", it is? and how it builds itself when i insert a forum in the admin panel?
thx, i hope you understand me!?
Frank
what does left_id and right_id in the table forums?
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!
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!
-
- Registered User
- Posts: 5
- Joined: Fri Jun 15, 2007 7:47 am
-
- Registered User
- Posts: 5
- Joined: Fri Jun 15, 2007 7:47 am
- A_Jelly_Doughnut
- Registered User
- Posts: 1780
- Joined: Wed Jun 04, 2003 4:23 pm
Re: what does left_id and right_id in the table forums?
The two columns constitute a binary tree.
http://en.wikipedia.org/wiki/Binary_tree
http://en.wikipedia.org/wiki/Binary_tree
A_Jelly_Doughnut
Re: what does left_id and right_id in the table forums?
It's just a general tree and not a binary tree as you can have more then just 2 subforums in a forum
The numbers are necessary to efficiently use a tree stored in a relational database. There's an interesting tutorial explaining the basics on sitepoint: http://www.sitepoint.com/article/hierar ... a-database
-
- Registered User
- Posts: 66
- Joined: Sun Oct 10, 2004 3:21 am
- Location: Munich (Germany)
- Contact:
Re: what does left_id and right_id in the table forums?
The structure is called a Nested set 
It's a special kind of tree: you store the tree in a linear structure (your database) and re-assemble it into a tree in linear time complexity. Of course, completely rebuilding the tree or adding/deleting items is not completely trivial, but since those actions are not done that often, it doesn't matter that much.
Greetz
alcaeus
It's a special kind of tree: you store the tree in a linear structure (your database) and re-assemble it into a tree in linear time complexity. Of course, completely rebuilding the tree or adding/deleting items is not completely trivial, but since those actions are not done that often, it doesn't matter that much.
Greetz
alcaeus
Re: what does left_id and right_id in the table forums?
This was the closest thing to the answer I want. Can anyone please tell me how I would make the numbers for these columns? Does it matter? Thanks for any answers.
Re: what does left_id and right_id in the table forums?
Did you take a look at the code in the acp to add forum and/or modules?
Re: what does left_id and right_id in the table forums?
I did look but probably not enough. I'll look again tomorrow.
Re: what does left_id and right_id in the table forums?
The sitepoint article linked above gives details about how the numbers are allocated.
Re: what does left_id and right_id in the table forums?
They're for sub-forums, right? So you know what the parent forum is, and what the child forum is.
This is my assumption, anyway.
This is my assumption, anyway.