コード例 #1
0
ファイル: site.php プロジェクト: Atomox/benhelmerphotography
if (isset($_COOKIE['share_to_tumblr']) && Koken::$source['type'] === 'content') {
    setcookie('share_to_tumblr', "", time() - 3600, '/');
    $final_path = 'content_tumblr_share';
}
if (!isset($final_path)) {
    $default_path = trim($url, '/');
    $test = Koken::get_path("{$default_path}.lens");
    if ($test) {
        $final_path = $default_path;
        Koken::$custom_page_title = str_replace(array('-', '_'), ' ', $final_path);
        Koken::$custom_page_title = function_exists('mb_convert_case') ? mb_convert_case(Koken::$custom_page_title, MB_CASE_TITLE) : ucwords(Koken::$custom_page_title);
        Koken::$location['template'] = str_replace('.', '-', $default_path);
        foreach (Koken::$site['templates'] as $template) {
            if ($template['path'] === $default_path && isset($template['info']['source'])) {
                Koken::$source = array('type' => $template['info']['source'], 'filters' => false);
                Koken::$page_class = 'k-source-' . $template['info']['source'];
                break;
            }
        }
    }
}
if (isset($final_path)) {
    $https = empty($_SERVER["HTTPS"]) ? '' : $_SERVER["HTTPS"] == "on" ? "s" : "";
    $protocol = "http" . $https;
    $port = $_SERVER["SERVER_PORT"] == "80" ? "" : ":" . $_SERVER["SERVER_PORT"];
    header("X-XHR-Current-Location: " . $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI']);
    if (isset(Koken::$site['settings_flat'])) {
        foreach (Koken::$site['settings_flat'] as $key => $obj) {
            $val = isset($obj['type']) && $obj['type'] === 'boolean' && is_bool($obj['value']) ? (bool) $obj['value'] : $obj['value'];
            if (!$stylesheet && isset($obj['scope']) && !in_array($final_path, $obj['scope'])) {
                $val = isset($obj['out_of_scope_value']) ? $obj['out_of_scope_value'] : false;