Beispiel #1
0
    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);
        }
    }
    if (!count($results)) {
        $tpl_values['nofound'] = true;
    }
    $tpl_values['results'] = $results;
    $tpl_values['time'] = $time;
    $tpl_values['powered_mysql'] = true;
    $tpl_values['latest_form'] = true;
} else {
    $tpl_values['normal_form'] = true;
    $tpl_values['viewlast_categories'] = Searcher::getCategories();
}
$T->set($tpl_values);
echo $T->parse();