本文整理汇总了PHP中UserConfig::saveConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP UserConfig::saveConfig方法的具体用法?PHP UserConfig::saveConfig怎么用?PHP UserConfig::saveConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserConfig
的用法示例。
在下文中一共展示了UserConfig::saveConfig方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setcookie
//save browser info to user config array
// *****************************
if (empty($ip)) {
$USERCONFIG['ip'] = $REMOTE_ADDR;
}
$USERCONFIG['mask'] = $mask;
$USERCONFIG['lang'] = $lang;
if (($bname == 'msie' || $bname == 'opera') && $bversion > 4 || $bname == 'netscape' && $bversion > 3.5 || $bname == 'mozilla') {
$USERCONFIG['dhtml'] = 1;
}
// *****************************
// Save config to db
// *****************************
$mask = $USERCONFIG['mask'];
# save mask before serializing
$cfg_obj->saveConfig($user_id, $USERCONFIG);
setcookie('ck_config', $user_id, time() + 3600 * 24 * 365);
# expires after 1 year
}
#
# save user_id to session
#
$HTTP_SESSION_VARS['sess_user_id'] = $user_id;
if (empty($HTTP_SESSION_VARS['sess_user_name'])) {
$HTTP_SESSION_VARS['sess_user_name'] = 'default';
}
#
# set the initial session timeout start value
#
$HTTP_SESSION_VARS['sess_tos'] = date('His');
#
示例2: array
$lang_tables = array('stdpass.php');
define('LANG_FILE', 'specials.php');
//$local_user='ck_edv_user';
define('NO_2LEVEL_CHK', 1);
require_once $root_path . 'include/inc_front_chain_lang.php';
$breakfile = 'config_options.php' . URL_APPEND;
$thisfile = basename($_SERVER['PHP_SELF']);
if (isset($mode) && $mode == 'save') {
// Save to user config table
$config_new['template_smarty'] = $template_smarty;
include_once $root_path . 'include/care_api_classes/class_userconfig.php';
$user = new UserConfig();
if ($user->getConfig($_COOKIE['ck_config'])) {
$config =& $user->getConfigData();
$config = array_merge($config, $config_new);
if ($user->saveConfig($_COOKIE['ck_config'], $config)) {
header('location:' . basename(__FILE__) . URL_REDIRECT_APPEND . '&saved=1');
exit;
}
}
} elseif (!isset($cfg['template_smarty']) || empty($cfg['template_smarty'])) {
if (!isset($GLOBAL_CONFIG)) {
$GLOBAL_CONFIG = array();
}
include_once $root_path . 'include/care_api_classes/class_globalconfig.php';
$gc = new GlobalConfig($GLOBAL_CONFIG);
$gc->getConfig('template_smarty');
if (!empty($GLOBAL_CONFIG['template_smarty'])) {
$cfg['template_smarty'] = $GLOBAL_CONFIG['template_smarty'];
} else {
$cfg['template_smarty'] = 'default';