本文整理汇总了PHP中setting_load函数的典型用法代码示例。如果您正苦于以下问题:PHP setting_load函数的具体用法?PHP setting_load怎么用?PHP setting_load使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setting_load函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cloud_prepare
function cloud_prepare()
{
global $_W;
setting_load('site');
if (empty($_W['setting']['site']['key']) || empty($_W['setting']['site']['token'])) {
return error('-1', "您的程序需要在微擎云服务平台注册你的站点资料, 来接入云平台服务后才能使用相应功能.");
}
return true;
}
示例2: _login
function _login($forward = '')
{
global $_GPC, $_W;
load()->model('user');
$member = array();
$username = trim($_GPC['username']);
if (empty($username)) {
message('请输入要登录的用户名');
}
$member['username'] = $username;
$member['password'] = $password = $_GPC['password'];
if (empty($member['password'])) {
message('请输入密码');
}
$record = user_single($member);
if (!empty($record)) {
/*if($record['status'] == 1) {
message('您的账号正在审核或是已经被系统禁止,请联系网站管理员解决!');
}*/
$founders = explode(',', $_W['config']['setting']['founder']);
$_W['isfounder'] = in_array($record['uid'], $founders);
if ($_W['siteclose'] && !$_W['isfounder']) {
$settings = setting_load('copyright');
message('站点已关闭,关闭原因:' . $settings['copyright']['reason']);
}
$cookie = array();
$cookie['uid'] = $record['uid'];
$cookie['lastvisit'] = $record['lastvisit'];
$cookie['lastip'] = $record['lastip'];
$cookie['hash'] = md5($record['password'] . $record['salt']);
$session = base64_encode(json_encode($cookie));
isetcookie('__session', $session, !empty($_GPC['rember']) ? 7 * 86400 : 0);
$status = array();
$status['uid'] = $record['uid'];
$status['lastvisit'] = TIMESTAMP;
$status['lastip'] = CLIENT_IP;
user_update($status);
if (empty($forward)) {
$forward = $_GPC['forward'];
}
if (empty($forward)) {
$forward = './index.php?c=index&a=index';
}
$_W['user'] = $record;
if (cly_isAdmin()) {
message('', url('admin/index'));
} else {
message('', $forward);
}
//message("欢迎回来,{$record['username']}。", $forward);
} else {
message('登录失败,请检查您输入的用户名和密码!');
}
}
示例3: setting_module_load
function setting_module_load($module, $key = '', $default = null)
{
$setting = setting_load($module);
$module = $setting[$module];
if (empty($key)) {
return $module;
} else {
if (isset($module[$key])) {
return $module[$key];
}
return $default;
}
}
示例4: __construct
function __construct($account = array())
{
$setting = setting_load('platform');
$this->appid = $setting['platform']['appid'];
$this->appsecret = $setting['platform']['appsecret'];
$this->token = $setting['platform']['token'];
$this->encodingaeskey = $setting['platform']['encodingaeskey'];
$this->account = $account;
if ($this->account['key'] == 'wx570bc396a51b8ff8') {
$this->account['key'] = $this->appid;
$this->openPlatformTestCase();
}
$this->account['key'] = $this->appid;
}
示例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: unset
}
unset($cplen, $key, $value);
$_GPC = array_merge($_GET, $_POST, $_GPC);
$_GPC = ihtmlspecialchars($_GPC);
if (!$_W['isajax']) {
$input = file_get_contents("php://input");
if (!empty($input)) {
$__input = @json_decode($input, true);
if (!empty($__input)) {
$_GPC['__input'] = $__input;
$_W['isajax'] = true;
}
}
unset($input, $__input);
}
setting_load('upload');
if (empty($_W['setting']['upload'])) {
$_W['setting']['upload'] = array_merge($_W['config']['upload']);
}
$_W['attachurl'] = empty($_W['config']['upload']['attachurl']) ? $_W['siteroot'] . $_W['config']['upload']['attachdir'] . '/' : $_W['config']['upload']['attachurl'] . '/';
$_W['os'] = Agent::deviceType();
if ($_W['os'] == Agent::DEVICE_MOBILE) {
$_W['os'] = 'mobile';
} elseif ($_W['os'] == Agent::DEVICE_DESKTOP) {
$_W['os'] = 'windows';
} else {
$_W['os'] = 'unknown';
}
$_W['container'] = Agent::browserType();
if (Agent::isMicroMessage() == Agent::MICRO_MESSAGE_YES) {
$_W['container'] = 'wechat';
示例7: array
*/
$_W['page']['title'] = '云服务诊断 - 云服务';
$dos = array('display', 'testapi');
$do = in_array($do, $dos) ? $do : 'display';
if ($do == 'testapi') {
load()->model('cloud');
$starttime = microtime(true);
$response = cloud_request('http://v2.addons.we7.cc');
$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($_GPC['ip'], 'cloudip');
} else {
setting_save('', 'cloudip');
}
message('修改云服务ip成功.', 'refresh');
}
setting_load(array('site', 'cloudip'));
if (empty($_W['setting']['site'])) {
$_W['setting']['site'] = array();
}
template('cloud/diagnose');
}
示例8: explode
if (is_array($user) && $session['hash'] == md5($user['password'] . $user['salt'])) {
$_W['uid'] = $user['uid'];
$_W['username'] = $user['username'];
$user['currentvisit'] = $user['lastvisit'];
$user['currentip'] = $user['lastip'];
$user['lastvisit'] = $session['lastvisit'];
$user['lastip'] = $session['lastip'];
$_W['user'] = $user;
$founders = explode(',', $_W['config']['setting']['founder']);
$_W['isfounder'] = in_array($_W['uid'], $founders);
unset($founders);
} else {
isetcookie('__session', false, -100);
}
unset($user);
}
unset($session);
if (!empty($_GPC['__uniacid'])) {
$_W['uniacid'] = intval($_GPC['__uniacid']);
$_W['weid'] = $_W['uniacid'];
$_W['uniaccount'] = $_W['account'] = uni_fetch($_W['uniacid']);
if (!empty($_W['uid'])) {
$_W['role'] = uni_permission($_W['uid'], $_W['uniacid']);
}
}
setting_load('basic');
$_W['template'] = 'default';
if (!empty($_W['setting']['basic']['template'])) {
$_W['template'] = $_W['setting']['basic']['template'];
}
load()->func('compat.biz');
示例9: defined
<?php
/**
* [WeiZan System] Copyright (c) 2014 WeiZan.Com
* WeiZan is NOT a free software, it under the license terms, visited http://www.012wz.com/ for more details.
*/
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'];
}
示例10: 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');
示例11: 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');
示例12: defined
<?php
/**
* [Weizan System] Copyright (c) 2014 wdlcms.com
* Weizan is NOT a free software, it under the license terms, visited http://www.wdlcms.com/ for more details.
*/
defined('IN_IA') or exit('Access Denied');
$do = in_array($_GPC['do'], array('upload')) ? $_GPC['do'] : 'upload';
$type = in_array($_GPC['type'], array('image', 'audio')) ? $_GPC['type'] : 'image';
$result = array('error' => 1, 'message' => '');
if ($do == 'upload') {
if ($type == 'image') {
$result = array('jsonrpc' => '2.0', 'id' => 'id', 'error' => array('code' => 1, 'message' => ''));
load()->model('setting');
$uploadsetting = setting_load('upload');
$uploadsetting = $uploadsetting['upload'];
$thumb = empty($uploadsetting['image']['thumb']) ? 0 : 1;
$width = intval($uploadsetting['image']['width']);
load()->func('file');
if (!empty($_FILES['file']['name'])) {
if ($_FILES['file']['error'] != 0) {
$result['error']['message'] = '上传失败,请重试!';
die(json_encode($result));
}
$_W['uploadsetting'] = array();
$_W['uploadsetting']['image']['folder'] = 'images/' . $_W['uniacid'];
$_W['uploadsetting']['image']['extentions'] = $_W['config']['upload']['image']['extentions'];
$_W['uploadsetting']['image']['limit'] = $_W['config']['upload']['image']['limit'];
$file = file_upload($_FILES['file']);
if (is_error($file)) {
$result['error']['message'] = $file['message'];
示例13: sms_send
function sms_send($mobile = '', $content = '', $signature = '', $check = true)
{
global $_W;
$setting = setting_load('sms');
if (empty($setting['sms'])) {
return error(1, "未设置短信接口,无法发送短信!");
}
if (!empty($setting['sms']) && $setting['sms']['type'] == 'yimei') {
if (empty($setting['sms']['url']) || empty($setting['sms']['password']) || empty($setting['sms']['serialNumber']) || empty($setting['sms']['sessionKey'])) {
return error(1, "亿美短信接口配置不完整,无法发送短信!");
}
}
if (!empty($setting['sms']) && $setting['sms']['type'] == 'dxton') {
if (empty($setting['sms']['dxton_username']) || empty($setting['sms']['dxton_pwd'])) {
return error(1, "短信通接口配置不完整,无法发送短信!");
}
}
$config = $setting['sms'];
$smsconfig = array("balance" => 0, "signature" => $_W['setting']['sitename']);
$row = pdo_fetch("SELECT `notify` FROM " . tablename('uni_settings') . " WHERE uniacid = :uniacid", array(':uniacid' => $_W['uniacid']));
$row['notify'] = @iunserializer($row['notify']);
if (!empty($row['notify']) && !empty($row['notify']['sms'])) {
$smsconfig = $row['notify']['sms'];
}
if ($check) {
if (intval($smsconfig['balance']) <= 0) {
return error(1, "短信条数不足,请联系客服人员");
}
}
if (empty($signature)) {
$signature = "";
}
if ($config['type'] == 'yimei') {
$content = "【" . $signature . "】" . $content;
$sms = new SMSUtil($config['url'], $config['serialNumber'], $config['password'], $config['sessionKey'], array("proxyhost" => $config['proxyhost'], "proxyport" => $config['proxyport'], "proxyusername" => $config['proxyusername'], "proxypassword" => $config['proxypassword']), $config['timeout'], $config['response_timeout']);
$err = $sms->send($mobile, $content);
if (empty($err)) {
$row['notify']['sms']['balance'] = intval($row['notify']['sms']['balance']) - 1;
pdo_update('uni_settings', array('notify' => iserializer($row['notify'])), array('uniacid' => $_W['uniacid']));
return true;
} else {
return error(1, $err);
}
} else {
if ($config['type'] == 'dxton') {
$username = $config['dxton_username'];
$pwd = $config['dxton_pwd'];
$target = "http://www.dxton.com/webservice/sms.asmx/Submit";
$post_data = "account=" . $username . "&password=" . $pwd . "&mobile=" . $mobile . "&content=" . rawurlencode($content);
$result = ihttp_request($target, $post_data);
$xml = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA);
$result = (string) $xml->result;
$message = (string) $xml->message;
if ($result == '100') {
$row['notify']['sms']['balance'] = intval($row['notify']['sms']['balance']) - 1;
pdo_update('uni_settings', array('notify' => iserializer($row['notify'])), array('uniacid' => $_W['uniacid']));
return true;
}
return error(1, $message);
}
}
}
示例14: check_shop_auth
function check_shop_auth($url = '', $type = 's')
{
global $_W, $_GPC;
if ($_W['ispost'] && $_GPC['do'] != 'auth') {
$auth = get_auth();
load()->func('communication');
$domain = $_SERVER['HTTP_HOST'];
$ip = gethostbyname($domain);
$setting = setting_load('site');
$id = isset($setting['site']['key']) ? $setting['site']['key'] : '0';
if (empty($type) || $type == 's') {
$post_data = array('type' => $type, 'ip' => $ip, 'id' => $id, 'code' => $auth['code'], 'domain' => $domain);
} else {
$post_data = array('type' => 'm', 'm' => $type, 'ip' => $ip, 'id' => $id, 'code' => $auth['code'], 'domain' => $domain);
}
$resp = ihttp_post($url, $post_data);
$status = $resp['content'];
}
}
示例15: 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');
load()->func('communication');
set_time_limit(0);
$dos = array('ticket', 'forward', 'test');
$do = in_array($do, $dos) ? $do : 'forward';
load()->classs('weixin.platform');
$account_platform = new WeiXinPlatform();
$setting = setting_load('platform');
if ($do == 'forward') {
if (empty($_GPC['auth_code'])) {
message('授权登录失败,请重试', url('account/display'), 'error');
}
$auth_info = $account_platform->getAuthInfo($_GPC['auth_code']);
$auth_refresh_token = $auth_info['authorization_info']['authorizer_refresh_token'];
$auth_appid = $auth_info['authorization_info']['authorizer_appid'];
$account_info = $account_platform->getAccountInfo($auth_appid);
if (is_error($account_info)) {
message('授权登录新建公众号失败,请重试', url('account/display'), 'error');
}
if (!empty($_GPC['test'])) {
echo "此为测试平台接入返回结果:<br/> 公众号名称:{$account_info['authorizer_info']['nick_name']} <br/> 接入状态:成功";
exit;
}
if ($account_info['authorizer_info']['service_type_info'] = '0' || $account_info['authorizer_info']['service_type_info'] == '1') {
if ($account_info['authorizer_info']['verify_type_info'] > -1) {