Exemplo n.º 1
0
    $crit .= make_category_criteria($_REQUEST['category1'], $_REQUEST['category_not1'], $_REQUEST['category_from1'], $_REQUEST['category_to1']);
    $crit .= make_category_criteria($_REQUEST['category2'], $_REQUEST['category_not2'], $_REQUEST['category_from2'], $_REQUEST['category_to2']);
    $crit .= make_category_criteria($_REQUEST['category3'], $_REQUEST['category_not3'], $_REQUEST['category_from3'], $_REQUEST['category_to3']);
    $crit .= make_category_criteria($_REQUEST['category4'], $_REQUEST['category_not4'], $_REQUEST['category_from4'], $_REQUEST['category_to4']);
    if (isset($_REQUEST["files_only"])) {
        $crit .= " AND is_dir=0";
    }
    $sort = array();
    if (isset($_REQUEST["group_by_disk"])) {
        $sort[] = 'Tag';
    }
    if ($_REQUEST['sort'] == 'name') {
        $sort[] = 'Filename';
    } else {
        $sort[] = 'no';
    }
    $t1 = getmicrotime();
    $files = fetchFilesByCriteria($crit, $tables, $sort);
    $searchTime = getmicrotime() - $t1;
    if (db_num_rows($files) == 0) {
        unset($files);
    } else {
        $t1 = getmicrotime();
        $ids = getFileIdsFromDbRes($files);
        $category_map = getFileCategories($ids);
        $categoryTime = getmicrotime() - $t1;
    }
    include 'search.php_html';
    exit;
}
include 'search_adv.php_html';
Exemplo n.º 2
0
            unset($disks);
        } else {
            $ids = getDiskIdsFromDbRes($disks);
            $category_map = getDiskCategories($ids);
        }
    }
    if ($_REQUEST["what"] == "file") {
        saveSearchParams($_SERVER['PHP_SELF'], array('what', 'tag_pattern', 'tag', 'term'));
        $term = convertWildcards($_REQUEST["term"]);
        $crit = "(Filename LIKE '%{$term}%' OR BetterName LIKE '%{$term}%')";
        if (isset($_REQUEST["tag_pattern"])) {
            $tag = convertWildcards($_REQUEST['tag_pattern']);
            $crit .= " AND disk.tag LIKE '{$tag}'";
        }
        $t1 = getmicrotime();
        $files = fetchFilesByCriteria($crit);
        $searchTime = getmicrotime() - $t1;
        if (db_num_rows($files) == 0) {
            unset($files);
        } else {
            $t1 = getmicrotime();
            $ids = getFileIdsFromDbRes($files);
            $category_map = getFileCategories($ids);
            $categoryTime = getmicrotime() - $t1;
        }
    }
}
if (!(isset($disk_by_tag) || isset($disks) || isset($files))) {
    $pageMessage = "Nothing found for '" . $_REQUEST["term"] . "'";
}
header('Content-Type: text/html; charset=' . $config_charset);