<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Reordering nested sets using PHP and Javascript</title>
	<atom:link href="http://www.dotvoid.com/2007/09/reordering-nested-sets-using-php-and-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotvoid.com/2007/09/reordering-nested-sets-using-php-and-javascript/</link>
	<description>Experiments and thoughts in PHP and javascript</description>
	<lastBuildDate>Sat, 04 Sep 2010 10:02:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Danne</title>
		<link>http://www.dotvoid.com/2007/09/reordering-nested-sets-using-php-and-javascript/comment-page-1/#comment-1166</link>
		<dc:creator>Danne</dc:creator>
		<pubDate>Mon, 19 Oct 2009 14:30:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=235#comment-1166</guid>
		<description>Thanks for sharing! I haven&#039;t tested it but I&#039;ll make a note to on testing it as soon as possible. Oh - I amended the code in your amendment and removed your third comment on how to amend your amendment to not confuse people ;)</description>
		<content:encoded><![CDATA[<p>Thanks for sharing! I haven&#8217;t tested it but I&#8217;ll make a note to on testing it as soon as possible. Oh &#8211; I amended the code in your amendment and removed your third comment on how to amend your amendment to not confuse people <img src='http://www.dotvoid.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kungfuyou</title>
		<link>http://www.dotvoid.com/2007/09/reordering-nested-sets-using-php-and-javascript/comment-page-1/#comment-1164</link>
		<dc:creator>Kungfuyou</dc:creator>
		<pubDate>Mon, 19 Oct 2009 14:23:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=235#comment-1164</guid>
		<description>Amended code to this: 

$plvl++;
 $cnt = count($rows) * 2;
 $leftovers = count($stack);
  
  for( $n = 0; $n &lt; $leftovers; $n++) {
  	
	$pid = array_pop($stack);
	$plvl--;
	$rows[$pid][2] = $cnt - $plvl + $n;
	$cnt--;	
  }

and seems to work for me.</description>
		<content:encoded><![CDATA[<p>Amended code to this: </p>
<p>$plvl++;<br />
 $cnt = count($rows) * 2;<br />
 $leftovers = count($stack);</p>
<p>  for( $n = 0; $n &lt; $leftovers; $n++) {</p>
<p>	$pid = array_pop($stack);<br />
	$plvl&#8211;;<br />
	$rows[$pid][2] = $cnt &#8211; $plvl + $n;<br />
	$cnt&#8211;;<br />
  }</p>
<p>and seems to work for me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kungfuyou</title>
		<link>http://www.dotvoid.com/2007/09/reordering-nested-sets-using-php-and-javascript/comment-page-1/#comment-1161</link>
		<dc:creator>Kungfuyou</dc:creator>
		<pubDate>Mon, 19 Oct 2009 11:00:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=235#comment-1161</guid>
		<description>The last part of the function:

$plvl++;
  $cnt = count($rows) * 2;
  $leftovers = count($stack);

  for($n = 0; $n &lt; $leftovers; $n++) {
    $pid = array_pop($stack);
    $rows[$pid][2] = $cnt - $plvl-- + $n;
  }

is not creating the correct rgt values.</description>
		<content:encoded><![CDATA[<p>The last part of the function:</p>
<p>$plvl++;<br />
  $cnt = count($rows) * 2;<br />
  $leftovers = count($stack);</p>
<p>  for($n = 0; $n &lt; $leftovers; $n++) {<br />
    $pid = array_pop($stack);<br />
    $rows[$pid][2] = $cnt &#8211; $plvl&#8211; + $n;<br />
  }</p>
<p>is not creating the correct rgt values.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krasimir Kazakov</title>
		<link>http://www.dotvoid.com/2007/09/reordering-nested-sets-using-php-and-javascript/comment-page-1/#comment-416</link>
		<dc:creator>Krasimir Kazakov</dc:creator>
		<pubDate>Wed, 18 Feb 2009 10:58:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=235#comment-416</guid>
		<description>For easy moving of record up and down on the same level in a nested tree, i have method in my nestedTree class which does it correctly. I haven&#039;t added possibility to move given id to different parent.

Someone might be interested ...

http://knowledge.drun.net/viewtopic.php?id=37</description>
		<content:encoded><![CDATA[<p>For easy moving of record up and down on the same level in a nested tree, i have method in my nestedTree class which does it correctly. I haven&#8217;t added possibility to move given id to different parent.</p>
<p>Someone might be interested &#8230;</p>
<p><a href="http://knowledge.drun.net/viewtopic.php?id=37" rel="nofollow">http://knowledge.drun.net/viewtopic.php?id=37</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Основы организации древовидных структур в базах данных (Nested Sets) &#124; Журнал веб разработчика</title>
		<link>http://www.dotvoid.com/2007/09/reordering-nested-sets-using-php-and-javascript/comment-page-1/#comment-369</link>
		<dc:creator>Основы организации древовидных структур в базах данных (Nested Sets) &#124; Журнал веб разработчика</dc:creator>
		<pubDate>Sat, 13 Dec 2008 09:33:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=235#comment-369</guid>
		<description>[...] &#8226; http://www.zapatec.com/website/main/products/prod3/demo.jsp &#8226; http://www.dotvoid.com/2007/09/reordering-nested-sets-using-php-and-javascript/ &#8226; Drag and drop using Ext JS with the CakePHP Tree Behavior &#8226; [...]</description>
		<content:encoded><![CDATA[<p>[...] &bull; <a href="http://www.zapatec.com/website/main/products/prod3/demo.jsp" rel="nofollow">http://www.zapatec.com/website/main/products/prod3/demo.jsp</a> &bull; <a href="http://www.dotvoid.com/2007/09/reordering-nested-sets-using-php-and-javascript/" rel="nofollow">http://www.dotvoid.com/2007/09/reordering-nested-sets-using-php-and-javascript/</a> &bull; Drag and drop using Ext JS with the CakePHP Tree Behavior &bull; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CoffeeBlack</title>
		<link>http://www.dotvoid.com/2007/09/reordering-nested-sets-using-php-and-javascript/comment-page-1/#comment-353</link>
		<dc:creator>CoffeeBlack</dc:creator>
		<pubDate>Sat, 29 Nov 2008 00:38:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=235#comment-353</guid>
		<description>This function is not working correctly. At least with 4th level menu..</description>
		<content:encoded><![CDATA[<p>This function is not working correctly. At least with 4th level menu..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick Allaert</title>
		<link>http://www.dotvoid.com/2007/09/reordering-nested-sets-using-php-and-javascript/comment-page-1/#comment-10</link>
		<dc:creator>Patrick Allaert</dc:creator>
		<pubDate>Fri, 12 Sep 2008 16:13:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=235#comment-10</guid>
		<description>Hi,

The adjacency list model and the nested set model aren&#039;t the only one, a less popular one is using the path enumeration model which extends the adjacency list model in a very practical way. You may find more info on my post about &lt;a href=&quot;http://patrickallaert.blogspot.com/2008/05/hierarchical-data-in-mysql-and-other.html&quot; title=&quot;Hierarchical data in MySQL (and other RDBMS)&quot; rel=&quot;nofollow&quot;&gt;hierarchical data in MySQL&lt;/a&gt; which summaries the 3 models.

Using the path enumeration model you should be able to easily extract the depth of a node counting the number (-1) of &#039;/&#039; in the path.

Regards,
Patrick Allaert</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>The adjacency list model and the nested set model aren&#8217;t the only one, a less popular one is using the path enumeration model which extends the adjacency list model in a very practical way. You may find more info on my post about <a href="http://patrickallaert.blogspot.com/2008/05/hierarchical-data-in-mysql-and-other.html" title="Hierarchical data in MySQL (and other RDBMS)" rel="nofollow">hierarchical data in MySQL</a> which summaries the 3 models.</p>
<p>Using the path enumeration model you should be able to easily extract the depth of a node counting the number (-1) of &#8216;/&#8217; in the path.</p>
<p>Regards,<br />
Patrick Allaert</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eirik Hoem</title>
		<link>http://www.dotvoid.com/2007/09/reordering-nested-sets-using-php-and-javascript/comment-page-1/#comment-2</link>
		<dc:creator>Eirik Hoem</dc:creator>
		<pubDate>Fri, 12 Sep 2008 11:55:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.commodi.com/?p=235#comment-2</guid>
		<description>Hia,

we had a similar problem some time ago, and we went for the same algorithm. We support adding, moving and removing nodes. Took us some time to get it all right.. especially moving a branch (with children) from anywhere in a tree to another place in the same tree, or place it in a new one. I spent some time looking for alternate solutions, but I ended up on this one.</description>
		<content:encoded><![CDATA[<p>Hia,</p>
<p>we had a similar problem some time ago, and we went for the same algorithm. We support adding, moving and removing nodes. Took us some time to get it all right.. especially moving a branch (with children) from anywhere in a tree to another place in the same tree, or place it in a new one. I spent some time looking for alternate solutions, but I ended up on this one.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
