public function __mobile($f_name) { global $_CMS, $_GP; $config = globaSetting(); $cfg = $config; include_once SYSTEM_ROOT . $_CMS['module'] . '/class/mobile/' . strtolower(substr($f_name, 3)) . '.php'; }
public function __mobile($f_name) { global $_CMS, $_GP; $config = globaSetting(); $cfg = $config; $filephp = $_CMS['module'] . '/class/mobile/' . strtolower(substr($f_name, 3)) . '.php'; if (CUSTOM_VERSION == true && is_file(CUSTOM_ROOT . $filephp)) { include_once CUSTOM_ROOT . $filephp; } else { include_once SYSTEM_ROOT . $filephp; } }
public function do_process() { global $_GP; $settings = globaSetting(); $configdata = $settings['weixintoken']; $token = $configdata; if (!$this->checkSign($token)) { exit('Access Denied'); } if (strtolower($_SERVER['REQUEST_METHOD']) == 'get') { ob_clean(); ob_start(); exit($_GET['echostr']); } if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') { $postStr = $GLOBALS["HTTP_RAW_POST_DATA"]; $message = $this->requestParse($postStr); if (empty($message)) { exit('Request Failed'); } if ($message['type'] == 'text' || $message['type'] == 'CLICK') { $key = $message['content']; if ($message['type'] == 'CLICK') { $key = $message['eventkey']; } if (!empty($key)) { $reply = mysqld_select('SELECT * FROM ' . table('weixin_rule') . " WHERE keywords = :keywords", array(':keywords' => $key)); } } if ($message['type'] == 'subscribe') { $reply = mysqld_select('SELECT * FROM ' . table('weixin_rule') . " WHERE keywords = :keywords", array(':keywords' => subscribe_key)); } if (empty($reply['id'])) { $reply = mysqld_select('SELECT * FROM ' . table('weixin_rule') . " WHERE keywords = :keywords", array(':keywords' => default_key)); } if ($reply['ruletype'] == 1) { $reply['content'] = htmlspecialchars_decode($reply['description']); $reply['content'] = str_replace(array('<br>', ' '), array("\n", ' '), $reply['content']); $reply['content'] = strip_tags($reply['content'], '<a>'); return $this->respText($reply['content'], $message); } if ($reply['ruletype'] == 2) { $news = array(); $news = array('title' => $reply['title'], 'description' => $reply['description'], 'picurl' => $reply['thumb'], 'url' => $reply['url']); return $this->respNews($news, $message); } exit(''); } }
public function addon_get_js_ticket() { $configs = globaSetting(array("jsapi_ticket", "jsapi_ticket_exptime")); $jsapi_ticket = $configs['jsapi_ticket']; $jsapi_ticket_exptime = intval($configs['jsapi_ticket_exptime']); if (empty($jsapi_ticket) || empty($jsapi_ticket_exptime) || $jsapi_ticket_exptime < time()) { $accessToken = get_weixin_token(); $url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?type=jsapi&access_token={$accessToken}"; $content = http_get($url); $res = @json_decode($content, true); $ticket = $res['ticket']; if (!empty($ticket)) { $cfg = array('jsapi_ticket' => $ticket, 'jsapi_ticket_exptime' => time() + intval($res['expires_in'])); refreshSetting($cfg); return $ticket; } return ''; } else { return $jsapi_ticket; } }
<?php if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') == false) { message('暂不支持非微信上进行微支付'); } $weixinthirdlogin = mysqld_select("SELECT * FROM " . table('thirdlogin') . " WHERE enabled=1 and `code`='weixin'"); if (empty($weixinthirdlogin) || empty($weixinthirdlogin['id'])) { message('需开启微信登录功能!'); } if ($_GP['isok'] == '1') { message('支付成功!', WEBSITE_ROOT . mobile_url('myorder'), 'success'); } $payment = mysqld_select("SELECT * FROM " . table('payment') . " WHERE enabled=1 and code='weixin' limit 1"); $configs = unserialize($payment['configs']); $settings = globaSetting(array("weixin_appId", "weixin_appSecret")); $_CMS['weixin_pay_appid'] = $settings['weixin_appId']; //受理商ID,身份标识 $_CMS['weixin_pay_mchId'] = $configs['weixin_pay_mchId']; //商户支付密钥Key。审核通过后,在微信发送的邮件中查看 $_CMS['weixin_pay_paySignKey'] = $configs['weixin_pay_paySignKey']; //JSAPI接口中获取openid,审核后在公众平台开启开发模式后可查看 $_CMS['weixin_pay_appSecret'] = $settings['weixin_appSecret']; include_once "WxPayPubHelper/WxPayPubHelper.php"; $weixin_openid = get_weixin_openid(); //=========步骤2:使用统一支付接口,获取prepay_id============ //使用统一支付接口 $unifiedOrder = new UnifiedOrder_pub(); //设置统一支付接口参数 //设置必填参数 //appid已填,商户无需重复填写 //mch_id已填,商户无需重复填写
public function do_process() { global $_GP; $settings = globaSetting(); $sign = $_REQUEST["sign"]; $sign_type = $_REQUEST["sign_type"]; $biz_content = stripslashes($_REQUEST["biz_content"]); $service = $_REQUEST["service"]; $charset = $_REQUEST["charset"]; if (empty($sign) || empty($sign_type) || empty($biz_content) || empty($service) || empty($charset)) { echo "some parameter is empty."; exit; } $as = new AlipaySign(); $sign_verify = $as->rsaCheckV2($_REQUEST, $_GP['alipay_config']['alipay_public_key_file']); if (!$sign_verify) { if ($service == "alipay.service.check") { $EventType = $this->getNode2($biz_content, "EventType"); if ($EventType == "verifygw") { $as = new AlipaySign(); $response_xml = "<success>true</success><biz_content>" . $as->getPublicKeyStr($_GP['alipay_config']['merchant_public_key_file']) . "</biz_content>"; $return_xml = $as->sign_response($response_xml, $_GP['alipay_config']['charset'], $_GP['alipay_config']['merchant_private_key_file']); echo $return_xml; exit; } } else { echo "sign verfiy fail."; exit; } } if ($service == "alipay.service.check") { $EventType = $this->getNode2($biz_content, "EventType"); if ($EventType == "verifygw") { $as = new AlipaySign(); $response_xml = "<success>true</success><biz_content>" . $as->getPublicKeyStr($_GP['alipay_config']['merchant_public_key_file']) . "</biz_content>"; $return_xml = $as->sign_response($response_xml, 'GBK', $_GP['alipay_config']['merchant_private_key_file']); file_put_contents(WEB_ROOT . "/cache/1.log", $return_xml, FILE_APPEND); echo $return_xml; exit; } } if ($service == "alipay.mobile.public.message.notify") { $UserInfo = $this->getNode($biz_content, "UserInfo"); $FromUserId = $this->getNode($biz_content, "FromUserId"); $AppId = $this->getNode($biz_content, "AppId"); $CreateTime = $this->getNode($biz_content, "CreateTime"); $MsgType = $this->getNode($biz_content, "MsgType"); $EventType = $this->getNode($biz_content, "EventType"); $AgreementId = $this->getNode($biz_content, "AgreementId"); $ActionParam = $this->getNode($biz_content, "ActionParam"); $AccountNo = $this->getNode($biz_content, "AccountNo"); $text = $this->getNode($biz_content, "Text"); $push = new PushMsg(); if ($MsgType == "text" || $MsgType == "text" || $EventType == 'click') { $key = $text; if ($EventType == 'click') { $key = $ActionParam; } if (!empty($key)) { $reply = mysqld_select('SELECT * FROM ' . table('alipay_rule') . " WHERE keywords = :keywords", array(':keywords' => $key)); } } if ($EventType == 'follow') { $reply = mysqld_select('SELECT * FROM ' . table('alipay_rule') . " WHERE keywords = :keywords", array(':keywords' => subscribe_key)); } if (empty($reply['id'])) { $reply = mysqld_select('SELECT * FROM ' . table('alipay_rule') . " WHERE keywords = :keywords", array(':keywords' => default_key)); } if ($reply['ruletype'] == 1) { $reply['content'] = htmlspecialchars_decode($reply['description']); $reply['content'] = str_replace(array('<br>', ' '), array("\n", ' '), $reply['content']); $reply['content'] = strip_tags($reply['content'], '<a>'); $text_msg = $push->mkTextMsg($reply['content']); $biz_content = $push->mkTextBizContent($FromUserId, $text_msg); $return_msg = $push->sendRequest($biz_content); file_put_contents(WEB_ROOT . "/cache/2.log", $biz_content . '|' . $return_msg, FILE_APPEND); } if ($reply['ruletype'] == 2) { $reply['content'] = htmlspecialchars_decode($reply['description']); $reply['content'] = str_replace(array('<br>', ' '), array("\n", ' '), $reply['content']); $reply['content'] = strip_tags($reply['content'], '<a>'); //WEBSITE_ROOT.'attachment/'.$reply['thumb'] $image_text_msg1 = $push->mkImageTextMsg($reply['title'], $reply['content'], $reply['url'], WEBSITE_ROOT . 'attachment/' . $reply['thumb'], "loginAuth"); $image_text_msg = array($image_text_msg1); $biz_content = $push->mkImageTextBizContent($FromUserId, $image_text_msg); $return_msg = $push->sendRequest($biz_content); file_put_contents(WEB_ROOT . "/cache/1.log", $biz_content, FILE_APPEND); } echo $this->mkAckMsg($FromUserId); exit; // file_put_contents ( WEB_ROOT . "/cache/1.log",$x , FILE_APPEND ); } }
function member_login_weixin($weixin_openid) { global $_GP, $_CMS; if (!empty($weixin_openid)) { $weixin_wxfans = mysqld_select("SELECT * FROM " . table('weixin_wxfans') . " WHERE weixin_openid=:weixin_openid ", array(':weixin_openid' => $weixin_openid)); if (!empty($weixin_wxfans['weixin_openid'])) { $member = mysqld_select("SELECT * FROM " . table('member') . " where weixin_openid=:weixin_openid or openid=:openid limit 1", array(':openid' => $weixin_wxfans['openid'], ':weixin_openid' => $weixin_openid)); if (!empty($member['openid'])) { $_SESSION[MOBILE_ACCOUNT] = $member; } else { $settings = globaSetting(); if (!empty($settings['weixin_autoreg'])) { $openid = date("YmdH", time()) . rand(100, 999); $hasaccount = true; while ($hasaccount) { $hasmember = mysqld_select("SELECT * FROM " . table('member') . " WHERE openid = :openid ", array(':openid' => $openid)); if (!empty($hasmember['openid'])) { $openid = date("YmdH", time()) . rand(100, 999); } else { $hasaccount = false; } } $shareinfo = $_GP['shareid']; if ($shareinfo != $openid && !empty($shareinfo) && (!empty($_SESSION[MOBILE_WEIXIN_OPENID]) || !empty($_SESSION[MOBILE_ALIPAY_OPENID]))) { $share_member = mysqld_select("SELECT * FROM " . table('member') . " WHERE openid = :openid", array(':openid' => $shareinfo)); if (!empty($share_member['openid'])) { if ($_CMS['addons_bj_tbk']) { bj_tbk_base_shareinfo($openid, $shareinfo); } } } $data = array('realname' => $weixin_wxfans['nickname'], 'mobile' => '', 'pwd' => '', 'createtime' => time(), 'status' => 1, 'weixin_openid' => $weixin_openid, 'istemplate' => 0, 'experience' => 0, 'openid' => $openid); mysqld_insert('member', $data); mysqld_update('weixin_wxfans', array('openid' => $openid), array('weixin_openid' => $weixin_openid)); if ($_CMS['addons_bj_tbk']) { bj_tbk_reg_member($openid); } member_login_weixin($weixin_openid); } } } } }
public function do_process() { global $_GP, $_CMS; $settings = globaSetting(); $configdata = $settings['weixintoken']; $token = $configdata; if (!$this->checkSign($token)) { exit('Access Denied'); } if (strtolower($_SERVER['REQUEST_METHOD']) == 'get') { ob_clean(); ob_start(); exit($_GET['echostr']); } if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') { $postStr = $GLOBALS["HTTP_RAW_POST_DATA"]; $message = $this->requestParse($postStr); if (empty($message)) { exit('Request Failed'); } if ($message['type'] == 'text' || $message['type'] == 'CLICK') { $key = $message['content']; if ($message['type'] == 'CLICK') { $key = $message['eventkey']; } if (!empty($key)) { $reply = mysqld_select('SELECT * FROM ' . table('weixin_rule') . " WHERE keywords = :keywords", array(':keywords' => $key)); } if (empty($reply['id']) && !empty($key) && strpos($key, 'hx') == 0 && strpos($key, 'x') == 1 && !empty(strstr($key, 'hx'))) { if ($_CMS['addons_bj_hx']) { //扩展模块代码 $newkey = str_replace('hx', '', $key); $item = mysqld_select("SELECT * FROM " . table('shop_order') . " WHERE ordersn = :ordersn\t", array(':ordersn' => $newkey)); if (empty($item)) { return $this->respText('抱歉,核销订单不存在或被取消', $message); } if ($item['status'] == 3) { return $this->respText('抱歉,核销订单已核销完成,不能重复核销!', $message); } $from_user = $message['from']; $weixin_wxfans = mysqld_select('SELECT * FROM ' . table('weixin_wxfans') . " WHERE weixin_openid = :weixin_openid", array(':weixin_openid' => $from_user)); $str = $this->verifyorder($weixin_wxfans['openid'], $newkey); return $this->respText($str, $message); } } else { if ($_CMS['addons_bj_tbk']) { //扩展模块代码 if (empty($reply['id']) && !empty($key)) { $from_user = $message['from']; $spread = mysqld_select("SELECT * FROM " . table('bj_tbk_qrcode') . " where weixinkey=:weixinkey limit 1", array(':weixinkey' => $key)); if (!empty($spread['id'])) { $weixin_wxfans = mysqld_select('SELECT * FROM ' . table('weixin_wxfans') . " WHERE weixin_openid = :weixin_openid", array(':weixin_openid' => $from_user)); if (!empty($weixin_wxfans['openid'])) { $bj_tbk_member_relect = mysqld_select('SELECT * FROM ' . table('bj_tbk_member_relect') . " WHERE openid = :openid", array(':openid' => $weixin_wxfans['openid'])); //if(empty($bj_tbk_member_relect['isagent'])) //{ // return $this->respText('您还不是代理无法生成二维码',$message); //} $qrcodecache = mysqld_select("SELECT * FROM " . table('bj_tbk_qrcode_cache') . " where qrcodeid=:qrcodeid and from_user=:from_user limit 1", array(':qrcodeid' => $spread['id'], ':from_user' => $from_user)); if (empty($qrcodecache['id']) || empty($qrcodecache['qr_url']) || empty($qrcodecache['media_id']) || empty($qrcodecache['id']) || !empty($qrcodecache['expiretime']) && $qrcodecache['expiretime'] <= TIMESTAMP) { $media_id = bj_tbk_qrcode($qrcodecache, $spread, $from_user, $weixin_wxfans['openid'], true, 'media_id'); return $this->respImage($media_id, $message); // $this->sendcustomIMG($from_user,$media_id); exit; } else { return $this->respImage($qrcodecache['media_id'], $message); } } else { return $this->respText('您还不是会员无法生成二维码', $message); } } } } } } if ($message['type'] == 'subscribe') { $reply = mysqld_select('SELECT * FROM ' . table('weixin_rule') . " WHERE keywords = :keywords", array(':keywords' => subscribe_key)); if (!empty($message['eventkey']) && strlen($message['eventkey']) > 8) { $eventkey = substr($message['eventkey'], 8); } else { $eventkey = $message['eventkey']; } if (!empty($message['from']) && !empty($eventkey)) { bj_tbk_base_shareinfo('', $eventkey, $message['from'], '', 1); } mysqld_update('weixin_wxfans', array('follow' => 1), array('weixin_openid' => $message['from'])); } if ($message['type'] == 'unsubscribe') { mysqld_update('weixin_wxfans', array('follow' => 0), array('weixin_openid' => $message['from'])); } if (empty($reply['id'])) { $reply = mysqld_select('SELECT * FROM ' . table('weixin_rule') . " WHERE keywords = :keywords", array(':keywords' => default_key)); } if ($reply['ruletype'] == 1) { $reply['content'] = htmlspecialchars_decode($reply['description']); $reply['content'] = str_replace(array('<br>', ' '), array("\n", ' '), $reply['content']); $reply['content'] = strip_tags($reply['content'], '<a>'); return $this->respText($reply['content'], $message); } if ($reply['ruletype'] == 2) { $news = array(); $news = array('title' => $reply['title'], 'description' => $reply['description'], 'picurl' => $reply['thumb'], 'url' => $reply['url']); return $this->respNews($news, $message); } exit(''); } }
function get_weixin_openid($state = 0) { global $_GP; $settings = globaSetting(array("weixin_appId", "weixin_appSecret")); $appid = $settings['weixin_appId']; $secret = $settings['weixin_appSecret']; if (empty($appid) || empty($secret)) { message('微信公众号没有配置公众号AppId和公众号AppSecret!'); } if (!empty($_SESSION[MOBILE_WEIXIN_OPENID]) && !empty($_SESSION[MOBILE_SESSION_ACCOUNT]) && !empty($_SESSION[MOBILE_SESSION_ACCOUNT]['openid'])) { $weixinfans = mysqld_select("SELECT * FROM " . table('weixin_wxfans') . " WHERE weixin_openid=:weixin_openid ", array(':weixin_openid' => $_SESSION[MOBILE_SESSION_ACCOUNT]['openid'])); if (empty($weixinfans['weixin_openid']) || $_SESSION[MOBILE_WEIXIN_OPENID] != $_SESSION[MOBILE_SESSION_ACCOUNT]['openid']) { unset($_SESSION[MOBILE_WEIXIN_OPENID]); unset($_SESSION[MOBILE_SESSION_ACCOUNT]); } } if (empty($_SESSION[MOBILE_WEIXIN_OPENID]) || empty($_SESSION[MOBILE_SESSION_ACCOUNT]) || empty($_SESSION[MOBILE_SESSION_ACCOUNT]['openid'])) { if ($state == 1 || isset($_GP['code']) && isset($_GP['state']) && $_GP['state'] == 1) { $scope = "snsapi_userinfo"; if (isset($_GP['code']) && isset($_GP['state']) && $_GP['state'] == 1) { $from_user = xoauth($appid, $secret); $_SESSION[MOBILE_WEIXIN_OPENID] = $from_user; $sessionAccount = array('openid' => $from_user); $_SESSION[MOBILE_SESSION_ACCOUNT] = $sessionAccount; return $from_user; exit; } } else { $scope = "snsapi_base"; if (isset($_GP['code'])) { $from_user = xoauth($appid, $secret); $_SESSION[MOBILE_WEIXIN_OPENID] = $from_user; $sessionAccount = array('openid' => $from_user); $_SESSION[MOBILE_SESSION_ACCOUNT] = $sessionAccount; return $from_user; exit; } } $url = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"; $oauth2_code = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" . $appid . "&redirect_uri=" . urlencode($url) . "&response_type=code&scope=" . $scope . "&state=" . $state . "#wechat_redirect"; //$state 0 不拉取用户资料 1拉取用户资料 header("location:{$oauth2_code}"); exit; } else { return $_SESSION[MOBILE_WEIXIN_OPENID]; } }
<?php defined('SYSTEM_IN') or exit('Access Denied'); hasrule('weixin', 'weixin'); $settings = globaSetting(array('weixinname', 'weixintoken', 'EncodingAESKey', 'weixin_appId', 'weixin_appSecret')); $payment = mysqld_select("SELECT * FROM " . table('payment') . " WHERE code = :code", array(':code' => 'weixin')); if (!empty($payment['configs'])) { $paymentconfig = unserialize($payment['configs']); } $thirdlogin = mysqld_select("SELECT * FROM " . table('thirdlogin') . " WHERE code = :code", array(':code' => 'weixin')); if (checksubmit()) { $cfg = array('weixinname' => $_GP['weixinname'], 'weixintoken' => $_GP['weixintoken'], 'EncodingAESKey' => $_GP['EncodingAESKey'], 'weixin_appId' => $_GP['weixin_appId'], 'weixin_appSecret' => $_GP['weixin_appSecret']); refreshSetting($cfg); mysqld_delete('config', array('name' => 'weixin_access_token')); $settings = globaSetting(array('weixinname', 'weixintoken', 'EncodingAESKey', 'weixin_appId', 'weixin_appSecret')); $thirdlogin = mysqld_select("SELECT * FROM " . table('thirdlogin') . " WHERE code = :code", array(':code' => 'weixin')); require WEB_ROOT . '/system/modules/plugin/thirdlogin/weixin/lang.php'; if (empty($thirdlogin['id'])) { $data = array('code' => 'weixin', 'enabled' => intval($_GP['thirdlogin_weixin']), 'name' => $_LANG['thirdlogin_weixin_name']); mysqld_insert('thirdlogin', $data); } else { $data = array('enabled' => intval($_GP['thirdlogin_weixin']), 'name' => $_LANG['thirdlogin_weixin_name']); mysqld_update('thirdlogin', $data, array('code' => 'weixin')); } if (empty($settings['weixintoken']) && !empty($_GP['weixintoken'])) { header("location:" . create_url('site', array('name' => 'weixin', 'do' => 'setting'))); } else { message('保存成功', 'refresh', 'success'); } } if (empty($settings['weixintoken'])) {
<?php defined('SYSTEM_IN') or exit('Access Denied'); $settings = globaSetting(array('alipay_guanzhu', 'alipay_guanzhu_open')); if (checksubmit()) { $cfg = array('alipay_guanzhu' => $_GP['alipay_guanzhu'], 'alipay_guanzhu_open' => intval($_GP['alipay_guanzhu_open'])); refreshSetting($cfg); message('保存成功', 'refresh', 'success'); } include page('guanzhu');
<?php $alipay_setting = globaSetting(array('alipay_name', 'alipay_appId', 'thirdlogin_alipay')); $_GP['alipay_config'] = array('alipay_public_key_file' => WEB_ROOT . "/config/alipay_key/alipay_public_key_file.pem", 'merchant_private_key_file' => WEB_ROOT . "/config/alipay_key/rsa_private_key.pem", 'merchant_public_key_file' => WEB_ROOT . "/config/alipay_key/rsa_public_key.pem", 'charset' => "UTF-8", 'gatewayUrl' => "https://openapi.alipay.com/gateway.do", 'app_id' => $alipay_setting['alipay_appId']); $config = $_GP['alipay_config'];
function mailnotice($orderid) { if (empty($orderid)) { return; } $settings = globaSetting(); if (empty($settings['smtp_openmail'])) { return; } $order = mysqld_select("select * from " . table('shop_order') . " where id='" . $orderid . "'"); $ordergoods = mysqld_selectall("SELECT goodsid, total,price,optionname FROM " . table('shop_order_goods') . " WHERE orderid = '{$orderid}'", array(), 'goodsid'); if (!empty($ordergoods)) { $goods = mysqld_selectall("SELECT id, title, thumb, marketprice, total,credit FROM " . table('shop_goods') . " WHERE id IN ('" . implode("','", array_keys($ordergoods)) . "')"); } $good_line = ""; if (!empty($goods)) { $good_line .= "<table>"; $good_line .= "<tr><th style=\"text-align:left;\">名称</th><th style=\"text-align:center;width:50px\">数量</th><th style=\"text-align:center;width:50px\">单价</th>"; $good_line .= "</tr>"; foreach ($goods as $row) { if (empty($paytitle)) { $paytitle = $row['title']; } $optionname = $ordergoods[$row['id']]['optionname']; if (!empty($optionname)) { $optionname = '[' . $optionname . ']'; } $good_line .= "<tr><td style=\"text-align:left\">{$optionname}{$row['title']}"; $good_line .= "</td><td style=\"text-align:center\">{$ordergoods[$row['id']]['total']} </td>"; $good_line .= "\t<td style=\"text-align:center\">{$ordergoods[$row['id']]['price']} </td></tr>"; } $good_line .= "\t</table>"; } $order_sn = $order['ordersn']; $time = date('Y-m-d H:i:s', $order['createtime']); $good_price = $order['goodsprice']; $dispatch_price = $order['dispatchprice']; $order_price = $order['price']; $dispatch_realname = $order['address_realname']; $dispatch_tell = $order['address_mobile']; $dispatch_address = $order['address_province'] . $order['address_city'] . $order['address_area'] . $order['address_address']; $previewtmp = $settings['mailtemplate']; for ($i = 1; $i < 3; $i++) { $previewtmp = str_replace("{order_sn}", $order_sn, $previewtmp); $previewtmp = str_replace("{time}", $time, $previewtmp); $previewtmp = str_replace("{good_line}", $good_line, $previewtmp); $previewtmp = str_replace("{good_price}", $good_price, $previewtmp); $previewtmp = str_replace("{dispatch_price}", $dispatch_price, $previewtmp); $previewtmp = str_replace("{order_price}", $order_price, $previewtmp); $previewtmp = str_replace("{dispatch_realname}", $dispatch_realname, $previewtmp); $previewtmp = str_replace("{dispatch_tell}", $dispatch_tell, $previewtmp); $previewtmp = str_replace("{dispatch_address}", $dispatch_address, $previewtmp); } require_once WEB_ROOT . '/includes/lib/phpmailer/PHPMailerAutoload.php'; //******************** 配置信息 ******************************** $smtpserver = $settings['smtp_server']; //SMTP服务器 $smtpauthmode = intval($settings['smtp_authmode']); //SMTP服务器端口 $smtp_sendtype = intval($settings['smtp_sendtype']); $smtpserverport = intval($settings['smtp_port']); //SMTP服务器端口 $smtpusermail = $settings['smtp_mail']; //SMTP服务器的用户邮箱 $smtpemailto = $settings['smtp_to_mail']; //发送给谁 $smtpuser = $settings['smtp_username']; //SMTP服务器的用户帐号 $smtppass = $settings['smtp_passwd']; //SMTP服务器的用户密码 $mailtitle = $settings['smtp_title']; //邮件主题 $mailcontent = $previewtmp; //邮件内容 require_once WEB_ROOT . '/system/common/extends/mail.php'; @extends_mail($smtp_sendtype, 0, $smtpserver, $smtpauthmode, $smtpserverport, $smtpusermail, $smtpemailto, $smtpuser, $smtppass, $mailtitle, $mailcontent); }
<?php $settings = globaSetting(); if (checksubmit("submit")) { $cfg = array('shop_openreg' => intval($_GP['shop_openreg']), 'shop_regcredit' => intval($_GP['shop_regcredit']), 'shop_keyword' => $_GP['shop_keyword'], 'shop_description' => $_GP['shop_description'], 'shop_title' => $_GP['shop_title'], 'shop_icp' => $_GP['shop_icp'], 'help' => htmlspecialchars_decode($_GP['help'])); if (!empty($_FILES['shop_logo']['tmp_name'])) { $upload = file_upload($_FILES['shop_logo']); if (is_error($upload)) { message($upload['message'], '', 'error'); } $shoplogo = $upload['path']; } if (!empty($shoplogo)) { $cfg['shop_logo'] = $shoplogo; } refreshSetting($cfg); message('保存成功', 'refresh', 'success'); } include page('setting');
<?php defined('SYSTEM_IN') or exit('Access Denied'); $settings = globaSetting(array('weixin_guanzhu', 'weixin_guanzhu_open')); if (checksubmit()) { $cfg = array('weixin_guanzhu' => $_GP['weixin_guanzhu'], 'weixin_guanzhu_open' => intval($_GP['weixin_guanzhu_open'])); refreshSetting($cfg); message('保存成功', 'refresh', 'success'); } include page('guanzhu');
<?php $member = get_member_account(false); $member = member_get($member['openid']); if (empty($member['openid'])) { $member = get_member_account(false); $member['createtime'] = time(); } $is_login = is_login_account(); $cfg = globaSetting(); $weixinfans = get_weixin_fans_byopenid($member['openid'], $member['openid']); if (!empty($weixinfans) && !empty($weixinfans['avatar'])) { $avatar = $weixinfans['avatar']; } include themePage('fansindex');
function weixin_js_signPackage($signPackage = array()) { $settings = globaSetting(); $timestamp = time(); $nonceStr = weixin_createNonceStr(16); $protocol = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ? "https://" : "http://"; $url = "{$protocol}{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"; $jsapiTicket = get_js_ticket(); $string = "jsapi_ticket={$jsapiTicket}&noncestr={$nonceStr}×tamp={$timestamp}&url={$url}"; $signature = sha1($string); $signPackage["appId"] = $settings['weixin_appId']; $signPackage["nonceStr"] = $nonceStr; $signPackage["timestamp"] = $timestamp; $signPackage["url"] = $url; $signPackage["signature"] = $signature; $signPackage["rawString"] = $string; return $signPackage; }