예제 #1
0
    $i["name"] = basename($f);
    $i["isdir"] = is_dir($f) ? 1 : 0;
    $i["fullname"] = $f;
    $i["webpath"] = $webpath . "/" . $i["name"] . ($i["isdir"] == 1 ? "/" : "");
    $i["mtime"] = filemtime($f);
    $i["pathinfo"] = pathinfo($f);
    if ($i["isdir"] == 1) {
        $i["pathinfo"]["extension"] = "";
        $dirs[] = $i["name"];
    } else {
        $i["size"] = filesize($f);
    }
    $items[$i["name"]] = $i;
}
if (!$listmode) {
    $relres = $r->getByNames($dirs);
    while ($rel = $pdo->getAssocArray($relres)) {
        if (isset($items[$rel["searchname"]])) {
            $items[$rel["searchname"]]["release"] = $rel;
        }
    }
}
uasort($items, 'sortbymodified');
$page->smarty->assign('results', $items);
$page->smarty->assign('lm', $listmode);
if ($subpath != "") {
    $page->smarty->assign('subpath', $subpath . "/");
}
$parentpath = "";
if ($subpath != "") {
    $pos = strrpos($subpath, "/");