function tenpay_action() { extract($_POST); if ($pay_config) { $tenpay['sy_weburl'] = $this->config['sy_weburl']; $tenpay['sy_tenpayid'] = iconv("utf-8", "gbk", trim($_POST['sy_tenpayid'])); $tenpay['sy_tenpaycode'] = iconv("utf-8", "gbk", trim($_POST['sy_tenpaycode'])); made_web("../api/tenpay/tenpay_data.php", ArrayToString($tenpay), "tenpaydata"); $this->ACT_layer_msg("财付通配置成功!", 9, $_SERVER['HTTP_REFERER'], 2, 1); } @(include APP_PATH . "/api/tenpay/tenpay_data.php"); $this->yunset("tenpaydata", $tenpaydata); $this->yuntpl(array('admin/admin_tenpay_config')); }
function getToken($config) { $Token = $config['token']; $TokenTime = $config['token_time']; $NowTime = time(); if ($NowTime - $TokenTime > 7000) { $Appid = $config['wx_appid']; $Appsecert = $config['wx_appsecret']; $Url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $Appid . '&secret=' . $Appsecert; $CurlReturn = CurlPost($Url); $Token = json_decode($CurlReturn); $config['token'] = $Token->access_token; $config['token_time'] = time(); made_web(PLUS_PATH . "config.php", ArrayToString($config), "config"); return $config['token']; } else { return $Token; } }
function subscribe() { $time = strtotime(date("Y-m-d")); if ($this->config['subscribe_time'] < $time) { $subscribe = $this->obj->DB_select_all("subscribe", "status='1'"); if (is_array($subscribe)) { foreach ($subscribe as $v) { $time = 86400 * $v['time'] + $v['ctime']; if ($time < time()) { if ($v['type'] == "1") { $this->select_job($v); } else { $this->select_resume($v); } } } } $config = $this->obj->DB_select_all("admin_config"); if (is_array($config)) { foreach ($config as $v) { $configarr[$v['name']] = $v['config']; } } if ($config['subscribe_time']) { $this->obj->DB_update_all("admin_config", "`config`='" . time() . "'", "`name`='subscribe_time'"); } else { $this->obj->DB_insert_once("admin_config", "`config`='" . time() . "',`name`='subscribe_time'"); } $configarr['autodate'] = $this->config['autodate']; $configarr['subscribe_time'] = time(); made_web(PLUS_PATH . "config.php", ArrayToString($configarr), "config"); } }
function mk_archive($pagesize) { if ($_POST['value'] == 0) { $where = "1"; if ($_POST['group'] > 0) { $where .= " and `nid`='" . $_POST['group'] . "'"; } if ($_POST['startid'] > 0) { $where .= " and `id`>='" . $_POST['startid'] . "'"; } if ($_POST['endid'] > 0) { $where .= " and `id`<='" . $_POST['endid'] . "'"; } $news_list = $this->obj->DB_select_all("news_base", $where, "`id`,`datetime`"); if (is_array($news_list) && !empty($news_list)) { $allnum = count($news_list); $allpage = ceil($allnum / $pagesize); $i = 1; foreach ($news_list as $v) { if (count($val[$i]) <= $pagesize) { $val[$i][$v['id']] = $v['datetime']; } else { $i++; $val[$i][$v['id']] = $v['datetime']; } } made_web("../data/plus/news.cache.php", ArrayToString($val), "newscache"); $page = 1; } else { $page = 0; } } else { $page = $_POST['value']; include_once PLUS_PATH . "news.cache.php"; if (is_array($newscache)) { foreach ($newscache as $k => $va) { if ($k == $page) { $index = 0; foreach ($va as $key => $value) { $NewsIDList[] = $key; } } elseif ($k > $page) { $val[$k] = $va; } } } $news_list = $this->obj->DB_select_all("news_base", '`id` in (' . implode(',', $NewsIDList) . ') order by `id` desc', '*'); if (is_array($news_list) && !empty($news_list)) { foreach ($news_list as $k => $v) { $NewsIDList[] = $v['id']; } $contentrows = $this->obj->DB_select_all("news_content", '`nbid` in (' . implode(',', $NewsIDList) . ') order by `nbid` desc'); foreach ($news_list as $k1 => $v1) { foreach ($contentrows as $k2 => $v2) { if ($v1['id'] == $v2['nbid']) { $news_list[$k1]['content'] = $v2['content']; } } } foreach ($news_list as $k1 => $v1) { $this->articleshow($v1['id'], $v1['datetime'], $v1, $news_list[$k1 + 1], $news_list[$k1 - 1]); } $page = $page + 1; if (!is_array($val)) { $page = 0; unlink("../data/plus/news.cache.php"); } } else { $page = 0; } } return $page; }