|
Hey folks. I've got a small recursive function to display the tree hierarchy of directories. My problem is that the function will go until it gets to the end of the first branch. Then it seems like that is it. The subdirs array is an [n][3] array. function show_tree($parent_ID, $indent) { global $subdirs; echo <tdIn show_tree. parent = $parent_ID</td<brn ; foreach ($subdirs as $item) { echo <td$item[2]</td<brn ; #[0] == ID #[1] == Parent Dir. ID #[2] == Filename/Directory if ($item[1] == $parent_ID) { echo <option value='$item[0]' ; for ($i=0; $i < $indent; $i++) echo ; echo $item[2]</optionn ; $indent++; echo <tdCalling show_tree with $item[0]</td<brn ; show_tree($item[0], $indent); } } Thanks for any help that you can shed on this for me. -David Wilson Below is the output... <html<head<_link_ rel=_style_sheet type='text/css' href='../layout/default/css/common.css' <_script_ language='_java_script__' src='../lib/chkform.js' type='text/_java_script__'</_script_ </head<body bgcolor= #E0E0E0 <table bgcolor=#D5D5D5 cellspacing=0 cellpadding=3 border=1 width=500 <td width=230<a href='../help/en/files.html' target=_blank<bFile management</b</a</td <td New :</td <td width=50<a href='filemanager.php?mode=forms&sort=&up=&action=upload'Upload</a</td <td width=50<a href='filemanager.php?mode=forms&sort=&up=&action=dir'Directory</a</td <td width=50<a href='filemanager.php?mode=forms&sort=&up=&action=_link_'_link_</a</td </td</table<br <table border=1 cellspacing=0 cellpadding=3 bgcolor=#D5D5D5 width=500 <form method=post action='filemanager.php' name='frm' _onsubmit_= return chkForm('frm','filename','Please specify a de_script_ion!!') <input type=hidden name=typ value='d' <input type=hidden name='action' value='update' <tr<td colspan=3<bDirectory</b<br <tr<tdName:</td<td colspan=2<input type=text name=filename size=20 value='e-one'</td</tr <tr<tdDirectory: </td<td <input type=radio name='c_m' value='c'Copy <input type=radio name='c_m' value='m'Move<brwith new values </td <tdIn show_tree. parent= 0</td<br <tdDeveloper Dir</td<br <option value='5'Developer Dir</option <tdCalling show_tree with 5</td<br <tdIn show_tree. parent= 5</td<br <tdDeveloper Dir</td<br <tdsrc</td<br <option value='14890' src</option <tdCalling show_tree with 14890</td<br <tdIn show_tree. parent= 14890</td<br <tdDeveloper Dir</td<br <tdsrc</td<br <tdweb</td<br <option value='14891' web</option <tdCalling show_tree with 14891</td<br <tdIn show_tree. parent= 14891</td<br <tdDeveloper Dir</td<br <tdsrc</td<br <tdweb</td<br <tdcgi-bin</td<br <option value='16908' cgi-bin</option <tdCalling show_tree with 16908</td<br <tdIn show_tree. parent= 16908</td<br <tdDeveloper Dir</td<br <tdsrc</td<br <tdweb</td<br <tdcgi-bin</td<br <tdwise</td<br <option value='16911' wise</option <tdCalling show_tree with 16911</td<br <tdIn show_tree. parent= 16911</td<br <tdDeveloper Dir</td<br <tdsrc</td<br <tdweb</td<br <tdcgi-bin</td<br <tdwise</td<br <tde-one</td<br <option value='17008' e-one</option <tdCalling show_tree with 17008</td<br <tdIn show_tree. parent= 17008</td<br <tdDeveloper Dir</td<br <tdsrc</td<br <tdweb</td<br <tdcgi-bin</td<br <tdwise</td<br <tde-one</td<br <tdimmucor</td<br <tdsqm</td<br <tdstd-02.00.00</td<br <tdstd-02.01.00</td<br <tdstd-02.02.00</td<br <tdstd-02.03.00</td<br <tdCVS</td<br <tdlib</td<br <tdmsg</td<br <tdstatic</td<br <tdtemplate</td<br <tdcontract</td<br <tdCVS</td<br <tdmenu</td<br <tdCVS</td<br <tdCVS</td<br <tdsalescontractdetail</td<br <tdsalescontractinq</td<br <tdCVS</td<br <tdCVS</td<br <tdCVS</td<br <tdimages</td<br <tdCVS</td<br <tden</td<br <tdCVS</td<br <tdCVS</td<br <tdcontract</td<br <tdCVS</td<br <tdsales</td<br <tdCVS</td<br <tdconfig</td<br <option value='17252' config</option <tdCalling show_tree with 17252</td<br <tdIn show_tree. parent= 17252</td<br <tdDeveloper Dir</td<br <tdsrc</td<br <tdweb</td<br <tdcgi-bin</td<br <tdwise</td<br <tde-one</td<br <tdimmucor</td<br <tdsqm</td<br <tdstd-02.00.00</td<br <tdstd-02.01.00</td<br <tdstd-02.02.00</td<br <tdstd-02.03.00</td<br <tdCVS</td<br <tdlib</td<br <tdmsg</td<br <tdstatic</td<br <tdtemplate</td<br <tdcontract</td<br <tdCVS</td<br <tdmenu</td<br <tdCVS</td<br <tdCVS</td<br <tdsalescontractdetail</td<br <tdsalescontractinq</td<br <tdCVS</td<br <tdCVS</td<br <tdCVS</td<br <tdimages</td<br <tdCVS</td<br <tden</td<br <tdCVS</td<br <tdCVS</td<br <tdcontract</td<br <tdCVS</td<br <tdsales</td<br <tdCVS</td<br <tdconfig</td<br <tdCVS</td<br <tddata</td<br <tdlib</td<br <tdmsg</td<br <tdstatic</td<br <tdtemplate</td<br <tdcommon</td<br <tdCVS</td<br <tdinventory</td<br <tdmenu</td<br <tdsales</td<br <tdshop</td<br <tdCVS</td<br <tdead</td<br <tdCVS</td<br <tdCVS</td<br <tditeminq</td<br <tdprodspec</td<br <tdCVS</td<br <tdCVS</td<br <tdbombrowser</td<br <tdcategory</td<br <tdCVS</td<br <tdselect</td<br <tdsplit_frame_</td<br <tdCVS</td<br <tdCVS</td<br <tdCVS</td<br <tdCVS</td<br <tdcart</td<br <tdCVS</td<br <tdorders</td<br <tdCVS</td<br <tdCVS</td<br <tdCVS</td<br <tdbom</td<br <tdCVS</td<br <tdimages</td<br <tdshop</td<br <tdCVS</td<br <tdsplit_frame_</td<br <tdCVS</td<br <tdCVS</td<br <tdCVS</td<br <tdCVS</td<br <tdcommon</td<br <tdCVS</td<br <tdinventory</td<br <tdsales</td<br <tdshop</td<br <tdCVS</td<br <tdCVS</td<br <tdCVS</td<br <tdCVS</td<br <tdCVS</td<br <tdCVS</td<br <option value='17254' CVS</option <tdCalling show_tree with 17254</td<br <tdIn show_tree. parent= 17254</td<br <tdDeveloper Dir</td<br <tdsrc</td<br <tdweb</td<br <tdcgi-bin</td<br <tdwise</td<br <tde-one</td<br [[CLIPPED. Finishes searching through the array without finding the 17254 and exits]] </tr<tr<td width=150Category:</td <td width=200 New : <br <input type=text name=kat size=20</td <td width=150or:<br<select name=kat2 <option value='' <option value='' selected <option value='Wise Category'Wise Category <option value='' selected </select</td</tr <tr<tdAccess:<br(multiple select with the 'Ctrl'-key):</td <td<input type=radio name=acc value='private' me <input type=radio name=acc value='group' checked all <br <input type=radio name=acc value='same_as_dir' same as directory <br <img src='../img/s.gif' width=160 height=1 vspace=2<br<input type=checkbox name='acc_write' value='w' Write access</td<td<input type='radio' name='acc' value='3'some:<br <select name=persons[] multiple size=5 <option value=testTest, Test </select</td</tr <tr<td colspan=3Comment:<br<textarea name=remark cols='65' rows='6'</textarea</td</tr <td colspan=2<input type=checkbox name=notify Notify all group members</td <td<input type=checkbox name=versioning value='v' Version management</td</tr <input type=hidden name='name' value='Wilson' <input type=hidden name=sort value= <input type=hidden name='ID' value='17008' <input type=hidden name='mode' value='data' <tr<td colspan=2<input name='update' value='update' type=submit</form <td colspan=2<form action='filemanager.php' method='post' <input type='hidden' name='mode' value='view' <input type='hidden' name='sort' value='' <input type='hidden' name='up' value='' <input type='submit' value='back'</form</td </form</td</tr</table </body </html
|