append(0); if ($handle = opendir("$BaseFolder/$Folder")) { while (false !== ($FileName = readdir($handle))) { if ($FileName != "." && $FileName != "..") { $FolderFileName = "$Folder$FileName/"; $FullFolderFileName = "$BaseFolder/$FolderFileName"; if(is_dir($FullFolderFileName)) { $arrDirNames[]=$FileName; } else { $arrFileNames[]=$FileName; } } } closedir($handle); } if(is_array($arrDirNames) && sizeof($arrDirNames)) natsort($arrDirNames); if(is_array($arrFileNames) && sizeof($arrFileNames)) natsort($arrFileNames); if($Folder){ $arrFolders=explode("/",$Folder); $PrevFolder=""; for($i=0;$iappend("folderitem"); } for($i=0;$iappend("folderitem"); } for($i=0;$iappend("fileitem"); } $tmedia->append("endoffolderfileitem"); $tmedia->display(); ?>