Example #1
0
 function tb_get_theme_cookie_name($key)
 {
     return tb_get_cookie_name(tb_get_theme_name() . '_' . $key);
 }
Example #2
0
/**
 * WordPress
 */
function fastblog_wp()
{
    global $fastblog_options, $fastblog_schemes;
    if (!is_admin() && is_active_widget(false, false, 'fastblog_schemeswitcher')) {
        $cookie_name = tb_get_cookie_name('fastblog_scheme');
        $cookie_time = 30;
        if ($query_var_scheme = get_query_var('scheme')) {
            $scheme = $query_var_scheme;
        } else {
            if (isset($_COOKIE[$cookie_name])) {
                $scheme = $_COOKIE[$cookie_name];
            } else {
                $scheme = fastblog_get_option('scheme');
            }
        }
        if (in_array($scheme, $fastblog_schemes)) {
            $fastblog_options['scheme'] = $scheme;
            setcookie($cookie_name, $scheme, time() + $cookie_time * 86400, COOKIEPATH, COOKIE_DOMAIN);
        }
    }
}