• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP load函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中load函数的典型用法代码示例。如果您正苦于以下问题:PHP load函数的具体用法?PHP load怎么用?PHP load使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了load函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: settingsDisplay

 public function settingsDisplay($settings)
 {
     global $_GPC, $_W;
     if (checksubmit()) {
         load()->func('file');
         mkdirs(ZC_ROOT . '/cert');
         $r = true;
         $pemname = isset($pemname) ? $pemname : time();
         if (!empty($_GPC['cert'])) {
             $ret = file_put_contents(ZC_ROOT . '/cert/apiclient_cert.pem.' . $pemname, trim($_GPC['cert']));
             $r = $r && $ret;
         }
         if (!empty($_GPC['key'])) {
             $ret = file_put_contents(ZC_ROOT . '/cert/apiclient_key.pem.' . $pemname, trim($_GPC['key']));
             $r = $r && $ret;
         }
         if (!empty($_GPC['ca'])) {
             $ret = file_put_contents(ZC_ROOT . '/cert/rootca.pem.' . $pemname, trim($_GPC['ca']));
             $r = $r && $ret;
         }
         if (!$r) {
             message('证书保存失败, 请保证 /addons/hx_zhongchou/cert/ 目录可写');
         }
         $cfg = array('noticeemail' => $_GPC['noticeemail'], 'kfid' => $_GPC['kfid'], 'k_templateid' => $_GPC['k_templateid'], 'kfirst' => $_GPC['kfirst'], 'kfoot' => $_GPC['kfoot'], 'm_templateid' => $_GPC['m_templateid'], 'mfirst' => $_GPC['mfirst'], 'mfoot' => $_GPC['mfoot'], 'ispublish' => intval($_GPC['ispublish']), 'shopname' => $_GPC['shopname'], 'address' => $_GPC['address'], 'phone' => $_GPC['phone'], 'email' => $_GPC['email'], 'officialweb' => $_GPC['officialweb'], 'description' => htmlspecialchars_decode($_GPC['description']), 'appid' => trim($_GPC['appid']), 'secret' => trim($_GPC['secret']), 'mchid' => trim($_GPC['mchid']), 'password' => trim($_GPC['password']), 'ip' => trim($_GPC['ip']), 'pemname' => $pemname);
         if (!empty($_GPC['logo'])) {
             $cfg['logo'] = $_GPC['logo'];
         }
         if ($this->saveSettings($cfg)) {
             message('保存成功', 'refresh');
         }
     }
     load()->func('tpl');
     include $this->template('setting');
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:34,代码来源:module.php


示例2: doWebRecord

 public function doWebRecord()
 {
     global $_GPC, $_W;
     checklogin();
     load()->func('tpl');
     $rid = intval($_GPC['id']);
     $condition = '';
     if (!empty($_GPC['username'])) {
         $condition .= " AND username like '%{$_GPC['username']}%' ";
     }
     if (!empty($_GPC['sign_time'])) {
         $condition .= " AND sign_time = '%{$_GPC['username']}%' ";
     }
     if (empty($starttime) || empty($endtime)) {
         $starttime = strtotime('-1 month');
         $endtime = TIMESTAMP;
     }
     if (!empty($_GPC['time'])) {
         $starttime = strtotime($_GPC['time']['start']);
         $endtime = strtotime($_GPC['time']['end']) + 86399;
         $condition .= " AND sign_time >= '{$starttime}' AND sign_time <= '{$endtime}' ";
     }
     $pindex = max(1, intval($_GPC['page']));
     $psize = 20;
     $list = pdo_fetchall("SELECT * FROM " . tablename('bm_qrsign_record') . " WHERE rid = '{$rid}' {$condition} ORDER BY id DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
     $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('bm_qrsign_record') . " WHERE rid = '{$rid}' ");
     $pager = pagination($total, $pindex, $psize);
     $memberlist = pdo_fetchall("SELECT distinct fromuser FROM " . tablename('bm_qrsign_record') . "  WHERE rid = '{$rid}' ");
     $membertotal = count($memberlist);
     include $this->template('record');
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:31,代码来源:site.php


示例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');
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:31,代码来源:module.php


示例4: settingsDisplay

 public function settingsDisplay($settings)
 {
     // 声明为全局才可以访问到.
     global $_W, $_GPC;
     if (checksubmit()) {
         // $_GPC 可以用来获取 Cookies,表单中以及地址栏参数
         $data = $_GPC['data'];
         // message() 方法用于提示用户操作提示
         empty($data['name']) && message('请填写便利店名称');
         empty($data['logo']) && message('请填写便利店 LOGO');
         empty($data['linkman']) && message('请填写便利店联系人');
         empty($data['phone']) && message('请填写便利店联系电话');
         empty($data['address']) && message('请填写便利店地址');
         empty($data['description']) && message('请填写便利店介绍');
         //字段验证, 并获得正确的数据$dat
         if (!$this->saveSettings($data)) {
             message('保存信息失败', '', 'error');
         } else {
             message('保存信息成功', '', 'success');
         }
     }
     // 模板中需要用到 "tpl" 表单控件函数的话, 记得一定要调用此方法.
     load()->func('tpl');
     //这里来展示设置项表单
     include $this->template('setting');
 }
开发者ID:lrf1999,项目名称:we7_store,代码行数:26,代码来源:module.php


示例5: doMobileLottery

 public function doMobileLottery()
 {
     global $_GPC, $_W;
     $id = intval($_GPC['id']);
     $sql = 'SELECT * FROM ' . tablename('zzz_reply') . ' WHERE `rid` = :rid';
     $params = array(':rid' => $id);
     $zzz = pdo_fetch($sql, $params);
     if (empty($zzz)) {
         message('非法访问,请重新发送消息进入!');
     }
     checkauth();
     load()->model("mc");
     $profile = mc_require($_W['member']['uid'], array('nickname', 'mobile'), '需要完善资料后才能继续.');
     $startgame = 1;
     if ($zzz['start_time'] > TIMESTAMP) {
         $startgame = 0;
         $str = "活动没开始";
     }
     if ($zzz['end_time'] < TIMESTAMP) {
         $startgame = 0;
         $str = "活动已结束";
     }
     if (empty($_W['fans']['fanid'])) {
         $sql = 'SELECT `fanid` FROM ' . tablename('mc_mapping_fans') . ' WHERE `uid` = :uid';
         $params = array(':uid' => $_W['member']['uid']);
         $fansId = pdo_fetchcolumn($sql, $params);
         if (empty($fansId)) {
             message('必须关注公众号才可以进入游戏', $this->createMobileUrl('introduce', array('id' => $id)), 'error');
         }
         $_W['fans']['fanid'] = $fansId;
     }
     $sql = 'SELECT * FROM ' . tablename('zzz_user') . ' WHERE `rid` = :rid AND `fanid` = :fanid';
     $params = array(':rid' => $id, ':fanid' => $_W['fans']['fanid']);
     $myuser = pdo_fetch($sql, $params);
     // 用户不存在插入一条数据
     if (empty($myuser)) {
         $zzz_user = array('rid' => $id, 'count' => 0, 'points' => 0, 'fanid' => $_W['fans']['fanid'], 'createtime' => TIMESTAMP);
         pdo_insert('zzz_user', $zzz_user);
     }
     $myph = '';
     if (!empty($myuser)) {
         $sql = 'SELECT count(*) FROM ' . tablename('zzz_user') . ' WHERE `rid` = :rid AND `points` > :points';
         $params = array(':rid' => $id, ':points' => $myuser['points']);
         $ph = pdo_fetchcolumn($sql, $params);
         $myph = intval($ph) + 1;
     }
     // 分享增加体力
     $shareFid = intval($_GPC['shareuid']);
     if (!empty($shareFid)) {
         $sql = 'SELECT `id` FROM ' . tablename('zzz_share') . ' WHERE `rid` = :rid AND `fanid` = :fanid AND `sharefid` = :sharefid';
         $params = array(':rid' => $id, ':fanid' => $_W['fans']['fanid'], 'sharefid' => $shareFid);
         $shareInfo = pdo_fetchcolumn($sql, $params);
         if (empty($shareInfo)) {
             pdo_insert('zzz_share', array('rid' => $id, 'fanid' => $_W['fans']['fanid'], 'sharefid' => $shareFid));
             pdo_update('zzz_user', array('sharevalue' => $myuser['sharevalue'] + $zzz['sharevalue']), array('fanid' => $shareFid, 'rid' => $id));
         }
     }
     $energylimit = ($zzz['maxlottery'] + $zzz['prace_times']) * 10;
     include $this->template('gamex');
 }
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:60,代码来源:site.php


示例6: checkauth

function checkauth()
{
    global $_W, $engine;
    load()->model('mc');
    if (!empty($_W['member']) && (!empty($_W['member']['mobile']) || !empty($_W['member']['email']))) {
        return true;
    }
    if (!empty($_W['openid'])) {
        $fan = mc_fansinfo($_W['openid'], $_W['acid'], $_W['uniacid']);
        if (_mc_login(array('uid' => intval($fan['uid'])))) {
            return true;
        }
        if (defined('IN_API')) {
            $GLOBALS['engine']->died("抱歉,您需要先登录才能使用此功能,点击此处 <a href='" . __buildSiteUrl(url('auth/login')) . "'>【登录】</a>");
        }
    }
    $forward = base64_encode($_SERVER['QUERY_STRING']);
    if ($_W['isajax']) {
        $result = array();
        $result['url'] = url('auth/login', array('forward' => $forward), true);
        $result['act'] = 'redirect';
        exit(json_encode($result));
    } else {
        header("location: " . url('auth/login', array('forward' => $forward)), true);
    }
    exit;
}
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:27,代码来源:common.func.php


示例7: save

 function save()
 {
     include load('include.lang');
     if ($this->file_error) {
         return $this->_('Error(21)' . $L['upload_failed'] . ' (' . $L['upload_error_' . $this->file_error] . ')');
     }
     if ($this->maxsize > 0 && $this->file_size > $this->maxsize) {
         return $this->_('Error(22)' . $L['upload_size_limit'] . ' (' . intval($this->maxsize / 1024) . 'Kb)');
     }
     if (!$this->is_allow()) {
         return $this->_('Error(23)' . $L['upload_not_allow']);
     }
     $this->set_savepath($this->savepath);
     $this->set_savename($this->savename);
     if (!is_writable(DT_ROOT . '/' . $this->savepath)) {
         return $this->_('Error(24)' . $L['upload_unwritable']);
     }
     if (!is_uploaded_file($this->file)) {
         return $this->_('Error(25)' . $L['upload_failed']);
     }
     if (!move_uploaded_file($this->file, DT_ROOT . '/' . $this->saveto)) {
         return $this->_('Error(26)' . $L['upload_failed']);
     }
     $this->image = $this->is_image();
     if (DT_CHMOD) {
         @chmod(DT_ROOT . '/' . $this->saveto, DT_CHMOD);
     }
     return true;
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:29,代码来源:upload.class.php


示例8: getAccessToken

 /**
  * author: codeMonkey QQ:631872807
  * 全局access_token获取
  * @return
  */
 public function getAccessToken()
 {
     global $_W;
     $tokenUrl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" . $this->appid . "&secret=" . $this->secret;
     $accessToken = CRUD::findUnique(CRUD::$table_sin_token, array(":weid" => $_W['weid']));
     load()->func('communication');
     if (!empty($accessToken)) {
         $expires_in = $accessToken['expires_in'];
         if (TIMESTAMP - $accessToken['createtime'] >= $expires_in - 200) {
             // 过期
             $content = ihttp_get($tokenUrl);
             $token = @json_decode($content['content'], true);
             $data = array('weid' => $_W['weid'], 'access_token' => $token['access_token'], 'expires_in' => $token['expires_in'], 'createtime' => TIMESTAMP);
             CRUD::updateById(CRUD::$table_sin_token, $data, $accessToken['id']);
             return $token['access_token'];
         } else {
             return $accessToken['access_token'];
         }
     } else {
         $content = ihttp_get($tokenUrl);
         $token = @json_decode($content['content'], true);
         $data = array('weid' => $_W['weid'], 'access_token' => $token['access_token'], 'expires_in' => $token['expires_in'], 'createtime' => TIMESTAMP);
         CRUD::create(CRUD::$table_sin_token, $data);
         return $token['access_token'];
     }
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:31,代码来源:oauth2.class.php


示例9: up

 function up()
 {
     $id = $this->_post('id', 'img_url');
     $ids = $this->_post('ids', 0);
     $dir = $this->_get('path', '');
     if (!checkPath($dir)) {
         $dir = 'user';
     }
     if (isHave($_FILES['upimg']) && !isHave($_FILES['upimg']['error'])) {
         load('upload');
         $myUpload = new Myupload();
         $upload = $myUpload->upload($dir . '/u' . steadmin::$adminInfo['user_id']);
         $upload = parent::_sendImageToYunServer($upload);
         //同步图片到云存储
         if ($upload) {
             if (!$upload[0]) {
                 echo "<script>alert('" . $myUpload->getErrorMsg() . "');history.go(-1);</script>";
                 exit;
             }
             $upload[0]['savepath'] = str_replace('./', '', $upload[0]['savepath']);
             echo "<script>window.parent.document.getElementById('" . $id . "').value='" . $upload[0]['savepath'] . "';\r\n";
             echo "window.location.href='" . U('upload/index', array('id' => $id, 'ids' => $ids, 'path' => $dir)) . "';</script>\r\n";
             exit;
         }
     } else {
         echo "<script>alert('" . $_FILES['upimg']['error'] . "');history.go(-1);</script>";
         exit;
     }
 }
开发者ID:sdgdsffdsfff,项目名称:51jhome_customerservice,代码行数:29,代码来源:uploadAction.class.php


示例10: respond

 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $sql = "SELECT * FROM " . tablename('wxcard_reply') . " WHERE rid = :rid ORDER BY RAND() LIMIT 1";
     $reply = pdo_fetch($sql, array(':rid' => $rid));
     if (empty($reply)) {
         return false;
     }
     load()->classs('weixin.account');
     load()->classs('coupon');
     $coupon = new coupon($_W['acid']);
     if (is_error($coupon)) {
         $this->error($reply, $coupon['message']);
         die;
     }
     $card = $coupon->BuildCardExt($reply['cid']);
     if (is_error($card)) {
         $this->error($reply, $card['message']);
         die;
     }
     $data = array('touser' => $_W['openid'], 'msgtype' => 'wxcard', 'wxcard' => array('card_id' => $card['card_id'], 'card_ext' => $card['card_ext']));
     $acc = WeAccount::create($_W['acid']);
     $status = $acc->sendCustomNotice($data);
     if (is_error($status)) {
         $this->error($reply, $status['message']);
         die;
     }
     if (!empty($reply['success'])) {
         return $this->respText($reply['success']);
         die;
     }
     return true;
 }
开发者ID:zhang19960118,项目名称:html11,代码行数:34,代码来源:processor.php


示例11: __construct

 /**
  * __construct 
  * 
  * @param FCMS_Error $fcmsError 
  * @param Database   $fcmsDatabase 
  * @param User       $fcmsUser 
  * 
  * @return void
  */
 public function __construct(FCMS_Error $fcmsError, Database $fcmsDatabase, User $fcmsUser)
 {
     $this->fcmsError = $fcmsError;
     $this->fcmsDatabase = $fcmsDatabase;
     $this->fcmsUser = $fcmsUser;
     load('facebook');
 }
开发者ID:lmcro,项目名称:fcms,代码行数:16,代码来源:Facebook.php


示例12: __construct

 function __construct($modelid, $id)
 {
     $this->modelid = $modelid;
     $this->fields = F("Model_field_" . $modelid);
     $this->id = $id;
     load("@.treatfun");
 }
开发者ID:BGCX262,项目名称:ztoa-svn-to-git,代码行数:7,代码来源:content_update.class.php


示例13: receive

 public function receive()
 {
     global $_W, $_GPC;
     load()->model('mc');
     load()->func('communication');
     $event = $this->message['event'];
     $openid = $this->message['from'];
     $f_log = pdo_fetch("SELECT * FROM " . tablename('mc_mapping_fans') . " WHERE `uniacid` = '{$_W['uniacid']}' AND `openid` = '{$openid}'");
     if ($f_log['uid'] != 0) {
         pdo_update('hx_subscribe_data', array('uid' => $f_log['uid']), array('openid' => $openid));
         $uid = $f_log['uid'];
     } else {
         $default_groupid = pdo_fetchcolumn('SELECT groupid FROM ' . tablename('mc_groups') . ' WHERE uniacid = :uniacid AND isdefault = 1', array(':uniacid' => $_W['uniacid']));
         $data = array('uniacid' => $_W['uniacid'], 'email' => md5($openid) . '@qdaygroup.com', 'salt' => random(8), 'groupid' => $default_groupid, 'createtime' => TIMESTAMP);
         $data['password'] = md5($message['from'] . $data['salt'] . $_W['config']['setting']['authkey']);
         pdo_insert('mc_members', $data);
         $uid = pdo_insertid();
         pdo_update('mc_mapping_fans', array('uid' => $uid), array('openid' => $openid));
         pdo_update('hx_subscribe_data', array('uid' => $uid), array('openid' => $openid));
     }
     $credit_type = isset($this->module['config']['credit_type']) ? $this->module['config']['credit_type'] : 'credit1';
     $credit_subscribe = isset($this->module['config']['credit_subscribe']) ? $this->module['config']['credit_subscribe'] : 5;
     $credit_lever_1 = isset($this->module['config']['credit_lever_1']) ? $this->module['config']['credit_lever_1'] : 2;
     $credit_lever_2 = isset($this->module['config']['credit_lever_2']) ? $this->module['config']['credit_lever_2'] : 1;
     if ($event == 'subscribe') {
         $s_log = pdo_fetch("SELECT * FROM " . tablename('hx_subscribe_data') . " WHERE `uniacid`='{$_W['uniacid']}' AND `openid`='{$openid}'");
         if (empty($s_log)) {
             //如果没记录
             $insert = array('uniacid' => $_W['uniacid'], 'openid' => $openid, 'uid' => $uid, 'from_uid' => '0', 'sn' => time(), 'follow' => '1', 'article_id' => '0', 'shouyi' => $credit_subscribe, 'createtime' => TIMESTAMP);
             pdo_insert('hx_subscribe_data', $insert);
             mc_credit_update($uid, $credit_type, $credit_subscribe, array('1', '关注增加积分'));
         } else {
             //如果有记录
             if ($s_log['follow'] != 1) {
                 //如果记录未关注
                 $insert = array('follow' => '1');
                 pdo_update('hx_subscribe_data', $insert, array('id' => $s_log['id']));
                 mc_credit_update($uid, $credit_type, $credit_subscribe, array('1', '关注增加积分'));
             }
             if (!empty($s_log['from_uid'])) {
                 //如果来源ID不为空
                 $from_user = pdo_fetch("SELECT * FROM " . tablename('hx_subscribe_data') . " WHERE `uniacid`='{$_W['uniacid']}' AND `uid`='{$s_log['from_uid']}'");
                 if (!empty($from_user)) {
                     $data = array('shouyi' => $from_user['shouyi'] + $credit_lever_1, 'zjrs' => $from_user['zjrs'] + 1);
                     pdo_update('hx_subscribe_data', $data, array('id' => $from_user['id']));
                     mc_credit_update($s_log['from_uid'], $credit_type, $credit_lever_1, array('1', '推荐一级关注增加积分'));
                     if (!empty($from_user['from_uid'])) {
                         $from_user_2 = pdo_fetch("SELECT * FROM " . tablename('hx_subscribe_data') . " WHERE `uniacid`='{$_W['uniacid']}' AND `uid`='{$from_user['from_uid']}'");
                         if (!empty($from_user_2)) {
                             $data2 = array('shouyi' => $from_user_2['shouyi'] + $credit_lever_2, 'jjrs' => $from_user_2['jjrs'] + 1);
                             pdo_update('hx_subscribe_data', $data2, array('id' => $from_user_2['id']));
                             mc_credit_update($from_user['from_uid'], $credit_type, $credit_lever_2, array('1', '推荐二级关注增加积分'));
                         }
                     }
                 }
             }
         }
         //pdo_update('hx_subscribe_data',array('follow'=>1),array('openid'=>$openid));
     }
 }
开发者ID:6662680,项目名称:qday_wx,代码行数:60,代码来源:receiver.php


示例14: fieldsFormSubmit

 public function fieldsFormSubmit($rid)
 {
     //规则验证无误保存入库时执行,这里应该进行自定义字段的保存。这里 $rid 为对应的规则编号
     global $_W, $_GPC;
     load()->func('file');
     $id = intval($_GPC['reply_id']);
     $insert = array("rid" => $rid, "weid" => $_W['uniacid'], "title" => $_GPC['title'], "description" => $_GPC['description'], "rule" => trim($_GPC['rule']), "end_title" => $_GPC['end_title'], "end_description" => $_GPC['end_description'], "starttime" => strtotime($_GPC['datelimit']['start']), "endtime" => strtotime($_GPC['datelimit']['end']), "total_times" => $_GPC['total_times'], "totaldayplay_times" => $_GPC['totaldayplay_times'], "totaldayshare_times" => $_GPC['totaldayshare_times'], "sharelottery_times" => $_GPC['sharelottery_times'], "gametime" => $_GPC['gametime'], "showusernum" => $_GPC['showusernum'], "share_title" => $_GPC['share_title'], "share_desc" => $_GPC['share_desc'], "share_url" => $_GPC['share_url'], "follow_url" => $_GPC['follow_url'], "gameovertext" => $_GPC['gameovertext'], "tips1text" => $_GPC['tips1text'], "tips2text" => $_GPC['tips2text'], "tips3text" => $_GPC['tips3text'], "signtext" => $_GPC['signtext'], "isneedfollow" => $_GPC['isneedfollow'], "awardtip" => $_GPC['awardtip'], "copyright" => $_GPC['copyright']);
     if (!empty($_GPC['start_picurl'])) {
         $insert['picture'] = $_GPC['start_picurl'];
     }
     if (!empty($_GPC['end_picurl'])) {
         $insert['end_picurl'] = $_GPC['end_picurl'];
     }
     if (!empty($_GPC['share_image'])) {
         $insert['share_image'] = $_GPC['share_image'];
     }
     if (empty($id)) {
         if ($insert['starttime'] <= time()) {
             $insert['status'] = 1;
         } else {
             $insert['status'] = 0;
         }
         pdo_insert($this->table_reply, $insert);
     } else {
         pdo_update($this->table_reply, $insert, array('id' => $id));
     }
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:27,代码来源:module.php


示例15: getAccessToken

 private function getAccessToken()
 {
     global $_W, $_GPC;
     load()->func('cache');
     $api = cache_load("ewei.money.api_share.json::" . $_W['uniacid'], true);
     $new = false;
     if (empty($api['appid']) || $api['appid'] !== $this->appId) {
         $new = true;
     }
     if (empty($api['appsecret']) || $api['appsecret'] !== $this->appSecret) {
         $new = true;
     }
     $data = cache_load("ewei.money.access_token.json::" . $_W['uniacid'], true);
     if (empty($data['expire_time']) || $data['expire_time'] < time() || $new) {
         $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$this->appId}&secret={$this->appSecret}";
         $res = json_decode($this->httpGet($url));
         $access_token = $res->access_token;
         if ($access_token) {
             $data['expire_time'] = time() + 7000;
             $data['access_token'] = $access_token;
             cache_write("ewei.money.access_token.json::" . $_W['uniacid'], iserializer($data));
             cache_write("ewei.money.api_share.json::" . $_W['uniacid'], iserializer(array("appid" => $this->appId, "appsecret" => $this->appSecret)));
         }
     } else {
         $access_token = $data['access_token'];
     }
     return $access_token;
 }
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:28,代码来源:jssdk.php


示例16: 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)) {
         $fee = $params['fee'];
         $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'));
             $credit = $setting['creditbehaviors']['currency'];
             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');
         }
     }
 }
开发者ID:6662680,项目名称:qday_wx,代码行数:33,代码来源:site.php


示例17: respond

 public function respond()
 {
     global $_W;
     load()->func('compat.biz');
     $rid = $this->rule;
     $sql = "SELECT * FROM " . tablename('bm_qrsign_reply') . " WHERE `rid`=:rid LIMIT 1";
     $reply = pdo_fetch($sql, array(':rid' => $rid));
     if (empty($reply['id'])) {
         return $this->respText("系统升级中,请稍候!");
     }
     if (time() > strtotime($reply['endtime'])) {
         if (empty($reply['memo2'])) {
             $msg = '对不起,活动已经于' . $reply['endtime'] . '结束,感谢您的参与!!!';
         } else {
             $msg = $reply['memo2'];
         }
         return $this->respText($msg);
     }
     if (time() < strtotime($reply['starttime'])) {
         if (empty($reply['memo1'])) {
             $msg = '对不起,活动将于' . $reply['starttime'] . '开始,敬请期待!!!';
         } else {
             $msg = $reply['memo1'];
         }
         return $this->respText($msg);
     }
     $url = $_W['siteroot'] . 'app/' . $this->createMobileUrl('show', array('rid' => $rid, 'from_user' => $this->message['from']));
     $response['FromUserName'] = $this->message['to'];
     $response['ToUserName'] = $this->message['from'];
     $response['MsgType'] = 'news';
     $response['ArticleCount'] = 1;
     $response['Articles'] = array();
     $response['Articles'][] = array('Title' => $reply['title'], 'Description' => $reply['desc'], 'PicUrl' => !strexists($reply['picurl'], 'http://') ? $_W['attachurl'] . $reply['picurl'] : $reply['picurl'], 'Url' => $url, 'TagName' => 'item');
     return $response;
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:35,代码来源:processor.php


示例18: client

 /** 
  * 创建phprpc客户端
  * @param string $url 
  * @return object
  * @author wave
  */
 public function client($url = '')
 {
     if (!load('phprpc_client.php', ROOT_PATH . DS . ROOT_LIBRARY . DS . 'phprpc' . DS)) {
         return load('404.tpl', ROOT_PATH . DS . ROOT_ERROR . DS . 'tpl');
     }
     return new PHPRPC_Client($url);
 }
开发者ID:DenonHuang,项目名称:xbphp,代码行数:13,代码来源:RpcComponent.php


示例19: logging

function logging($level = 'info', $message = '')
{
    $filename = IA_ROOT . '/data/logs/' . date('Ymd') . '.log';
    load()->func('file');
    mkdirs(dirname($filename));
    $content = date('Y-m-d H:i:s') . " {$level} :\n------------\n";
    if (is_string($message)) {
        $content .= "String:\n{$message}\n";
    }
    if (is_array($message)) {
        $content .= logging_implode($message);
    }
    if ($message == 'get') {
        $content .= "GET:\n";
        foreach ($_GET as $key => $value) {
            $content .= sprintf("%s : %s ;\n", $key, $value);
        }
    }
    if ($message == 'post') {
        $content .= "POST:\n";
        foreach ($_POST as $key => $value) {
            $content .= sprintf("%s : %s ;\n", $key, $value);
        }
    }
    $content .= "\n";
    $fp = fopen($filename, 'a+');
    fwrite($fp, $content);
    fclose($fp);
}
开发者ID:ruige123456,项目名称:dataMining,代码行数:29,代码来源:business.func.php


示例20: doSwitch

 public function doSwitch()
 {
     global $_W, $_GPC;
     $m = array_merge($_W['modules']['userapi'], $_W['account']['modules']['userapi']);
     $cfg = $m['config'];
     if ($_W['ispost']) {
         $rids = explode(',', $_GPC['rids']);
         if (is_array($rids)) {
             $cfg = array();
             foreach ($rids as $rid) {
                 $cfg[intval($rid)] = true;
             }
             $this->saveSettings($cfg);
         }
         exit;
     }
     load()->model('reply');
     $rs = reply_search("uniacid = 0 AND module = 'userapi' AND `status`=1");
     $ds = array();
     foreach ($rs as $row) {
         $reply = pdo_fetch('SELECT * FROM ' . tablename($this->tablename) . ' WHERE `rid`=:rid', array(':rid' => $row['id']));
         $r = array();
         $r['title'] = $row['name'];
         $r['rid'] = $row['id'];
         $r['description'] = $reply['description'];
         $r['switch'] = $cfg[$r['rid']] ? ' checked="checked"' : '';
         $ds[] = $r;
     }
     include $this->template('switch');
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:30,代码来源:module.php



注:本文中的load函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP loadAllPageData函数代码示例发布时间:2022-05-15
下一篇:
PHP lnotif函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap