Beispiel #1
0
function search_on_search_result(&$api)
{
    if (!$_GET['q'] || trim($_GET['q']) == '') {
        return search_on_search_form($api);
    }
    $forum_id = $api->forum() ? $api->forum()->get_id() : NULL;
    $url = new FreechURL('', _('Find'));
    $url->set_var('action', 'search');
    $url->set_var('forum_id', $forum_id);
    $api->breadcrumbs()->add_link($url);
    $api->breadcrumbs()->add_text($_GET['q']);
    // Search for postings or users.
    $controller = new SearchController($api);
    if ($_GET['user_search']) {
        $controller->show_users($_GET['q'], $_GET['hs']);
    } else {
        $controller->show_postings($forum_id, $_GET['q'], $_GET['hs']);
    }
}