Exemplo n.º 1
0
    }
    $smarty->assign('jobs', $job->GetJobs(0, $categ, 0, 0, 0));
} else {
    $keywords = trim($keywords);
    $smarty->assign('jobs', $job->Search($keywords, $url_query, $start_page));
}
// if user hit enter after entering a search query, we know this causes a
// synchronous HTTP redirect, so apply a different template
if ($is_home) {
    $template = 'home.tpl';
}
if (!empty($requestKeywords)) {
    // save recorded keywords, if available
    if ($_SESSION['search_keywords']) {
        $search = new SearchKeywords($_SESSION['search_keywords']);
        $search->Save();
        unset($_SESSION['search_keywords']);
    }
    $smarty->assign('keywords', stripslashes(htmlentities($requestKeywords, ENT_QUOTES, 'UTF-8')));
    $template = 'search.tpl';
} else {
    if ($id != '' && !strstr($id, '|')) {
        $smarty->assign('keywords', stripslashes(htmlentities($id, ENT_QUOTES, 'UTF-8')));
        $template = 'search.tpl';
    } else {
        $smarty->assign('keywords', stripslashes($keywords));
        $template = 'posts-loop.tpl';
    }
}
if (isset($_SESSION['search_pagination'])) {
    $smarty->assign('pages', $_SESSION['search_pagination']);