本文整理汇总了PHP中setting_save函数的典型用法代码示例。如果您正苦于以下问题:PHP setting_save函数的具体用法?PHP setting_save怎么用?PHP setting_save使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setting_save函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
load()->classs('account');
$modulename = $_GPC['modulename'];
$obj = WeUtility::createModuleReceiver($modulename);
if (empty($obj)) {
exit('error');
}
$obj->uniacid = $_W['uniacid'];
$obj->acid = $_W['acid'];
if (method_exists($obj, 'receive')) {
@$obj->receive();
exit('success');
}
}
if ($do == 'ban') {
$modulename = $_GPC['modulename'];
$ban = $_GPC['ban'];
if (empty($modulename)) {
message('请设置模块名', referer(), 'error');
}
if (!is_array($_W['setting']['module_receive_ban'])) {
$_W['setting']['module_receive_ban'] = array();
}
if (empty($ban)) {
$_W['setting']['module_receive_ban'][$modulename] = $modulename;
} else {
unset($_W['setting']['module_receive_ban'][$modulename]);
}
setting_save($_W['setting']['module_receive_ban'], 'module_receive_ban');
cache_build_module_subscribe_type();
message($module_ban, '', 'ajax');
}
示例2: array
$data = array('global' => array('default_theme' => get_variable('default_theme', 'POST', ''), 'link_optimization' => get_variable('link_optimization', 'POST', 0, 'int'), 'site_name' => get_variable('site_name', 'POST', ''), 'site_url' => get_variable('site_url', 'POST', ''), 'foot1' => get_variable('foot1', 'POST', ''), 'foot2' => get_variable('foot2', 'POST', '')), 'email' => array('email_enable' => get_variable('email_enable', 'POST') ? 1 : 0, 'email_function_name' => get_variable('email_function_name', 'POST', ''), 'smtp' => get_variable('smtp', 'POST', 0, 'int'), 'smtp_host' => get_variable('smtp_host', 'POST', ''), 'smtp_port' => get_variable('smtp_port', 'POST', '', 'int'), 'smtp_username' => get_variable('smtp_username', 'POST', ''), 'smtp_password' => get_variable('smtp_password', 'POST', ''), 'site_email' => get_variable('site_email', 'POST', '')));
setting_save($data);
unset($data);
}
global $_CLASS, $_CORE_CONFIG;
$_CLASS['core_template']->assign_array(array('A_OPTION' => 'site', 'ACTION' => generate_link('system', array('admin' => true)), 'LINK_OPTIMIZATION' => $_CORE_CONFIG['global']['link_optimization'], 'SELECT_THEME' => select_theme($_CORE_CONFIG['global']['default_theme']), 'SITE_NAME' => $_CORE_CONFIG['global']['site_name'], 'EMAIL_ENABLE' => $_CORE_CONFIG['email']['email_enable'], 'EMAIL_FUNCTION_NAME' => $_CORE_CONFIG['email']['email_function_name'], 'SMTP' => $_CORE_CONFIG['email']['smtp'], 'SMTP_HOST' => $_CORE_CONFIG['email']['smtp_host'], 'SMTP_PORT' => $_CORE_CONFIG['email']['smtp_port'], 'SMTP_USERNAME' => $_CORE_CONFIG['email']['smtp_username'], 'SMTP_PASSWORD' => $_CORE_CONFIG['email']['smtp_password'], 'SITE_EMAIL' => $_CORE_CONFIG['email']['site_email'], 'FOOTER_FIRST' => $_CORE_CONFIG['global']['foot1'], 'FOOTER_SECOND' => $_CORE_CONFIG['global']['foot2']));
$_CLASS['core_template']->display('admin/system/index.html');
break;
case 'system':
if ($save) {
if (!empty($_POST['maintenance_start'])) {
$expires = strtotime($_POST['maintenance_start']);
$_POST['maintenance_start'] = !$expires || $expires === -1 ? 0 : $expires;
}
$data = array('maintenance' => array('active' => get_variable('maintenance', 'POST') ? 1 : 0, 'text' => get_variable('maintenance_text', 'POST', ''), 'start' => get_variable('maintenance_start', 'POST', 0, 'int')), 'server' => array('cookie_domain' => get_variable('cookie_domain', 'POST', ''), 'cookie_name' => get_variable('cookie_name', 'POST', ''), 'cookie_path' => get_variable('cookie_path', 'POST', ''), 'error_options' => get_variable('error_options', 'POST', 0, 'int'), 'site_domain' => get_variable('site_domain', 'POST', ''), 'site_port' => get_variable('site_port', 'POST', ''), 'site_path' => get_variable('site_path', 'POST', ''), 'site_secure' => get_variable('site_secure', 'POST', 0, 'int'), 'ip_check' => get_variable('ip_check', 'POST', 0, 'int'), 'limit_load' => get_variable('limit_load', 'POST', 0, 'int'), 'limit_sessions' => get_variable('limit_sessions', 'POST', 0, 'int'), 'session_length' => get_variable('session_length', 'POST', 600, 'int')));
setting_save($data);
unset($data);
}
global $_CLASS, $_CORE_CONFIG;
$path = str_replace('\\', '/', dirname(getenv('SCRIPT_NAME')));
if (substr($path, -1) !== '/') {
$path .= '/';
}
$domain = empty($_SERVER['SERVER_NAME']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];
$_CLASS['core_template']->assign_array(array('A_OPTION' => 'system', 'ACTION' => generate_link('system&mode=system', array('admin' => true)), 'COOKIE_DOMAIN' => $_CORE_CONFIG['server']['cookie_domain'], 'COOKIE_NAME' => $_CORE_CONFIG['server']['cookie_name'], 'COOKIE_PATH' => $_CORE_CONFIG['server']['cookie_path'], 'ERROR' => $_CORE_CONFIG['server']['error_options'], 'MAINTENANCE' => $_CORE_CONFIG['maintenance']['active'], 'MAINTENANCE_MSG' => $_CORE_CONFIG['maintenance']['text'], 'MAINTENANCE_START' => is_numeric($_CORE_CONFIG['maintenance']['start']) ? $_CLASS['core_user']->format_date($_CORE_CONFIG['maintenance']['start'], 'M d, Y h:i a') : '', 'IP_CHECK' => $_CORE_CONFIG['server']['ip_check'], 'SITE_DOMAIN' => $_CORE_CONFIG['server']['site_domain'], 'SITE_PATH' => $_CORE_CONFIG['server']['site_path'], 'SITE_PORT' => $_CORE_CONFIG['server']['site_port'], 'SITE_SECURE' => $_CORE_CONFIG['server']['site_secure'], 'LIMIT_LOAD' => $_CORE_CONFIG['server']['limit_load'], 'LIMIT_SESSIONS' => $_CORE_CONFIG['server']['limit_sessions'], 'SESSION_LENGTH' => $_CORE_CONFIG['server']['session_length']));
$_CLASS['core_template']->display('admin/system/index.html');
break;
}
function setting_save($data)
{
global $_CLASS, $_CORE_CONFIG;
示例3: model
<?php
/**
* BAE相关设置选项
* [WeEngine System] Copyright (c) 2013 WE7.CC
*/
include model('setting');
if (checksubmit('bae_delete_update') || checksubmit('bae_delete_install')) {
if (!empty($_GPC['bae_delete_update'])) {
unlink(IA_ROOT . '/data/update.lock');
} elseif (!empty($_GPC['bae_delete_install'])) {
unlink(IA_ROOT . '/data/install.lock');
}
message('操作成功!', create_url('setting/common'), 'success');
} elseif (checksubmit('submit')) {
setting_save(array('msg_history' => $_GPC['msg_history'], 'msg_maxday' => intval($_GPC['msg_maxday']), 'use_ratio' => intval($_GPC['use_ratio'])), 'stat');
message('更新设置成功!', create_url('setting/common'));
} else {
$settings = pdo_fetchall('SELECT * FROM ' . tablename('settings'), array(), 'key');
if(is_array($settings)) {
foreach($settings as $k => &$v) {
$settings[$k] = iunserializer($v['value']);
}
}
template('setting/common');
}
示例4: message
message('操作成功!', url('system/common'), 'success');
}
if (checksubmit('submit')) {
$mail = array('username' => $_GPC['username'], 'password' => $_GPC['password'], 'smtp' => $_GPC['smtp'], 'sender' => $_GPC['sender'], 'signature' => $_GPC['signature']);
setting_save($mail, 'mail');
$row = pdo_fetchcolumn("SELECT `notify` FROM " . tablename('uni_settings') . " WHERE uniacid = :uniacid", array(':uniacid' => $_W['uniacid']));
$notify = iunserializer($row);
if (!is_array($notify)) {
$notify['sms'] = array();
$notify['sms']['balance'] = 0;
$notify['sms']['signature'] = '系统默认';
}
$notify['mail'] = $mail;
$update = array();
$update['notify'] = iserializer($notify);
pdo_update('uni_settings', $update, array('uniacid' => $_W['uniacid']));
if (!empty($_GPC['testsend']) && !empty($_GPC['receiver'])) {
$result = ihttp_email($_GPC['receiver'], $_W['setting']['copyright']['sitename'] . '验证邮件' . date('Y-m-d H:i:s'), '如果您收到这封邮件则表示您系统的发送邮件配置成功!');
if (is_error($result)) {
message($result['message']);
}
}
message('更新设置成功!', url('system/common'));
}
if (checksubmit('authmodesubmit')) {
$authmode = intval($_GPC['authmode']);
setting_save($authmode, 'authmode');
message('更新设置成功!', url('system/common'));
}
setting_load(array('authmode', 'mail'));
template('system/common');
示例5: load
<?php
/**
* [SxxPro System] Copyright (c) 2014 012WZ.COM
* SxxPro is NOT a free software, it under the license terms, visited http://www.qdaygroup.com/ for more details.
*/
$_W['page']['title'] = '云服务诊断 - 云服务';
if (checksubmit()) {
load()->model('setting');
setting_save('', 'site');
message('成功清除站点记录.', 'refresh');
}
setting_load('site');
if (empty($_W['setting']['site'])) {
$_W['setting']['site'] = array();
}
template('cloud/diagnose');
示例6: defined
<?php
/**
* [WeEngine System] Copyright (c) 2014 WE7.CC
* WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
*/
defined('IN_IA') or exit('Access Denied');
$_W['page']['title'] = '注册选项 - 用户设置 - 用户管理';
load()->model('setting');
if (checksubmit('submit')) {
setting_save(array('open' => intval($_GPC['open']), 'verify' => intval($_GPC['verify']), 'code' => intval($_GPC['code']), 'groupid' => intval($_GPC['groupid'])), 'register');
message('更新设置成功!', url('user/registerset'));
}
$settings = setting_load('register');
$settings = $settings['register'];
$groups = pdo_fetchall("SELECT id, name FROM " . tablename('users_group') . " ORDER BY id ASC");
template('user/access');
示例7: model
<?php
/**
* BAE相关设置选项
* [WDL] Copyright (c) 2013 wormwood.com
*/
include model('setting');
if (checksubmit('bae_delete_update') || checksubmit('bae_delete_install')) {
if (!empty($_GPC['bae_delete_update'])) {
unlink(IA_ROOT . '/data/update.lock');
} elseif (!empty($_GPC['bae_delete_install'])) {
unlink(IA_ROOT . '/data/install.lock');
}
message('操作成功!', create_url('setting/common'), 'success');
} elseif (checksubmit('submit')) {
$mail = array('username' => $_GPC['username'], 'password' => $_GPC['password'], 'smtp' => $_GPC['smtp'], 'sender' => $_GPC['sender'], 'signature' => $_GPC['signature']);
setting_save($mail, 'mail');
setting_save(intval($_GPC['authmode']), 'authmode');
if (!empty($_GPC['testsend']) && !empty($_GPC['receiver'])) {
$result = ihttp_email($_GPC['receiver'], $_W['setting']['copyright']['sitename'] . '验证邮件' . date('Y-m-d H:i:s'), '如果您收到这封邮件则表示您系统的发送邮件配置成功!');
if (is_error($result)) {
message($result['message']);
}
}
message('更新设置成功!', create_url('setting/common'));
} else {
template('setting/common');
}
示例8: array
$update = array();
$update['notify'] = iserializer($notify);
pdo_update('uni_settings', $update, array('uniacid' => $_W['uniacid']));
if (!empty($_GPC['testsend']) && !empty($_GPC['receiver'])) {
$result = ihttp_email($_GPC['receiver'], $_W['setting']['copyright']['sitename'] . '验证邮件' . date('Y-m-d H:i:s'), '如果您收到这封邮件则表示您系统的发送邮件配置成功!');
if (is_error($result)) {
message($result['message']);
}
}
message('更新设置成功!', url('system/common'));
}
if (checksubmit('authmodesubmit')) {
$authmode = intval($_GPC['authmode']);
setting_save($authmode, 'authmode');
message('更新设置成功!', url('system/common'));
}
if (checksubmit('sms_submit')) {
$sms = $_GPC['sms'];
setting_save($sms, 'sms');
if (!empty($_GPC['sms_testsend']) && !empty($_GPC['sms_receiver'])) {
load()->func('sms');
$content = "您的验证码是:【{$_W['setting']['copyright']['sitename']}短信测试】。如需帮助请联系客服。";
$result = sms_send($_GPC['sms_receiver'], $content, $_W['setting']['copyright']['sitename'], false);
if (is_error($result)) {
message($result['message']);
}
}
message('更新设置成功!', url('system/common'));
}
setting_load(array('authmode', 'mail', 'sms'));
template('system/common');
示例9: elseif
$url = 'http://' . $url;
}
$remote['alioss']['url'] = $url;
}
} elseif ($remote['type'] == '1') {
if (empty($remote['ftp']['host'])) {
message('FTP服务器地址为必填项.');
}
if (empty($remote['ftp']['username'])) {
message('FTP帐号为必填项.');
}
if (empty($remote['ftp']['password'])) {
message('FTP密码为必填项.');
}
}
setting_save($remote, 'remote');
message('远程附件配置信息更新成功!', url('system/attachment/remote'));
}
$remote = $_W['setting']['remote'];
if (!empty($remote['alioss']['key']) && !empty($remote['alioss']['secret'])) {
$buckets = attachment_alioss_buctkets($remote['alioss']['key'], $remote['alioss']['secret']);
}
$bucket_datacenter = array('oss-cn-hangzhou' => '杭州数据中心', 'oss-cn-qingdao' => '青岛数据中心', 'oss-cn-beijing' => '北京数据中心', 'oss-cn-hongkong' => '香港数据中心', 'oss-cn-shenzhen' => '深圳数据中心', 'oss-cn-shanghai' => '上海数据中心', 'oss-us-west-1' => '美国硅谷数据中心');
} elseif ($do == 'buckets') {
$key = $_GPC['key'];
$secret = $_GPC['secret'];
$buckets = attachment_alioss_buctkets($key, $secret);
if (is_error($buckets)) {
message(error(-1), '', 'ajax');
}
$bucket_datacenter = array('oss-cn-hangzhou' => '杭州数据中心', 'oss-cn-qingdao' => '青岛数据中心', 'oss-cn-beijing' => '北京数据中心', 'oss-cn-hongkong' => '香港数据中心', 'oss-cn-shenzhen' => '深圳数据中心', 'oss-cn-shanghai' => '上海数据中心', 'oss-us-west-1' => '美国硅谷数据中心');
示例10: array
<?php
if (checksubmit('token')) {
$filter1 = array('index_image1', 'index_image2', 'index_image3', 'index_image4', 'index_image1_url', 'index_image2_url', 'index_image3_url', 'index_image4_url', 'index_ad1', 'index_ad2', 'index_ad3', 'index_ad4', 'index_ad1_url', 'index_ad2_url', 'index_ad3_url', 'index_ad4_url');
$filter2 = array('index_text1', 'index_text2', 'index_text3', 'index_text4', 'index_text5', 'index_text6', 'index_note', 'index_logo_right');
$newData = cly_array_filter($filter1);
foreach ($filter2 as $v) {
$newData[$v] = $_POST[$v];
}
setting_save($newData);
}
$setting = setting_load();
template('admin/indexpage');
示例11: microtime
$starttime = microtime(true);
$response = cloud_request('http://v2.addons.we7.cc', array(), array('ip' => $_GPC['ip']));
$endtime = microtime(true);
message('请求接口成功,耗时 ' . round($endtime - $starttime, 5) . ' 秒', '', 'ajax');
} else {
if (checksubmit()) {
load()->model('setting');
setting_save('', 'site');
message('成功清除站点记录.', 'refresh');
}
if (checksubmit('updateserverip')) {
load()->model('setting');
if (!empty($_GPC['ip'])) {
setting_save(array('ip' => $_GPC['ip'], 'expire' => TIMESTAMP + 201600), 'cloudip');
} else {
setting_save(array(), 'cloudip');
}
message('修改云服务ip成功.', 'refresh');
}
if (empty($_W['setting']['site'])) {
$_W['setting']['site'] = array();
}
$checkips = array();
if (!empty($_W['setting']['cloudip']['ip'])) {
$checkips[] = $_W['setting']['cloudip']['ip'];
}
if (strexists(strtoupper(PHP_OS), 'WINNT')) {
$cloudip = gethostbyname('v2.addons.we7.cc');
if (!in_array($cloudip, $checkips)) {
$checkips[] = $cloudip;
}
示例12: defined
<?php
/**
* [WeEngine System] Copyright (c) 2014 WE7.CC
* WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
*/
defined('IN_IA') or exit('Access Denied');
setting_load('platform');
if (empty($_W['setting']['platform'])) {
$_W['setting']['platform'] = array('token' => random(32), 'encodingaeskey' => random(43), 'appsecret' => '', 'appid' => '');
setting_save($_W['setting']['platform'], 'platform');
}
$url = parse_url($_W['siteroot']);
if (checksubmit('submit')) {
$data = array('token' => trim($_GPC['platform_token']), 'encodingaeskey' => trim($_GPC['encodingaeskey']), 'appsecret' => trim($_GPC['appsecret']), 'appid' => trim($_GPC['appid']));
setting_save($data, 'platform');
message('更新成功', referer(), 'success');
}
if (!function_exists('mcrypt_module_open')) {
message('抱歉,您的系统不支持加解密 mcrypt 模块,无法进行平台接入');
}
template('extension/platform');
示例13: defined
<?php
defined('IN_IA') or exit('Access Denied');
$dos = array('copyright', 'close');
$do = in_array($do, $dos) ? $do : 'copyright';
load()->model('setting');
load()->func('tpl');
$settings = setting_load('copyright');
$settings = $settings['copyright'];
if (empty($settings) || !is_array($settings)) {
$settings = array();
}
if ($do == 'copyright') {
$_W['page']['title'] = '站点信息设置 - 系统管理';
if (checksubmit('submit')) {
$data = array('sitename' => $_GPC['sitename'], 'url' => strexists($_GPC['url'], 'http://') ? $_GPC['url'] : "http://{$_GPC['url']}", 'statcode' => htmlspecialchars_decode($_GPC['statcode']), 'footerleft' => htmlspecialchars_decode($_GPC['footerleft']), 'footerright' => htmlspecialchars_decode($_GPC['footerright']), 'flogo' => $_GPC['flogo'], 'blogo' => $_GPC['flogo'], 'baidumap' => $_GPC['baidumap'], 'address' => $_GPC['address'], 'phone' => $_GPC['phone'], 'qq' => $_GPC['qq'], 'email' => $_GPC['email'], 'keywords' => $_GPC['keywords'], 'description' => $_GPC['description']);
setting_save($data, 'copyright');
message('更新设置成功!', url('system/site'));
}
}
if ($do == 'close') {
$_W['page']['title'] = '站点信息设置 - 关闭站点';
if (checksubmit('submit')) {
$close['status'] = $_GPC['status'];
$close['reason'] = $_GPC['reason'];
setting_save($close, 'close');
message('站点状态更新成功!', url('system/site/close'));
}
$settings = setting_load('close');
}
template('system/site');
示例14: defined
<?php
/**
* 站点相关操作
* [Weizan System] Copyright (c) 2013 012WZ.COM
*/
defined('IN_IA') or exit('Access Denied');
$dos = array('copyright');
$do = in_array($do, $dos) ? $do : 'copyright';
load()->model('setting');
load()->func('tpl');
$settings = setting_load('copyright');
$settings = $settings['copyright'];
if (empty($settings) || !is_array($settings)) {
$settings = array();
}
if ($do == 'copyright') {
$_W['page']['title'] = '站点信息设置 - 系统管理';
if (checksubmit('submit')) {
$data = array('status' => $_GPC['status'], 'reason' => $_GPC['reason'], 'sitename' => $_GPC['sitename'], 'url' => strexists($_GPC['url'], 'http://') ? $_GPC['url'] : "http://{$_GPC['url']}", 'statcode' => htmlspecialchars_decode($_GPC['statcode']), 'footerleft' => htmlspecialchars_decode($_GPC['footerleft']), 'footerright' => htmlspecialchars_decode($_GPC['footerright']), 'icon' => $_GPC['icon'], 'flogo' => $_GPC['flogo'], 'blogo' => $_GPC['blogo'], 'baidumap' => $_GPC['baidumap'], 'company' => $_GPC['company'], 'address' => $_GPC['address'], 'person' => $_GPC['person'], 'phone' => $_GPC['phone'], 'qq' => $_GPC['qq'], 'email' => $_GPC['email'], 'keywords' => $_GPC['keywords'], 'description' => $_GPC['description'], 'showhomepage' => intval($_GPC['showhomepage']));
setting_save($data, 'copyright');
message('更新设置成功!', url('system/site'));
}
}
template('system/site');
示例15: defined
defined('IN_IA') or exit('Access Denied');
$dos = array('addons');
$do = in_array($do, $dos) ? $do : 'addons';
load()->model('setting');
load()->func('tpl');
$settings = setting_load('addons');
$settings = $settings['addons'];
if (empty($settings) || !is_array($settings)) {
$settings = array();
}
if ($do == 'addons') {
$_W['page']['title'] = '云服务 - 管理应用商城 - 切换应用商城';
if (checksubmit('submit')) {
if ($_GPC['addons_site'] == 0) {
$addons_url = 'http://addons.weizancms.com';
$c_url = 'http://www.012wz.com';
} elseif ($_GPC['addons_site'] == 1) {
$addons_url = 'http://wdl.weizancms.com';
$c_url = 'http://www.wdlcms.com';
} elseif ($_GPC['addons_site'] == 2) {
$addons_url = 'http://addons.we7cms.cn';
$c_url = 'http://www.012wz.com';
} else {
$addons_url = $_GPC['addons_url'];
}
$data = array('addons_site' => $_GPC['addons_site'], 'addons_url' => $addons_url, 'c_url' => $c_url);
setting_save($data, 'addons');
message('更新设置成功!', 'refresh');
}
}
template('cloud/addons');