Example #1
0
        $tpl_values['results'] = $out_array;
        $tpl_values['time'] = $tths_result['time'] + $dirs_result['time'] + $files_result['time'];
        $tpl_values['powered_sphinx'] = true;
    }
    if ($extsearch) {
        $tpl_values['extended_form'] = true;
    } else {
        $tpl_values['normal_form'] = true;
    }
} elseif ($category && $days) {
    $days = max($days, 1);
    $tpl_values['category'] = htmlspecialchars($category);
    $tpl_values['days'] = htmlspecialchars($days);
    $categories = Searcher::getCategories($category);
    $tpl_values['filter_last'] = array('categories' => $categories, 'days' => $days, 'minsize' => $minsize);
    list($results, $total_results, $time) = Searcher::getLatest($category, $days, $minsize, $page, RPP);
    $total_pages = ceil($total_results / RPP);
    if ($total_pages > 1) {
        $pagination = array_fill(1, $total_pages, array('selected' => false, 'category' => urlencode($category), 'days' => urlencode($days), 'minsize' => urlencode($minsize)));
        $pagination[$page]['selected'] = true;
        $tpl_values['pagination'] = true;
        $tpl_values['pagination_viewlast'] = $pagination;
        if ($page > 1) {
            if ($page == 2) {
                $tpl_values['prevlink'] = '?cat=' . urlencode($category) . '&d=' . $days . '&minsize=' . urlencode($minsize);
            } else {
                $tpl_values['prevlink'] = '?p=' . ($page - 1) . '&cat=' . urlencode($category) . '&d=' . $days . '&minsize=' . urlencode($minsize);
            }
        }
        if ($page < $total_pages) {
            $tpl_values['nextlink'] = '?p=' . ($page + 1) . '&cat=' . urlencode($category) . '&d=' . $days . '&minsize=' . urlencode($minsize);