예제 #1
0
    if (isset($date['month'])) {
        $str .= $date['month'] . '-';
        $format = 'F Y';
        if (isset($date['day'])) {
            $str .= $date['day'];
            $format = 'F j, Y';
        } else {
            $str .= '01';
        }
    } else {
        $str .= '01-01';
    }
    Koken::$location['parameters']['__overrides_display'][] = array('title' => 'Date', 'value' => date($format, strtotime($str)));
}
// Fallback path with default themes
Koken::$fallback_path = $root_path . $ds . 'app' . $ds . 'site' . $ds . 'themes';
if (isset($cache_path)) {
    Koken::$cache_path = $cache_path;
}
list($site_api, $categories) = Koken::api(array('/site' . ($draft ? $preview ? '/preview:' . $preview : '/draft:true' : ''), '/categories'));
# Do this separately to be sure KOKEN_ENCRYPTION_KEY has been created by the above API call
$koken_key = Shutter::get_encryption_key();
$video = Koken::api('/content/types:video/limit:1/visibility:any/token:' . $koken_key);
Koken::$has_video = count($video['content']) > 0;
if (!is_array($site_api)) {
    die(file_get_contents(Koken::$fallback_path . $ds . 'error' . $ds . 'api.html'));
}
if (isset($site_api['error'])) {
    die(str_replace('<!-- ERROR -->', $site_api['error'], file_get_contents(Koken::$fallback_path . $ds . 'error' . $ds . 'json.html')));
}
Koken::$site = $site_api;