当前位置: 首页>>代码示例>>PHP>>正文


PHP load函数代码示例

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


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


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