<?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>Kommentare zu: Wie erstelle ich eine HTML-Liste aus einem Nested-Set?</title>
	<atom:link href="http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/feed/" rel="self" type="application/rss+xml" />
	<link>http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/</link>
	<description>Optimierung und Tipps zur Beschleunigung von PHP und MySQL</description>
	<lastBuildDate>Tue, 01 May 2012 16:51:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>Von: hpoe</title>
		<link>http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/comment-page-1/#comment-31617</link>
		<dc:creator>hpoe</dc:creator>
		<pubDate>Thu, 29 Apr 2010 13:50:04 +0000</pubDate>
		<guid isPermaLink="false">http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/#comment-31617</guid>
		<description>@Markus: danke f&#252;r deine Korrektur, es ging mir mehr ums prinzipielle daran! Es ist etwas verwirrend wenn im Kommentar das Array $hierarchy heisst und nachher mit $baum gearbeitet wird. 

@stega: deine Frage ist etwas sehr weit gefasst, da es darauf an kommt, welches DB Interface vervendet wird. Ein ganzes Array auf einmal, ohne durch das Resultat der Query zu loopen und das Array selbst zu bauen gibt es nur mit PDO.</description>
		<content:encoded><![CDATA[<p>@Markus: danke f&#252;r deine Korrektur, es ging mir mehr ums prinzipielle daran! Es ist etwas verwirrend wenn im Kommentar das Array $hierarchy heisst und nachher mit $baum gearbeitet wird. </p>
<p>@stega: deine Frage ist etwas sehr weit gefasst, da es darauf an kommt, welches DB Interface vervendet wird. Ein ganzes Array auf einmal, ohne durch das Resultat der Query zu loopen und das Array selbst zu bauen gibt es nur mit PDO.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: shanxp</title>
		<link>http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/comment-page-1/#comment-31523</link>
		<dc:creator>shanxp</dc:creator>
		<pubDate>Mon, 26 Apr 2010 08:29:25 +0000</pubDate>
		<guid isPermaLink="false">http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/#comment-31523</guid>
		<description>Hi,
diesen Beitrag hat mir auch sehr sehr geholfen - Danke an alle ! :)</description>
		<content:encoded><![CDATA[<p>Hi,<br />
diesen Beitrag hat mir auch sehr sehr geholfen &#8211; Danke an alle ! <img src='http://phpperformance.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: stega</title>
		<link>http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/comment-page-1/#comment-31293</link>
		<dc:creator>stega</dc:creator>
		<pubDate>Thu, 15 Apr 2010 19:42:38 +0000</pubDate>
		<guid isPermaLink="false">http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/#comment-31293</guid>
		<description>Kurz Frage zum Ausgabeskript von Markus Winkelmann:

am Anfang soll das Array stehen, das dann verarbeitet wird. Wie kann ich denn meine Daten so ins Array laden, dass sie dann korrekt verarbeitet werden? Ich habe es mit mysql_fetch_assoc probiert, aber er bringt nur die erste &quot;id&quot; Spalte dann in der Anzeige. Und auch mit mysql_fetch_assoc funktioniert die Ausgabe leider nicht...

danke f&#252;r eure Hilfe - super Tutorial!!!</description>
		<content:encoded><![CDATA[<p>Kurz Frage zum Ausgabeskript von Markus Winkelmann:</p>
<p>am Anfang soll das Array stehen, das dann verarbeitet wird. Wie kann ich denn meine Daten so ins Array laden, dass sie dann korrekt verarbeitet werden? Ich habe es mit mysql_fetch_assoc probiert, aber er bringt nur die erste &#034;id&#034; Spalte dann in der Anzeige. Und auch mit mysql_fetch_assoc funktioniert die Ausgabe leider nicht&#8230;</p>
<p>danke f&#252;r eure Hilfe &#8211; super Tutorial!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: oj</title>
		<link>http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/comment-page-1/#comment-29574</link>
		<dc:creator>oj</dc:creator>
		<pubDate>Sun, 20 Dec 2009 12:06:48 +0000</pubDate>
		<guid isPermaLink="false">http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/#comment-29574</guid>
		<description>Dieser Beitrag hat mir sehr geholfen, Danke!</description>
		<content:encoded><![CDATA[<p>Dieser Beitrag hat mir sehr geholfen, Danke!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: andre</title>
		<link>http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/comment-page-1/#comment-26318</link>
		<dc:creator>andre</dc:creator>
		<pubDate>Tue, 13 Oct 2009 21:11:25 +0000</pubDate>
		<guid isPermaLink="false">http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/#comment-26318</guid>
		<description>und wie geht es z.b. 3 spalten layout und nested sets?</description>
		<content:encoded><![CDATA[<p>und wie geht es z.b. 3 spalten layout und nested sets?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Markus Winkelmann</title>
		<link>http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/comment-page-1/#comment-23125</link>
		<dc:creator>Markus Winkelmann</dc:creator>
		<pubDate>Thu, 30 Jul 2009 15:14:37 +0000</pubDate>
		<guid isPermaLink="false">http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/#comment-23125</guid>
		<description>@jan: danke f&#252;r deine tollen beitr&#228;ge &#252;ber nested sets! die haben mir u.a. sehr geholfen beim einstieg in die thematik.

@hpoe: dir auch einen riesen dank f&#252;r deine nicht rekursive version zur herstellung einer &quot;html ul nested set liste&quot;, allerdings erzeugt diese so in der form keinen validen quellcode. das ul-element darf nicht im ul-element stehen, sondern muss im li eingebaut sein.

Hier mein Code: &lt;pre lang=&quot;php&quot;&gt;/**
      Ausgangs Situation:
      resultset als Array $hierarchy mit den Feldern level, title
      root level = 0 (weil count(*) - 1 gesetzt wird
    */
    $level = -1; // kleiner als root level initialisieren
    $html = &quot;&quot;;
    foreach ($baum as $row) {
      // gelesenes Level kleiner als das letzte:
      // differenz an Leveln ermitteln und soviele &lt;/ul&gt; ausgeben
      if($row[&#039;level&#039;] &lt; $level) {
        $diff = $level - $row[&#039;level&#039;];
        $html .= &quot;&lt;/li&gt;\n&quot;;
        $html .= str_repeat(&quot;&lt;/ul&gt;&lt;/li&gt;\n&quot;, $diff);         }
      // gelesener Level  gr&#246;sser als Vergleichslevel: neue Stufe beginnen
      if($row[&#039;level&#039;] &gt; $level){ $html .= &quot;&lt;ul&gt;&quot;; }
          if($row[&#039;level&#039;] == $level) $html .= &quot;&lt;/li&gt;\n&quot;;
          // immer das &lt;li&gt; ... ausgeben
      $html .= &quot;&lt;li&gt;&quot;.$row[&#039;title&#039;];
          // falls level kleiner oder gleich vergleichslevel listitem schlie&#223;en
      //if($row[&#039;level&#039;] &lt; $level) $html .= &quot;&lt;/li&gt;&quot;;
      // Vergleichswert festhalten
      $level = $row[&#039;level&#039;];
    }
    // falls Vergleichslevel &gt;= 0, muss bis auf Level 0 abgetragen werdne
        if ($level &gt;= 0) $html .= str_repeat(&quot;&lt;/li&gt;&lt;/ul&gt;\n&quot;, $level);
    $html .= &quot;&lt;/li&gt;&lt;/ul&gt;\n&quot;;
    echo $html; &lt;/pre&gt;

gru&#223;, markus</description>
		<content:encoded><![CDATA[<p>@jan: danke f&#252;r deine tollen beitr&#228;ge &#252;ber nested sets! die haben mir u.a. sehr geholfen beim einstieg in die thematik.</p>
<p>@hpoe: dir auch einen riesen dank f&#252;r deine nicht rekursive version zur herstellung einer &#034;html ul nested set liste&#034;, allerdings erzeugt diese so in der form keinen validen quellcode. das ul-element darf nicht im ul-element stehen, sondern muss im li eingebaut sein.</p>
<p>Hier mein Code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
      Ausgangs Situation:
      resultset als Array $hierarchy mit den Feldern level, title
      root level = 0 (weil count(*) - 1 gesetzt wird
    */</span>
    <span style="color: #000088;">$level</span> <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// kleiner als root level initialisieren</span>
    <span style="color: #000088;">$html</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$baum</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">// gelesenes Level kleiner als das letzte:</span>
      <span style="color: #666666; font-style: italic;">// differenz an Leveln ermitteln und soviele &lt;/ul&gt; ausgeben</span>
      <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'level'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$level</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$diff</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$level</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'level'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;/li&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">str_repeat</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;/ul&gt;&lt;/li&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$diff</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>         <span style="color: #009900;">&#125;</span>
      <span style="color: #666666; font-style: italic;">// gelesener Level  grösser als Vergleichslevel: neue Stufe beginnen</span>
      <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'level'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$level</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;ul&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
          <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'level'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$level</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;/li&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
          <span style="color: #666666; font-style: italic;">// immer das &lt;li&gt; ... ausgeben</span>
      <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;li&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
          <span style="color: #666666; font-style: italic;">// falls level kleiner oder gleich vergleichslevel listitem schließen</span>
      <span style="color: #666666; font-style: italic;">//if($row['level'] &lt; $level) $html .= &quot;&lt;/li&gt;&quot;;</span>
      <span style="color: #666666; font-style: italic;">// Vergleichswert festhalten</span>
      <span style="color: #000088;">$level</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'level'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #666666; font-style: italic;">// falls Vergleichslevel &gt;= 0, muss bis auf Level 0 abgetragen werdne</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$level</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">str_repeat</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;/li&gt;&lt;/ul&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$level</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;/li&gt;&lt;/ul&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$html</span><span style="color: #339933;">;</span></pre></div></div>

<p>gru&#223;, markus</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Jan</title>
		<link>http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/comment-page-1/#comment-14864</link>
		<dc:creator>Jan</dc:creator>
		<pubDate>Sun, 10 Aug 2008 12:59:34 +0000</pubDate>
		<guid isPermaLink="false">http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/#comment-14864</guid>
		<description>Hier nochmal hpoe&#039;s Beitrag komplett:
Die Query muss folgendermassen lauten:

&lt;code&gt;select a.id, a.name, count(*) - 1 as level
FROM kategorien as a join kategorien as b
on a.lft between b.lft  and b.rgt and
    a.rgt between b.lft and b.rgt
group by a.id, a.name
order by a.lft, a.id&lt;/code&gt;
 
Das Resultset in Array umwandeln.
 
dann nur noch die paar Zeilen PHP mit etwas Kommentar

&lt;code&gt;
/**
  Ausgangs Situation:
  resultset als Array $hierarchy mit den Feldern level, name
  root level = 0 (weil count(*) - 1 gesetzt wird
*/
$level = -1; // kleiner als root level initialisieren
$html = &quot;&quot;;
foreach ($hierarchy as $row) {
  // gelesenes Level kleiner als das letzte:
  // differenz an Leveln ermitteln und soviele &lt;/ul&gt; ausgeben
  if($row[&#039;level&#039;] &lt; $level) {
    $diff = $level - $row[&#039;level&#039;];
    $html .= str_repeat(&quot;&lt;/ul&gt;&quot;, $diff)
  }
  // gelesener Level  gr&#246;sser als Vergleichslevel: neue Stufe beginnen
  if($row[&#039;level&#039;] &gt; $level){ $html .= &quot;&lt;ul&gt;&quot;; }
  // immer das &lt;li&gt; ...&lt;/li&gt; ausgeben
  $html .= &quot;&lt;li&gt;&quot;.$row[&#039;name&#039;].&quot;&lt;/li&gt;&quot;;
  // Vergleichswert festhalten
  $level = $row[&#039;level&#039;];
}
// falls Vergleichslevel &gt;= 0, muss bis auf Level 0 abgetragen werdne
if ($level &gt;= 0) $html .= str_repeat(&quot;&lt;/ul&gt;&quot;, ($level + 1));&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hier nochmal hpoe&#039;s Beitrag komplett:<br />
Die Query muss folgendermassen lauten:</p>
<pre><code>select a.id, a.name, count(*) - 1 as level
FROM kategorien as a join kategorien as b
on a.lft between b.lft  and b.rgt and
    a.rgt between b.lft and b.rgt
group by a.id, a.name
order by a.lft, a.id</code></pre>
<p>Das Resultset in Array umwandeln.</p>
<p>dann nur noch die paar Zeilen PHP mit etwas Kommentar</p>
<pre><code>/**
  Ausgangs Situation:
  resultset als Array $hierarchy mit den Feldern level, name
  root level = 0 (weil count(*) - 1 gesetzt wird
*/
$level = -1; // kleiner als root level initialisieren
$html = "";
foreach ($hierarchy as $row) {
  // gelesenes Level kleiner als das letzte:
  // differenz an Leveln ermitteln und soviele &lt;/ul&gt; ausgeben
  if($row['level'] &lt; $level) {
    $diff = $level - $row['level'];
    $html .= str_repeat("&lt;/ul&gt;", $diff)
  }
  // gelesener Level  grösser als Vergleichslevel: neue Stufe beginnen
  if($row['level'] &gt; $level){ $html .= "&lt;ul&gt;"; }
  // immer das &lt;li&gt; ...&lt;/li&gt; ausgeben
  $html .= "&lt;li&gt;".$row['name']."&lt;/li&gt;";
  // Vergleichswert festhalten
  $level = $row['level'];
}
// falls Vergleichslevel &gt;= 0, muss bis auf Level 0 abgetragen werdne
if ($level &gt;= 0) $html .= str_repeat("&lt;/ul&gt;", ($level + 1));</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Jan</title>
		<link>http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/comment-page-1/#comment-14814</link>
		<dc:creator>Jan</dc:creator>
		<pubDate>Sat, 09 Aug 2008 15:21:50 +0000</pubDate>
		<guid isPermaLink="false">http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/#comment-14814</guid>
		<description>Leider ist nicht alles komplett angekommen. Kannst Du es mir nochmal per Mail schicken, dann stelle ich eine korrigierte Version Deines Kommentars online. Wordpress macht leider oft Code in den Kommentaren kaputt.</description>
		<content:encoded><![CDATA[<p>Leider ist nicht alles komplett angekommen. Kannst Du es mir nochmal per Mail schicken, dann stelle ich eine korrigierte Version Deines Kommentars online. WordPress macht leider oft Code in den Kommentaren kaputt.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: hpoe</title>
		<link>http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/comment-page-1/#comment-14812</link>
		<dc:creator>hpoe</dc:creator>
		<pubDate>Sat, 09 Aug 2008 14:54:13 +0000</pubDate>
		<guid isPermaLink="false">http://phpperformance.de/wie-erstelle-ich-eine-html-liste-aus-einem-nested-set/#comment-14812</guid>
		<description>Wenn man im SELECT die Tiefe (Level) der Baumelemente  ermittelt, braucht man keine Recursion mehr.
Man kann aufgrund des Levels resp. dem Vergleich mit dem Level des Vorg&#228;ngerknotens feststellen, ob weiter einger&#252;ckt, oder auf dem gleichen Level nur  Bl&#246;cke ausgegeben werden sollen. Dies ergibt eine ziemlich einfache Logik. 
Annahme: die gesamte Hierarchie ist in einem Array $hierarchy mit den Elementen Payload, Level, id, lft, rgt), der Level der Root sei 0;
&lt;pre lang=&quot;php&quot;&gt;
$level = -1;
$html = &quot;&quot;;
foreach ($hierarchy as $row) {
  if($row[&#039;level&#039;] &quot;, $diff);
  }
  if($row[&#039;level&#039;] &gt; $level){ $html .= &quot;&quot;; }
  $html .= &quot;&quot;.$row[&#039;payload&#039;].&quot;&quot;;
}
if ($level &gt; 0) $html .= str_repeat(&quot;&quot;, $level);
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Wenn man im SELECT die Tiefe (Level) der Baumelemente  ermittelt, braucht man keine Recursion mehr.<br />
Man kann aufgrund des Levels resp. dem Vergleich mit dem Level des Vorg&#228;ngerknotens feststellen, ob weiter einger&#252;ckt, oder auf dem gleichen Level nur  Bl&#246;cke ausgegeben werden sollen. Dies ergibt eine ziemlich einfache Logik.<br />
Annahme: die gesamte Hierarchie ist in einem Array $hierarchy mit den Elementen Payload, Level, id, lft, rgt), der Level der Root sei 0;</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$level</span> <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$html</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$hierarchy</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'level'</span><span style="color: #009900;">&#93;</span> <span style="color: #0000ff;">&quot;, <span style="color: #006699; font-weight: bold;">$diff</span>);
  }
  if(<span style="color: #006699; font-weight: bold;">$row</span>['level'] &amp;gt; <span style="color: #006699; font-weight: bold;">$level</span>){ <span style="color: #006699; font-weight: bold;">$html</span> .= &quot;</span><span style="color: #0000ff;">&quot;; }
  <span style="color: #006699; font-weight: bold;">$html</span> .= &quot;</span><span style="color: #0000ff;">&quot;.<span style="color: #006699; font-weight: bold;">$row</span>['payload'].&quot;</span><span style="color: #0000ff;">&quot;;
}
if (<span style="color: #006699; font-weight: bold;">$level</span> &amp;gt; 0) <span style="color: #006699; font-weight: bold;">$html</span> .= str_repeat(&quot;</span><span style="color: #0000ff;">&quot;, <span style="color: #006699; font-weight: bold;">$level</span>);</span></pre></div></div>

]]></content:encoded>
	</item>
</channel>
</rss>

