DB_NestedSet, TreeMenu and different sort modes per node

From: Date: Thu, 29 May 2003 15:33:29 +0000
Subject: DB_NestedSet, TreeMenu and different sort modes per node
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-5679@lists.php.net to get a copy of this message
Hi there, I´m considering using DB_NestedSet for my future tree implementations. Before, I´ve always used a simple self-referencing tree using node_id and parent_id - which is easy and flexible but unfortunately quite slow as well. After reading the examples, I think I have a pretty good idea how this thing works together with HTML_TreeMenu, which is my favourite tool for displaying trees. I only have one issue... sorting the nodes. In my tree, every node can have an option "sortMode" which determines how all childnodes of the current node should be sorted. Possible sort modes can be "by name", "by number (manually ordered)", "by date" (using a datetime field in the node table). All those can either be used ascending or descending. So I have six possible sort modes, and the mode can vary from node to node. How can I implement this with DB_NestedSet? Is it possible? From what I´ve read, I can only choose one sort mode that is then applied to all nodes in the tree. Any hints are appreciated. Regards, Markus

« previous php.pear.general (#5679) next »