Exemplo n.º 1
0
/**
 * Loads the search object.
 */
function zp_load_search()
{
    global $_zp_current_search;
    zp_clearCookie("zenphoto_search_params");
    if (!is_object($_zp_current_search)) {
        $_zp_current_search = new SearchEngine();
    }
    add_context(ZP_SEARCH);
    $params = $_zp_current_search->getSearchParams();
    zp_setCookie("zenphoto_search_params", $params, SEARCH_DURATION);
    return $_zp_current_search;
}
/**
 * Loads the search object if it hasn't already been loaded.
 */
function zp_load_search()
{
    global $_zp_current_search;
    if ($_zp_current_search == NULL) {
        $_zp_current_search = new SearchEngine();
    }
    set_context(ZP_INDEX | ZP_SEARCH);
    $cookiepath = WEBPATH;
    if (WEBPATH == '') {
        $cookiepath = '/';
    }
    $params = $_zp_current_search->getSearchParams();
    zp_setcookie("zenphoto_image_search_params", $params, 0, $cookiepath);
    return $_zp_current_search;
}