• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
a question about 'nested sets'

#1
[eluser]arlong[/eluser]
hi.my english is not good.
i want make a commenting system like reddit.(http://www.reddit.com/r/funny/comments/f...ng_in_the/)
im using fot nested sets model(http://codeigniter.com/wiki/Nested_sets/).
but it is not maked for a commenting system.itis maked for a recursive menu system(i think).


how can i adaptation this model(adaptation) for my commenting system?

#2
[eluser]WanWizard[/eluser]
Nested sets are about hierarchical data structures, or tree structures.

All you need is a table with an (autoincrement) id column, and left- and right pointer columns. These tree columns define the tree structure. What other fields you add to the table is up to you.

To implement such a structure, simply add any reply as last child of the message id being replied to.

#3
[eluser]arlong[/eluser]
id, right,left is not?
could you write a example?
i cant make a database plan for this commenting system.

#4
[eluser]WanWizard[/eluser]
There's an example in the zip file, and some comments on the wiki page.

If, based on the information provided, you're unable to create a table (there's even an example sql file included), I suggest you read up on nested sets first, so you understand what they do and how they work.

I don't use the code from the wiki, so I don't have an example for you.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.