a question about 'nested sets' - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: a question about 'nested sets' (/showthread.php?tid=39354) |
a question about 'nested sets' - El Forum - 03-08-2011 [eluser]arlong[/eluser] hi.my english is not good. i want make a commenting system like reddit.(http://www.reddit.com/r/funny/comments/fzuhv/my_reaction_to_waking_up_and_studying_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? a question about 'nested sets' - El Forum - 03-08-2011 [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. a question about 'nested sets' - El Forum - 03-08-2011 [eluser]arlong[/eluser] id, right,left is not? could you write a example? i cant make a database plan for this commenting system. a question about 'nested sets' - El Forum - 03-08-2011 [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. |