* If connection is authenticated, load user information. */ if (doesHaveMembership()) { $user = array('id' => getUserId()); $user['name'] = User::getName(getUserId()); $user['homepage'] = User::getHomePage(); } else { $user = null; } /** Timezone * -------- * Blog-specific Timezone setting. */ if (!is_null($context->getProperty('database.database'))) { $timezone = new Timezone(); $timezone->set($context->getProperty('blog.timezone') !== null ? $context->getProperty('blog.timezone') : $context->getProperty('service.timezone')); POD::setTimezone($context->getProperty('blog.timezone') !== null ? $context->getProperty('blog.timezone') : $context->getProperty('service.timezone')); } /** Locale Resources * ---------------- * Loads necessary locale resource. * (TODO : Reduce the capacity of i18n resource by dividing blog / adminpanel setting. */ /// Load administration panel locale. if (!defined('NO_LOCALE')) { if ($context->getProperty('uri.interfaceType') == 'reader') { $languageDomain = 'owner'; } else { $languageDomain = $context->getProperty('uri.interfaceType'); } if ($languageDomain == 'owner') {
<?php /// Copyright (c) 2004-2015, Needlworks / Tatter Network Foundation /// All rights reserved. Licensed under the GPL. /// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT) $IV = array('GET' => array('timezone' => array('string'))); require ROOT . '/library/preprocessor.php'; requireStrictRoute(); $timezone = new Timezone(); if (isset($_GET['timezone']) && $timezone->set($_GET['timezone'])) { setBlogSetting('timezone', $_GET['timezone']); Respond::ResultPage(0); } Respond::ResultPage(-1);
function setTimezone($timezone) { if (Timezone::set($timezone)) { $setting = new BlogSetting(); $setting->timezone = $timezone; return $setting->save(); } }
static function setISO8601($timezone) { if ($timezone == 'Z') { return Timezone::set('GMT'); } if (!preg_match('/^([-+])(\\d{1,2})(:)?(\\d{2})?$/', $timezone, $matches)) { return false; } $matches[0] = 'GMT'; $matches[1] = $matches[1] == '+' ? '-' : '+'; if (strlen($matches[2]) == 1) { $matches[2] = '0' . $matches[2]; } if (empty($matches[3])) { $matches[3] = ':'; } if (empty($matches[4])) { $matches[4] = '00'; } return Timezone::set(implode('', $matches)); }