本文整理汇总了PHP中uni_setting函数的典型用法代码示例。如果您正苦于以下问题:PHP uni_setting函数的具体用法?PHP uni_setting怎么用?PHP uni_setting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了uni_setting函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
global $_W, $_GPC;
$this->_weid = $_W['uniacid'];
$this->_fromuser = $_W['fans']['from_user'];
//debug
if ($_SERVER['HTTP_HOST'] == '127.0.0.1' || $_SERVER['HTTP_HOST'] == 'localhost:8888' || $_SERVER['HTTP_HOST'] == '192.168.1.102:8888') {
$this->_fromuser = 'debug';
}
$this->_auth2_openid = 'auth2_openid_' . $_W['uniacid'];
$this->_auth2_nickname = 'auth2_nickname_' . $_W['uniacid'];
$this->_auth2_headimgurl = 'auth2_headimgurl_' . $_W['uniacid'];
$this->_appid = '';
$this->_appsecret = '';
$this->_accountlevel = $_W['account']['level'];
//是否为高级号
if (!empty($_SESSION['oauth_openid'])) {
$this->_fromuser = $_SESSION['oauth_openid'];
}
if ($this->_accountlevel < 4) {
$setting = uni_setting($this->_weid);
$oauth = $setting['oauth'];
if (!empty($oauth) && !empty($oauth['account'])) {
$this->_account = account_fetch($oauth['account']);
$this->_appid = $this->_account['key'];
$this->_appsecret = $this->_account['secret'];
}
} else {
$this->_appid = $_W['account']['key'];
$this->_appsecret = $_W['account']['secret'];
}
}
示例2: payResult
public function payResult($params)
{
load()->model('mc');
$status = pdo_fetchcolumn("SELECT status FROM " . tablename('mc_credits_recharge') . " WHERE tid = :tid", array(':tid' => $params['tid']));
if (empty($status)) {
$credit1_lv = $this->module['config']['credit1_lv'] ? $this->module['config']['credit1_lv'] : 1;
$fee = $params['fee'] / $credit1_lv;
$data = array('status' => $params['result'] == 'success' ? 1 : -1);
if ($params['type'] == 'wechat') {
$data['transid'] = $params['tag']['transaction_id'];
$params['user'] = mc_openid2uid($params['user']);
}
pdo_update('mc_credits_recharge', $data, array('tid' => $params['tid']));
if ($params['result'] == 'success' && $params['from'] == 'notify') {
$setting = uni_setting($_W['uniacid'], array('creditbehaviors'));
//a:2:{s:8:"activity";s:7:"credit1";s:8:"currency";s:7:"credit2";}
$credit = $setting['creditbehaviors']['activity'];
if (empty($credit)) {
message('站点积分行为参数配置错误,请联系服务商', '', 'error');
} else {
$paydata = array('wechat' => '微信', 'alipay' => '支付宝');
$record[] = $params['user'];
$record[] = '用户通过' . $paydata[$params['type']] . '充值' . $fee . '积分';
mc_credit_update($params['user'], $credit, $fee, $record);
}
}
}
if ($params['from'] == 'return') {
if ($params['result'] == 'success') {
message('支付成功!', '../../app/' . url('mc/home'), 'success');
} else {
message('支付失败!', '../../app/' . url('mc/home'), 'error');
}
}
}
示例3: fieldsFormDisplay
public function fieldsFormDisplay($rid = 0)
{
load()->model('mc');
global $_W, $_GPC;
//要嵌入规则编辑页的自定义内容,这里 $rid 为对应的规则编号,新增时为 0
$creditnames = uni_setting($_W['uniacid'], array('creditnames'));
if ($creditnames) {
foreach ($creditnames['creditnames'] as $index => $creditname) {
if ($creditname['enabled'] == 0) {
unset($creditnames['creditnames'][$index]);
}
}
$scredit = implode(', ', array_keys($creditnames['creditnames']));
} else {
$scredit = '';
}
$groups = mc_groups($_W['uniacid']);
$couponlists = pdo_fetchall('SELECT couponid,title,type,credittype,credit,endtime,amount,dosage FROM ' . tablename('activity_coupon') . ' WHERE uniacid = :uniacid AND type = :type AND endtime > :endtime ORDER BY endtime ASC ', array(':uniacid' => $_W['uniacid'], ':type' => 1, ':endtime' => TIMESTAMP));
$tokenlists = pdo_fetchall('SELECT couponid,title,type,credittype,credit,endtime,amount,dosage FROM ' . tablename('activity_coupon') . ' WHERE uniacid = :uniacid AND type = :type AND endtime > :endtime ORDER BY endtime ASC ', array(':uniacid' => $_W['uniacid'], ':type' => 2, ':endtime' => TIMESTAMP));
$goodslists = pdo_fetchall('SELECT id,title,type,credittype,endtime,total,num,credit FROM ' . tablename('activity_exchange') . ' WHERE uniacid = :uniacid AND type = :type AND endtime > :endtime ORDER BY endtime ASC', array(':uniacid' => $_W['uniacid'], ':type' => 3, ':endtime' => TIMESTAMP));
//print_r($couponlists);
load()->func('tpl');
if ($rid == 0) {
$reply = array('title' => '幸运大抽奖活动开始了!', 'description' => '幸运大抽奖活动开始啦!', 'tips' => '每次抽奖需要花费50积分,一等奖为39元的现金抵扣券,二等奖为100积分,三等奖为50积分,四等奖为30积分。每人每天限抽2次。', 'remark' => '中奖积分请到会员主页查看', 'starttime' => time(), 'endtime' => time() + 10 * 84400, 'reg' => '0', 'status' => '1', 'awardnum' => '1', 'playnum' => '5', 'dayplaynum' => '1', 'zfcs' => '1', 'zjcs' => '1', 'rate' => '10', 'need_type' => 'credit1', 'need_num' => '0', 'give_type' => 'credit1', 'give_num' => '0', 'onlynone' => '1', 'share_title' => '欢迎参加幸运大抽奖活动', 'share_content' => '亲,欢迎参加幸运大抽奖活动,祝您好运哦!! 亲,需要绑定账号才可以参加哦');
$prizes = array('p1_type' => 'credit1');
} else {
$reply = pdo_fetch("SELECT * FROM " . tablename($this->table_reply) . " WHERE rid = :rid ORDER BY `id` DESC", array(':rid' => $rid));
$prizes = iunserializer($reply['prizes']);
}
include $this->template('form');
}
示例4: fieldsFormDisplay
public function fieldsFormDisplay($rid = 0)
{
global $_W;
$uniacid = $_W['uniacid'];
load()->func('tpl');
$creditnames = array();
$unisettings = uni_setting($uniacid, array('creditnames'));
foreach ($unisettings['creditnames'] as $key => $credit) {
if (!empty($credit['enabled'])) {
$creditnames[$key] = $credit['title'];
}
}
if (!empty($rid)) {
$reply = pdo_fetch("SELECT * FROM " . tablename('stonefish_planting_reply') . " WHERE rid = :rid ORDER BY `id` DESC", array(':rid' => $rid));
$share = pdo_fetchall("SELECT * FROM " . tablename('stonefish_planting_share') . " WHERE rid = :rid ORDER BY `id` DESC", array(':rid' => $rid));
$prize = pdo_fetchall("SELECT * FROM " . tablename('stonefish_planting_prize') . " WHERE rid = :rid ORDER BY `id` asc", array(':rid' => $rid));
//查询奖品是否可以删除
foreach ($prize as $mid => $prizes) {
$prize[$mid]['fans'] = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename('stonefish_planting_award') . " WHERE prizetype = :prizeid", array(':prizeid' => $prizes['id']));
$prize[$mid]['delete_url'] = $this->createWebUrl('deleteprize', array('rid' => $rid, 'id' => $prizes['id']));
}
//查询奖品是否可以删除
}
$seed = pdo_fetchall("SELECT * FROM " . tablename('stonefish_planting_seed') . " WHERE uniacid = :uniacid Or uniacid = 0 ORDER BY `id` asc", array(':uniacid' => $uniacid));
if (!$reply) {
$now = time();
$reply = array("title" => "种值活动开始了!", "start_picurl" => "../addons/stonefish_planting/template/images/start.jpg", "description" => "欢迎参加种值活动", "repeat_lottery_reply" => "亲,继续努力哦~~", "ticket_information" => "请用力摇晃你的手机抽奖", "starttime" => $now, "endtime" => strtotime(date("Y-m-d H:i", $now + 7 * 24 * 3600)), "end_theme" => "种值活动已经结束了", "end_instruction" => "亲,活动已经结束,请继续关注我们的后续活动哦~", "end_picurl" => "../addons/stonefish_planting/template/images/end.jpg", "homepic" => "../addons/stonefish_planting/template/images/home.jpg", "adpic" => "../addons/stonefish_planting/template/images/banner.png", "award_times" => 1, "credit_times" => 5, "show_num" => 2, "awardnum" => 50, "xuninum" => 500, "xuninumtime" => 86400, "xuninuminitial" => 10, "xuninumending" => 100, "ticketinfo" => "请输入详细资料,兑换奖品", "isrealname" => 1, "ismobile" => 1, "isfans" => 1, "isfansname" => "真实姓名,手机号码,QQ号,邮箱,地址,性别,固定电话,证件号码,公司名称,职业,职位", "homepictime" => 0);
} else {
$reply['notawardtext'] = implode("\n", (array) iunserializer($reply['notawardtext']));
}
//print_r(uni_modules($enabledOnly = true));
//exit;
//查询是否有商户网点权限
$modules = uni_modules($enabledOnly = true);
$modules_arr = array();
$modules_arr = array_reduce($modules, create_function('$v,$w', '$v[$w["mid"]]=$w["name"];return $v;'));
if (in_array('stonefish_branch', $modules_arr)) {
$stonefish_branch = true;
}
//查询是否有商户网点权限
//查询子公众号信息
$acid_arr = uni_accounts();
$ids = array();
$ids = array_map('array_shift', $acid_arr);
//子公众账号Arr数组
$ids_num = count($ids);
//多少个子公众账号
$one = current($ids);
//查询子公众号信息
if (!$share) {
$share = array();
foreach ($ids as $acid => $idlists) {
$share[$acid] = array("acid" => $acid, "share_url" => $acid_arr[$acid]['subscribeurl'], "share_title" => "已有#参与人数#人参与本活动了,你的朋友#参与人# 还中了大奖:#奖品#,请您也来试试吧!", "share_desc" => "亲,欢迎参加种值活动,祝您好运哦!! 亲,需要绑定账号才可以参加哦", "share_picurl" => "../addons/stonefish_planting/template/images/share.png", "share_pic" => "../addons/stonefish_planting/template/images/img_share.png", "sharenumtype" => 0, "sharenum" => 0, "sharetype" => 1);
}
}
include $this->template('form');
}
示例5: getSysInfo
private function getSysInfo()
{
global $_W;
load()->model('activity');
$sysInfo = array();
$setting = uni_setting($_W['uniacid'], array('creditnames', 'creditbehaviors', 'uc'));
$sysInfo['behavior'] = $setting['creditbehaviors'];
$sysInfo['creditnames'] = $setting['creditnames'];
return $sysInfo;
}
示例6: uni_group_check
function uni_group_check()
{
global $_W;
$uniacid = $_W['uniacid'];
$settings = uni_setting($uniacid, array('groupdata'));
$groupdata = $settings['groupdata'] ? $settings['groupdata'] : array();
if ($_W['account']['groupid'] != 0 && $groupdata['isexpire'] == 1 && $groupdata['endtime'] < TIMESTAMP) {
pdo_update('uni_account', array('groupid' => 0), array('uniacid' => $uniacid));
pdo_update('uni_settings', array('groupdata' => iserializer(array('isexpire' => 1, 'endtime' => $groupdata['endtime'], 'oldgroupid' => $_W['account']['groupid']))), array('uniacid' => $uniacid));
$_W['account']['groupid'] = 0;
load()->model('module');
module_build_privileges();
return true;
}
return false;
}
示例7: settingsDisplay
public function settingsDisplay($settings)
{
global $_GPC, $_W;
$credits = uni_setting($_W['uniacid'], 'creditnames');
$cls = new Prize();
list($code, $groups) = $cls->groups();
if (checksubmit()) {
$cfg = array('times' => $_GPC['times'], 'start_time' => $_GPC['start_time'], 'end_time' => $_GPC['end_time'], 'prize_group' => $_GPC['prize_group'], 'credit_type' => $_GPC['credit_type'], 'credit' => intval($_GPC['credit']), 'rank' => intval($_GPC['rank']));
$start_time = $cfg['start_time'];
$start_time = strtotime($start_time);
$end_time = $cfg['end_time'];
$end_time = strtotime($end_time);
if ($start_time >= $end_time) {
message('开始时间不得晚于结束时间', 'refresh', 'error');
} elseif ($this->saveSettings($cfg)) {
message('保存成功', 'refresh');
}
}
if (!isset($settings) || empty($settings)) {
$UnIaCid = $_W['uniacid'];
$par = array(':module' => $this->modulename, ':uniacid' => $UnIaCid);
$sql = "SELECT COUNT(*) FROM " . tablename("uni_account_modules") . " WHERE module=:module AND uniacid=:uniacid";
$row = pdo_fetchcolumn($sql, $par);
if (empty($row) || intval($row) <= 0) {
$cfg = array('module' => $this->modulename, 'uniacid' => $UnIaCid, 'enabled' => 1);
pdo_insert("uni_account_modules", $cfg);
}
}
if (!isset($settings['times'])) {
$settings['times'] = '1';
}
if (!isset($settings['start_time'])) {
$settings['start_time'] = '08:30';
}
if (!isset($settings['end_time'])) {
$settings['end_time'] = '22:00';
}
if (!isset($settings['credit'])) {
$settings['credit'] = '1';
}
if (!isset($settings['rank'])) {
$settings['rank'] = '10';
}
include $this->template('setting');
}
示例8: doWebFinancialCenter
public function doWebFinancialCenter()
{
global $_W, $_GPC;
//这个操作被定义用来呈现 管理中心导航菜单
if ($_W['ispost'] && $_W['isajax']) {
$setting = uni_setting($_W['uniacid'], array('groupdata'));
$setting["groupdata"]["is_auto"] = $_GPC["is_auto"];
pdo_update("uni_settings", array("groupdata" => iserializer($setting["groupdata"])), array("uniacid" => $_W['uniacid']));
die(json_encode(array("code" => 1, "message" => "操作成功.")));
}
$settings = get_settings();
$service = explode("|", $settings["service_qqs"]);
$qqs = array();
foreach ($service as $ser) {
list($name, $qq) = explode("-", $ser);
$qqs[] = array("name" => $name, "qq" => $qq);
}
include $this->template('financial_center');
}
示例9: respond
public function respond()
{
global $_W, $engine;
if ($this->message['type'] == 'trace') {
return $this->respText('');
}
$setting = uni_setting($_W['uniacid'], array('default'));
if (!empty($setting['default'])) {
$flag = array('image' => 'url', 'link' => 'url', 'text' => 'content');
$message = $this->message;
$message['type'] = 'text';
$message['content'] = $setting['default'];
$message['redirection'] = true;
$message['source'] = 'default';
$message['original'] = $this->message[$flag[$this->message['type']]];
$pars = $engine->analyzeText($message);
if (is_array($pars)) {
return array('params' => $pars);
}
}
}
示例10: pay
protected function pay($params = array())
{
global $_W;
$params['module'] = $this->module['name'];
$sql = 'SELECT * FROM ' . tablename('core_paylog') . ' WHERE `uniacid`=:uniacid AND `module`=:module AND `tid`=:tid';
$pars = array();
$pars[':uniacid'] = $_W['uniacid'];
$pars[':module'] = $params['module'];
$pars[':tid'] = $params['tid'];
$log = pdo_fetch($sql, $pars);
if (!empty($log) && $log['status'] == '1') {
message('这个订单已经支付成功, 不需要重复支付.');
}
$setting = uni_setting($_W['uniacid'], array('payment', 'creditbehaviors'));
if (!is_array($setting['payment'])) {
message('没有有效的支付方式, 请联系网站管理员.');
}
$pay = $setting['payment'];
$pay['credit']['switch'] = false;
$pay['delivery']['switch'] = false;
include $this->template('common/paycenter');
}
示例11: receive
public function receive()
{
global $_W;
//这里定义此模块进行消息订阅时的, 消息到达以后的具体处理过程, 请查看微赞文档来编写你的代码
$stat_setting = uni_setting($_W['uniacid'], 'stat');
$stat_setting = $stat_setting['stat'];
if (!is_array($stat_setting) || empty($stat_setting)) {
$stat_setting = array();
$stat_setting['msg_maxday'] = 0;
$stat_setting['msg_history'] = 1;
$stat_setting['use_ratio'] = 1;
}
if (!empty($stat_setting['msg_maxday']) && $stat_setting['msg_maxday'] > 0) {
pdo_delete('stat_msg_history', " createtime < " . TIMESTAMP . ' - ' . $stat_setting['msg_maxday'] * 86400);
}
if ($stat_setting['msg_history']) {
switch ($this->message['type']) {
case 'text':
$content = iserializer(array('content' => $this->message['content'], 'redirection' => $this->message['redirection'], 'source' => $this->message['source']));
break;
default:
$content = $this->message['content'];
}
pdo_insert('stat_msg_history', array('uniacid' => $_W['uniacid'], 'module' => $this->params['module'], 'from_user' => $this->message['from'], 'rid' => intval($this->params['rule']), 'kid' => $this->keyword['id'], 'message' => $content, 'type' => $this->message['type'], 'createtime' => $this->message['time']));
}
if (!empty($stat_setting['use_ratio'])) {
$updateid = pdo_query("UPDATE " . tablename('stat_rule') . " SET hit = hit + 1, lastupdate = '" . TIMESTAMP . "' WHERE rid = :rid AND createtime = :createtime", array(':rid' => $this->params['rule'], ':createtime' => strtotime(date('Y-m-d'))));
if (empty($updateid)) {
pdo_insert('stat_rule', array('uniacid' => $_W['uniacid'], 'rid' => $this->params['rule'], 'createtime' => strtotime(date('Y-m-d')), 'hit' => 1, 'lastupdate' => $this->message['time']));
}
if (!empty($this->keyword['id'])) {
$updateid = pdo_query("UPDATE " . tablename('stat_keyword') . " SET hit = hit + 1, lastupdate = '" . TIMESTAMP . "' WHERE kid = :kid AND createtime = :createtime", array(':kid' => $this->keyword['id'], ':createtime' => strtotime(date('Y-m-d'))));
if (empty($updateid)) {
pdo_insert('stat_keyword', array('uniacid' => $_W['uniacid'], 'rid' => $this->params['rule'], 'kid' => $this->keyword['id'], 'createtime' => strtotime(date('Y-m-d')), 'hit' => 1, 'lastupdate' => $this->message['time']));
}
}
}
}
示例12: app_navs
function app_navs($type = 'home', $multiid = 0, $section = 0)
{
global $_W;
$pos = array();
$pos['home'] = 1;
$pos['profile'] = 2;
$pos['shortcut'] = 3;
if (empty($multiid) && $type != 'profile') {
load()->model('account');
$setting = uni_setting($_W['uniacid'], array('default_site'));
$multiid = $setting['default_site'];
}
$sql = "SELECT id,name, description, url, icon, css, position, module FROM " . tablename('site_nav') . " WHERE position = '{$pos[$type]}' AND status = 1 AND uniacid = '{$_W['uniacid']}' AND multiid = '{$multiid}' ORDER BY displayorder DESC, id DESC";
$navs = pdo_fetchall($sql);
if (!empty($navs)) {
foreach ($navs as &$row) {
if (!strexists($row['url'], 'tel:') && !strexists($row['url'], '://') && !strexists($row['url'], 'www') && !strexists($row['url'], 'i=')) {
$row['url'] .= strexists($row['url'], '?') ? "&i={$_W['uniacid']}" : "?i={$_W['uniacid']}";
}
if (is_serialized($row['css'])) {
$row['css'] = unserialize($row['css']);
}
if (empty($row['css']['icon']['icon'])) {
$row['css']['icon']['icon'] = 'fa fa-external-link';
}
if ($row['position'] == '3') {
if (!empty($row['css'])) {
unset($row['css']['icon']['font-size']);
}
}
$row['css']['icon']['style'] = "color:{$row['css']['icon']['color']};font-size:{$row['css']['icon']['font-size']}px;";
$row['css']['name'] = "color:{$row['css']['name']['color']};";
}
unset($row);
}
return $navs;
}
示例13: doMobilePay
public function doMobilePay()
{
global $_W, $_GPC;
//验证用户登录状态,此处测试不做验证
checkauth();
$params['tid'] = date('YmdH');
$params['user'] = $_W['member']['uid'];
$params['fee'] = floatval($_GPC['price']);
$params['title'] = '测试支付公众号名称';
$params['ordersn'] = random(5, 1);
$params['virtual'] = false;
if (checksubmit('submit')) {
if ($_GPC['type'] == 'credit') {
$setting = uni_setting($_W['uniacid'], array('creditbehaviors'));
$credtis = mc_credit_fetch($_W['member']['uid']);
//此处需要验证积分数量
if ($credtis[$setting['creditbehaviors']['currency']] < $params['fee']) {
message('抱歉,您帐户的余额不够支付该订单,请充值!', '', 'error');
}
}
} else {
$this->pay($params);
}
}
示例14: defined
<?php
/**
* [WEIZAN System] Copyright (c) 2015 012WZ.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('display');
$do = in_array($do, $dos) ? $do : 'display';
if ($do == 'display') {
$data = uni_setting($_W['uniacid'], array('site_info', 'styleid'));
$styleid = $data['styleid'];
$site_info = empty($data['site_info']) ? array('site_info' => array()) : $data['site_info'];
$styles = pdo_fetchall('SELECT * FROM ' . tablename('site_styles') . ' WHERE uniacid = :uniacid', array(':uniacid' => $_W['uniacid']));
if (checksubmit('submit')) {
$pdata['site_info'] = iserializer(array('sitename' => $_GPC['sitename'], 'keywords' => $_GPC['keywords'], 'description' => $_GPC['description'], 'footer' => htmlspecialchars_decode($_GPC['footer'])));
$pdata['styleid'] = intval($_GPC['styleid']);
pdo_update('uni_settings', $pdata, array('uniacid' => $_W['uniacid']));
cache_delete("unisetting:{$_W['uniacid']}");
message('信息设置成功!', url('site/info/display'), 'success');
}
}
template('site/info');
示例15: defined
<?php
/**
* @FreeGo Team 智慧游
* @url http://www.cninone.com/
*/
defined('IN_IA') or exit('Access Denied');
if ($action != 'cash') {
checkauth();
}
load()->model('activity');
$filter = array();
$coupons = activity_coupon_owned($_W['member']['uid'], $filter);
$tokens = activity_token_owned($_W['member']['uid'], $filter);
$setting = uni_setting($_W['uniacid'], array('creditnames', 'creditbehaviors', 'uc', 'payment', 'passport'));
$behavior = $setting['creditbehaviors'];
$creditnames = $setting['creditnames'];
$credits = mc_credit_fetch($_W['member']['uid'], '*');
$sql = 'SELECT `status` FROM ' . tablename('mc_card') . " WHERE `uniacid` = :uniacid";
$cardstatus = pdo_fetch($sql, array(':uniacid' => $_W['uniacid']));