本文整理匯總了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']));