function filearray($start)
{
    global $exclude_files;
    $dir = opendir($start);
    while (false !== ($found = readdir($dir))) {
        $getit[] = $found;
    }
    foreach ($getit as $num => $item) {
        if (is_dir($start . $item) && $item != "." && $item != ".." && array_search($item, $exclude_files) === false) {
            $output["{$item}"] = filearray($start . $item . "/");
        }
        if (is_file($start . $item) && array_search($item, $exclude_files) === false) {
            $output["{$item}"] = $start . $item;
        }
    }
    closedir($dir);
    ksort($output);
    return $output;
}
Example #2
0
echo "</div>" . "<div class=\"sectionbar\">";
echo "| <a href=\"" . $me . "?h=" . $section . "\">Home</a>";
if (@is_dir($section)) {
    $dir = opendir($section) or die('Could not open dir.');
    while ($file = readdir($dir)) {
        if (strval($file == "." || $file == ".." || $file == "home.php")) {
        } else {
            $f = filearray($file);
            echo " | <a href=\"" . $me . "?h=" . $section . "&amp;f=" . $file . "\">" . ucwords($f['name']) . "</a>";
        }
    }
}
echo " |";
echo "</div>\n<div class=\"content\">";
if (isset($_GET['f'])) {
    $f = filearray($_GET['f']);
    if (file_exists($section . "/" . $_GET['f'])) {
        echo "<h1>" . $gkhs[$section]['name'] . " - " . ucwords($f['name']) . "</h1>";
        if ($f['ext'] == "txt") {
            echo "<pre>\n";
            include $section . "/" . $_GET['f'];
            echo "</pre>\n";
        } else {
            include $section . "/" . $_GET['f'];
        }
    } else {
        echo "File Not Found. Go away";
    }
} else {
    echo "<h1>" . $gkhs[$section]['name'] . "</h1>";
    if (file_exists($section . "/home.php")) {