本文整理汇总了PHP中ModuleUser_EntityUser::getSettingsTimezone方法的典型用法代码示例。如果您正苦于以下问题:PHP ModuleUser_EntityUser::getSettingsTimezone方法的具体用法?PHP ModuleUser_EntityUser::getSettingsTimezone怎么用?PHP ModuleUser_EntityUser::getSettingsTimezone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModuleUser_EntityUser
的用法示例。
在下文中一共展示了ModuleUser_EntityUser::getSettingsTimezone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Update
/**
* Обновляет юзера
*
* @param ModuleUser_EntityUser $oUser Объект пользователя
* @return bool
*/
public function Update(ModuleUser_EntityUser $oUser)
{
$sql = "UPDATE " . Config::Get('db.table.user') . "\n SET\n user_password = ? ,\n user_mail = ? ,\n user_skill = ? ,\n user_date_activate = ? ,\n user_date_comment_last = ? ,\n user_rating = ? ,\n user_count_vote = ? ,\n user_activate = ? ,\n user_activate_key = ? ,\n user_profile_name = ? ,\n user_profile_sex = ? ,\n user_profile_country = ? ,\n user_profile_region = ? ,\n user_profile_city = ? ,\n user_profile_birthday = ? ,\n user_profile_about = ? ,\n user_profile_date = ? ,\n user_profile_avatar = ? ,\n user_profile_foto = ? ,\n user_settings_notice_new_topic = ? ,\n user_settings_notice_new_comment = ? ,\n user_settings_notice_new_talk = ? ,\n user_settings_notice_reply_comment = ? ,\n user_settings_notice_new_friend = ? ,\n user_settings_timezone = ?\n WHERE user_id = ?\n ";
if ($this->oDb->query($sql, $oUser->getPassword(), $oUser->getMail(), $oUser->getSkill(), $oUser->getDateActivate(), $oUser->getDateCommentLast(), $oUser->getRating(), $oUser->getCountVote(), $oUser->getActivate(), $oUser->getActivateKey(), $oUser->getProfileName(), $oUser->getProfileSex(), $oUser->getProfileCountry(), $oUser->getProfileRegion(), $oUser->getProfileCity(), $oUser->getProfileBirthday(), $oUser->getProfileAbout(), $oUser->getProfileDate(), $oUser->getProfileAvatar(), $oUser->getProfileFoto(), $oUser->getSettingsNoticeNewTopic(), $oUser->getSettingsNoticeNewComment(), $oUser->getSettingsNoticeNewTalk(), $oUser->getSettingsNoticeReplyComment(), $oUser->getSettingsNoticeNewFriend(), $oUser->getSettingsTimezone(), $oUser->getId())) {
return true;
}
return false;
}
示例2: EventTuning
/**
* Дополнительные настройки сайта
*/
protected function EventTuning()
{
$this->sMenuItemSelect = 'settings';
$this->sMenuSubItemSelect = 'tuning';
$this->Viewer_AddHtmlTitle($this->Lang_Get('settings_menu_tuning'));
$aTimezoneList = array('-12', '-11', '-10', '-9.5', '-9', '-8', '-7', '-6', '-5', '-4.5', '-4', '-3.5', '-3', '-2', '-1', '0', '1', '2', '3', '3.5', '4', '4.5', '5', '5.5', '5.75', '6', '6.5', '7', '8', '8.75', '9', '9.5', '10', '10.5', '11', '11.5', '12', '12.75', '13', '14');
$this->Viewer_Assign('aTimezoneList', $aTimezoneList);
/**
* Если отправили форму с настройками - сохраняем
*/
if (isPost('submit_settings_tuning')) {
$this->Security_ValidateSendForm();
if (in_array(getRequestStr('settings_general_timezone'), $aTimezoneList)) {
$this->oUserCurrent->setSettingsTimezone(getRequestStr('settings_general_timezone'));
}
$this->oUserCurrent->setSettingsNoticeNewTopic(getRequest('settings_notice_new_topic') ? 1 : 0);
$this->oUserCurrent->setSettingsNoticeNewComment(getRequest('settings_notice_new_comment') ? 1 : 0);
$this->oUserCurrent->setSettingsNoticeNewTalk(getRequest('settings_notice_new_talk') ? 1 : 0);
$this->oUserCurrent->setSettingsNoticeReplyComment(getRequest('settings_notice_reply_comment') ? 1 : 0);
$this->oUserCurrent->setSettingsNoticeNewFriend(getRequest('settings_notice_new_friend') ? 1 : 0);
$this->oUserCurrent->setProfileDate(date("Y-m-d H:i:s"));
/**
* Запускаем выполнение хуков
*/
$this->Hook_Run('settings_tuning_save_before', array('oUser' => $this->oUserCurrent));
if ($this->User_Update($this->oUserCurrent)) {
$this->Message_AddNoticeSingle($this->Lang_Get('settings_tuning_submit_ok'));
$this->Hook_Run('settings_tuning_save_after', array('oUser' => $this->oUserCurrent));
} else {
$this->Message_AddErrorSingle($this->Lang_Get('system_error'));
}
} else {
if (is_null($this->oUserCurrent->getSettingsTimezone())) {
$_REQUEST['settings_general_timezone'] = (strtotime(date("Y-m-d H:i:s")) - strtotime(gmdate("Y-m-d H:i:s"))) / 3600 - date('I');
} else {
$_REQUEST['settings_general_timezone'] = $this->oUserCurrent->getSettingsTimezone();
}
}
}
示例3: EventTuning
/**
* Дополнительные настройки сайта
*/
protected function EventTuning()
{
$this->sMenuItemSelect = 'settings';
$this->sMenuSubItemSelect = 'tuning';
$this->Viewer_AddHtmlTitle($this->Lang_Get('user.settings.nav.tuning'));
$aTimezoneList = DateTimeZone::listIdentifiers();
$this->Viewer_Assign('aTimezoneList', $aTimezoneList);
/**
* Если отправили форму с настройками - сохраняем
*/
if (isPost()) {
$this->Security_ValidateSendForm();
if (in_array(getRequestStr('settings_general_timezone'), $aTimezoneList)) {
$this->oUserCurrent->setSettingsTimezone(getRequestStr('settings_general_timezone'));
}
$this->oUserCurrent->setSettingsNoticeNewTopic(getRequest('settings_notice_new_topic') ? 1 : 0);
$this->oUserCurrent->setSettingsNoticeNewComment(getRequest('settings_notice_new_comment') ? 1 : 0);
$this->oUserCurrent->setSettingsNoticeNewTalk(getRequest('settings_notice_new_talk') ? 1 : 0);
$this->oUserCurrent->setSettingsNoticeReplyComment(getRequest('settings_notice_reply_comment') ? 1 : 0);
$this->oUserCurrent->setSettingsNoticeNewFriend(getRequest('settings_notice_new_friend') ? 1 : 0);
$this->oUserCurrent->setProfileDate(date("Y-m-d H:i:s"));
/**
* Запускаем выполнение хуков
*/
$this->Hook_Run('settings_tuning_save_before', array('oUser' => $this->oUserCurrent));
if ($this->User_Update($this->oUserCurrent)) {
$this->Message_AddNoticeSingle($this->Lang_Get('common.success.save'));
$this->Hook_Run('settings_tuning_save_after', array('oUser' => $this->oUserCurrent));
} else {
$this->Message_AddErrorSingle($this->Lang_Get('common.error.system.base'));
}
} else {
if (is_null($this->oUserCurrent->getSettingsTimezone())) {
$_REQUEST['settings_general_timezone'] = date_default_timezone_get();
} else {
$_REQUEST['settings_general_timezone'] = $this->oUserCurrent->getSettingsTimezone();
}
}
}