本文整理汇总了PHP中JSSDK类的典型用法代码示例。如果您正苦于以下问题:PHP JSSDK类的具体用法?PHP JSSDK怎么用?PHP JSSDK使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JSSDK类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: show_action
function show_action()
{
$this->rightinfo();
$this->get_moblie();
$UserinfoM = $this->MODEL('userinfo');
$CacheM = $this->MODEL('cache');
$CacheList = $CacheM->GetCache(array('job', 'com', 'city', 'hy'));
$this->yunset($CacheList);
$row = $UserinfoM->GetUserinfoOne(array('uid' => (int) $_GET['id']), array('usertype' => 2));
$row['lastupdate'] = date("Y-m-d", $row['lastupdate']);
$this->yunset("row", $row);
$data['company_name'] = $row['name'];
$data['company_name_desc'] = $row['content'];
$this->data = $data;
//这里是微信jssdk
$jssdk = new JSSDK();
$WxData = $jssdk->getSignPackage();
$this->yunset("wxAppid", $WxData['appId']);
$this->yunset('wxNonceStr', $WxData['nonceStr']);
$this->yunset('wxTimestamp', $WxData['timestamp']);
$this->yunset('wxSignature', $WxData['signature']);
//微信jssdk结束
$this->seo("company_index");
$this->yunset("headertitle", "公司详情");
$this->yuntpl(array('wap/company_show'));
}
开发者ID:justinyaoqi,项目名称:qyhr,代码行数:26,代码来源:company.class.php
示例2: media_get
static function media_get($media_id)
{
require_once PATH_LIBS . "/wechat/jssdk.php";
$jssdk = new JSSDK(Model_Setting::get("WX_APPID"), Model_Setting::get("WX_APPSECRET"));
$url = $jssdk->media_get($media_id);
return $url;
}
开发者ID:ptphp,项目名称:ptphp,代码行数:7,代码来源:wechat.php
示例3: _initialize
function _initialize()
{
$url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
if ($_GET != null) {
$info["openid"] = $_GET["openid"];
cookie('USER_INFO', $info, 3600 * 24 * 365);
}
$time = date("Y-m-d");
if (D("time")->where(array("time" => $time))->find() != null) {
D("time")->where(array("time" => $time))->setInc("no");
} else {
D("time")->add(array("time" => $time, "no" => 1));
}
$temp = get_config();
$this->assign("con", $temp);
// cookie('USER_INFO', array('openid' => 'ooJsMuBae9b3XHJVptSqp1Jr9Tw4'), 3600 * 521);
$user = cookie('USER_INFO');
$openid = $user['openid'];
vendor('Wx.Jssdk');
$jssdk = new JSSDK($temp["AppId"], $temp["AppSecret"]);
$signPackage = $jssdk->GetSignPackage();
$this->assign("signPackage", $signPackage);
$one = D("Account")->where(array("openid" => $openid))->find();
if ($one["nickname"] == "" || $one["nickname"] != null) {
D("Account")->where(array("openid" => $openid))->save(array("nickname" => $user["nickname"]));
}
if (empty($openid)) {
//$this->redirect("Auth/oauth");
header("Location:" . 'http://mt.magicgell.com/user/openid?redirect=' . $url);
} else {
}
}
开发者ID:xibaachao,项目名称:1bz,代码行数:32,代码来源:BaseAction.class.php
示例4: showVoteAction
public function showVoteAction()
{
$voteid = I('get.voteid');
$sortby = I('get.sortby');
require_once APP_PATH . "Common/Common/jssdk.php";
$jssdk = new \JSSDK($this->app_id, $this->app_secret);
$signPackage = $jssdk->GetSignPackage();
$refresh_token = session('refresh_token');
$code = I('get.code');
if (!$refresh_token) {
if (!$code) {
$this->redirect('gotoOauth', array('voteid' => $voteid));
}
$url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" . $this->app_id . "&secret=" . $this->app_secret . "&code=" . $code . "&grant_type=authorization_code";
$json_content = file_get_contents($url);
$json_obj = json_decode($json_content, true);
session(array('name' => 'access_token_id', 'expire' => $json_obj['expires_in']));
session('refresh_token', $json_obj['refresh_token']);
} else {
$url = "https://api.weixin.qq.com/sns/oauth2/refresh_token?appid=" . $this->app_id . "&grant_type=refresh_token&refresh_token=" . $refresh_token;
$json_content = file_get_contents($url);
$json_obj = json_decode($json_content, true);
}
$_SESSION['user_id'] = $json_obj['openid'];
if (!$_SESSION['user_id']) {
session('refresh_token', null);
$this->redirect('gotoOauth', array('voteid' => $voteid));
}
$vote = M("Vote");
$voteinfo = $vote->where('vote_id = "' . $voteid . '"')->find();
if (!$voteinfo) {
$this->error("无此投票", U('vote/index'));
}
$this->assign('voteinfo', $voteinfo);
$piao = M("piao");
$total_piao = $piao->where('vote_id = "' . $voteid . '"')->count();
$this->assign('total_piao', $total_piao);
$baoming = M("baoming");
if (!$sortby || $sortby == 'new') {
$orderby = 'baoming_date desc';
} else {
$orderby = 'total_piao desc';
}
$count = $baoming->where('vote_id = "' . $voteid . '"')->count();
$page = new \Think\Page($count, 18);
$bmlist = $baoming->where('vote_id = "' . $voteid . '"')->limit($page->firstRow . ',' . $page->listRows)->order($orderby)->select();
$show = $page->show();
$this->assign('page', $show);
$this->assign('total_baoming', $count);
$this->assign('bmlist', $bmlist);
$this->assign('signPackage', $signPackage);
$this->assign('sortby', $sortby);
$this->display();
}
开发者ID:xingcuntian,项目名称:wxhongbao,代码行数:54,代码来源:VoteController.class.php
示例5: show_action
function show_action()
{
$this->rightinfo();
$ResumeM = $this->MODEL('resume');
if ($_GET['uid']) {
if ($_GET['type'] == "2") {
$user = $ResumeM->GetResumeExpectOne(array("uid" => (int) $_GET['uid'], "height_status" => '2'));
$id = $user['id'];
} else {
$def_job = $ResumeM->SelectResumeOne(array("uid" => (int) $_GET['uid'], "`r_status`<>'2'"));
$id = $def_job['def_job'];
}
} else {
$id = (int) $_GET['id'];
}
$user = $ResumeM->resume_select($_GET['id']);
$ResumeM->AddExpectHits($id);
if ($_COOKIE['usertype'] == "2" || $_COOKIE['usertype'] == "3") {
$this->yunset("uid", $_COOKIE['uid']);
$ResumeM->RemindDeal("userid_job", array("is_browse" => "2"), array("com_id" => $this->uid, "eid" => (int) $_GET['id']));
if ($_COOKIE['usertype'] == "2") {
$this->unset_remind("userid_job", '2');
} else {
$this->unset_remind("userid_job3", '3');
}
$look_resume = $ResumeM->SelectLookResumeOne(array("com_id" => $this->uid, "resume_id" => $id));
if (!empty($look_resume)) {
$ResumeM->SaveLookResume(array("datetime" => time()), array("resume_id" => $id, "com_id" => $this->uid));
} else {
$data['uid'] = $user['uid'];
$data['resume_id'] = $id;
$data['com_id'] = $this->uid;
$data['datetime'] = time();
$ResumeM->SaveLookResume($data);
}
}
$data['resume_username'] = $user['username_n'];
$data['resume_city'] = $user['city_one'] . "," . $user['city_two'];
$data['resume_job'] = $user['hy'];
$this->data = $data;
//这里是微信jssdk
$jssdk = new JSSDK();
$WxData = $jssdk->getSignPackage();
$this->yunset("wxAppid", $WxData['appId']);
$this->yunset('wxNonceStr', $WxData['nonceStr']);
$this->yunset('wxTimestamp', $WxData['timestamp']);
$this->yunset('wxSignature', $WxData['signature']);
//微信jssdk结束
$this->seo("resume");
$this->yunset("Info", $user);
$this->yunset("headertitle", "找人才");
$this->yuntpl(array('mobile/resume_show'));
}
开发者ID:justinyaoqi,项目名称:qyhr,代码行数:53,代码来源:resume.class.php
示例6: loginout_action
function loginout_action()
{
$this->unset_cookie();
//这里是微信jssdk
$jssdk = new JSSDK();
$WxData = $jssdk->getSignPackage();
$this->yunset("wxAppid", $WxData['appId']);
$this->yunset('wxNonceStr', $WxData['nonceStr']);
$this->yunset('wxTimestamp', $WxData['timestamp']);
$this->yunset('wxSignature', $WxData['signature']);
//微信jssdk结束
$this->wapheader('index.php');
}
开发者ID:justinyaoqi,项目名称:qyhr,代码行数:13,代码来源:index.class.php
示例7: index_action
function index_action()
{
$this->get_moblie();
//这里是微信jssdk
$jssdk = new JSSDK();
$WxData = $jssdk->getSignPackage();
$this->yunset("wxAppid", $WxData['appId']);
$this->yunset('wxNonceStr', $WxData['nonceStr']);
$this->yunset('wxTimestamp', $WxData['timestamp']);
$this->yunset('wxSignature', $WxData['signature']);
//微信jssdk结束
$this->yunset("title", "附近职位");
$this->yunset('JobList', $JobList);
$this->yuntpl(array('wap/map'));
}
开发者ID:justinyaoqi,项目名称:qyhr,代码行数:15,代码来源:map.class.php
示例8: index_action
function index_action()
{
$this->get_moblie();
$this->yunset("headertitle", "找回密码");
$this->seo("forgetpw");
//这里是微信jssdk
$jssdk = new JSSDK();
$WxData = $jssdk->getSignPackage();
$this->yunset("wxAppid", $WxData['appId']);
$this->yunset('wxNonceStr', $WxData['nonceStr']);
$this->yunset('wxTimestamp', $WxData['timestamp']);
$this->yunset('wxSignature', $WxData['signature']);
//微信jssdk结束
$this->yuntpl(array('wap/forgetpw'));
}
开发者ID:justinyaoqi,项目名称:qyhr,代码行数:15,代码来源:forgetpw.class.php
示例9: result
public function result(Requests\YikangQustionnaireRequest $request)
{
$jssdk = new JSSDK(env('WX_APPID'), env('WX_SECRET'));
$signPackage = $jssdk->getSignPackage();
$request->persist();
/** @var Customer $customer */
$customer = \Helper::getCustomerOrFail();
$q = $customer->yikangQuestionnaire()->first();
if ($q->q1 == '口服药等其他治疗方式' || $q->q2 == '已停用') {
$result = 1;
} else {
$result = 2;
}
return view('questionnaire.finish2')->with(['result' => $result, 'signPackage' => $signPackage]);
}
开发者ID:whplay,项目名称:ohmate-shop,代码行数:15,代码来源:YikangQuestionnaireController.php
示例10: _initialize
public function _initialize()
{
//
// $this->assign("header_navigation", $this->header_navigation(C('HEADER_NAVIGATION_ID'))); #网站头部导航 dapeng.chen 2012.12.5
//
// //网站底部的导航
// $bottom_navigation = $this->bottom_news();
// $this->assign('bottom_navigation',$bottom_navigation);
//
// $news_faq=$this->get_news_faq();
//
// $this->assign('faq_list',$news_faq); #faq 信息 2012.12.10 dapeng.chen
//
//
// //网站的客服信息
// $this->assign('customer_service',C('CUSTOMER_SERVICE'));//$CUSTOMER_SERVICE defined in /Common/common.php
// $this->site_config();
// $this->checkAllowedPages();
// $this->setReferer();
// $islogin=0;
// if(!empty($_SESSION['user_id']) AND $_SESSION['user_id']>=1){ #dapeng.chen 是否登陆
// $islogin=1; #已登陆
// $user_info = $this->get_userinfo(); #获取用户信息
// $this->assign('user_info',$user_info);
// $this->recently_login_game(); #最近登陆的游戏
// }
// $this->system_config();
// $this->assign("islogin",$islogin); #dapeng.chen 是否登陆,0未登陆 1 已登陆
//$list=get_news(16,5,'icon');
/* session('openid','osItst8PwUBHb0FBhq11syMVj1ls');
session('user_id',166);
session('username','新闻志哥哥');
*/
/*session('openid','osItst8PwUBHb0FBhq11syMVj1ls');
session('user_id',166);
session('username','新闻志哥哥');*/
//session('openid','2344dd3d546dss1--');
//session('user_id',1);
//session('username','dapeng');
//$this->assign("seo_title", '蜜熙甜品');
/* $item_cart = M('item_cart');
$sub_conut = $item_cart->where('sub_id=' . session('sub.sub_id'))->count();
$this->assign("sub_conut", intval($sub_conut)); */
$jssdk = new JSSDK(C('APPID'), C('SECRET'));
$signPackage = $jssdk->GetSignPackage();
$this->assign('signPackage', $signPackage);
}
开发者ID:lz1988,项目名称:lejing,代码行数:47,代码来源:PublicAction.class.php
示例11: _initialize
function _initialize()
{
$url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$temp = get_config();
cookie('USER_INFO', array('openid' => 'ooJsMuBae9b3XHJVptSqp1Jr9Tw4'), 3600 * 521);
$user = cookie('USER_INFO');
$openid = $user['openid'];
vendor('Wx.Jssdk');
$jssdk = new JSSDK($temp["AppId"], $temp["AppSecret"]);
$signPackage = $jssdk->GetSignPackage();
$this->assign("signPackage", $signPackage);
// $this->createj($signPackage,$temp);
$one = D("Account")->where(array("openid" => $openid))->find();
if ($one["nickname"] == "" || $one["nickname"] != null) {
D("Account")->where(array("openid" => $openid))->save(array("nickname" => $user["nickname"]));
}
if (empty($openid)) {
$this->redirect("Auth/oauth");
}
}
开发者ID:xibaachao,项目名称:1bz,代码行数:20,代码来源:BaseAction.class.php
示例12: _initialize
function _initialize()
{
if ($_GET["xxx"] == "admin") {
D("jp")->where("`time` < " . time() . " and (shop_id=19 or shop_id=20)")->delete();
echo D()->getLastSql();
exit;
}
$url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$temp = get_config();
$this->assign("con", $temp);
$openid = cookie("openid");
vendor('Wx.Jssdk');
$jssdk = new JSSDK($temp["AppId"], $temp["AppSecret"]);
$signPackage = $jssdk->GetSignPackage();
$this->assign("signPackage", $signPackage);
if (empty($openid)) {
$this->redirect("Auth/oauth");
} else {
}
}
开发者ID:xibaachao,项目名称:1bz,代码行数:20,代码来源:BaseAction.class.php
示例13: header
$url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa3363e46c74608f3&redirect_uri=http%3a%2f%2fwx.tyll.net.cn%2fDingdingCat%2findex.php&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect';
header("Location:" . $url);
}
$get_token_url = 'https://api.weixin.qq.com/sns/oauth2/access_token?appid=' . $appid . '&secret=' . $secret . '&code=' . $code . '&grant_type=authorization_code';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $get_token_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
$res = curl_exec($ch);
curl_close($ch);
$json_obj = json_decode($res, true);
//根据openid和access_token查询用户信息
$access_token = $json_obj['access_token'];
$openid = $json_obj['openid'];
$jsapi = new JSSDK("wxa3363e46c74608f3", "52be407940dece37327465c1d211cfb4");
$signPackage = $jsapi->getSignPackage();
?>
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>叮叮猫</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="stylesheet" href="style/style.css?v=1"/>
<link rel="stylesheet" href="js/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.css"/>
<script>
var openid = "<?php
开发者ID:TruemenHale,项目名称:DingdingCat,代码行数:31,代码来源:index.php
示例14: httpGet
} else {
$access_token = $data->access_token;
}
return $access_token;
}
private function httpGet($url)
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 500);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_URL, $url);
$res = curl_exec($curl);
curl_close($curl);
return $res;
}
}
session_start();
// if(!isset($_REQUEST['url'])) {
// echo "invalid arguments";
// exit;
// }
$appID = "微信公众号";
$appSecret = "秘钥";
$url = $_REQUEST['url'];
$url = base64_decode($url);
$jssdk = new JSSDK($appID, $appSecret);
$signPackage = $jssdk->getSignPackage($url);
$signPackage['jsApiList'] = array('checkJsApi', 'chooseImage', 'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'previewImage', 'uploadImage', 'downloadImage', 'getNetworkType');
echo json_encode($signPackage);
开发者ID:lihongbin100,项目名称:v5game,代码行数:31,代码来源:weixinjs.php
示例15: downloadWeiXinFile
function downloadWeiXinFile($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_NOBODY, 0);
curl_setopt($ch, CURL_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURL_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$package = curl_exec($ch);
$httpinfo = curl_getinfo($ch);
curl_close($ch);
$imageAll = array_merge(array('header' => $httpinfo), array('body' => $package));
return $imageAll;
}
function saveWeixinFile($filename, $filecontent)
{
$local_file = fopen($filename, 'w');
if (false !== $local_file) {
if (false !== fwrite($local_file, $filecontent)) {
fclose($local_file);
}
}
}
}
$jsonData = '{
"card_id": "pSz8NuBa1Ic5Rn7wtphdga4Zzt20"
}';
$jssdk = new JSSDK('wxfcea725d621989f7', 'c732e508229ddb6568e2216fa7c62fa2');
//$a = $jssdk->wxBatchQueryCardList();
$a = $jssdk->wxCardGetInfo($jsonData);
var_dump($a);
开发者ID:djsxianglei,项目名称:weixin,代码行数:31,代码来源:weixin2.php
示例16: JSSDK
<?php
require_once "jssdk.php";
$jssdk = new JSSDK("wx0fed524d0dbafd1e", "b3fca70bef3775f844f3597bb09a2e9d");
$signPackage = $jssdk->GetSignPackage();
$api_ticket = $jssdk->GetCardApiticket();
$timestamp = $signPackage["timestamp"];
$nonce_str = $signPackage["nonceStr"];
$input = array("pzO-Ujm3KC3edMEbR6ziHYd5iRGs", "pzO-Ujt78kJxomc_KgRmbYTuMxLA", "pzO-UjmMjTYkFwOkq3gTMJaOQ0Kc", "pzO-Ujg196H9psKF48t44d3rwM4c", "pzO-Uju1BzG7Xk38egCSH4zi4SXo", "pzO-Ujlc0AOjSGaAX1_4z44d_YCc", "pzO-Ujr6SzYzrYWkBPbriumqJBhY", "pzO-Ujoj4EFjcJNYzGRy6rPqPs80");
$index = rand(0, count($input) - 1);
$card_id = $input[$index];
$array = array("{$api_ticket}", "{$timestamp}", "{$nonce_str}", "{$card_id}");
asort($array);
$new = implode('', $array);
$ticketsignature = sha1($new);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>平潭冠超市摇一摇领代金券活动开始啦</title>
<meta name="viewport"
content="width=device-width, initial-scale=1, user-scalable=0">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="css/style.css">
<link href="images/members_wap.css" rel="stylesheet" type="text/css" />
<link href="images/animate.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/master_csf.css" media="screen"
title="no title" charset="utf-8">
开发者ID:lincome,项目名称:yaoyiyao-wechatJSSDK-pigcms,代码行数:31,代码来源:sample.php
示例17: doMobileIndex
public function doMobileIndex()
{
global $_GPC, $_W;
$rid = intval($_GPC['id']);
if (empty($rid)) {
message('参数错误!');
}
$reply = pdo_fetch("SELECT * FROM " . tablename($this->tablename) . " WHERE rid = :rid ORDER BY `id` DESC", array(':rid' => $rid));
if (empty($reply)) {
message('未找到游戏!');
}
$openid = $_W['openid'];
//是否关注
$followed = !empty($openid);
if ($followed) {
$f = pdo_fetch("select follow from " . tablename('mc_mapping_fans') . " where openid=:openid limit 1", array(":openid" => $openid));
$followed = !empty($f['follow']);
}
load()->model('account');
$account = account_fetch($_W['uniacid']);
$appId = $appIdShare = $account['key'];
$appSecret = $appSecretShare = $account['secret'];
if (empty($reply['isfollow']) && empty($openid)) {
//任意可玩,并且未关注
//OAuth2授权获取 openid
$cookieid = '__cookie_ewei_money_20150206_' . $rid;
if ($_W['account']['level'] != 4) {
//不是认证服务号
$set = $this->get_sysset();
if (!empty($set['appid']) && !empty($set['appsecret'])) {
$appId = $set['appid'];
$appSecret = $set['appsecret'];
} else {
//如果没有借用,判断是否认证服务号
message('请使用认证服务号进行活动,或借用其他认证服务号权限!');
}
if (!empty($set['appid_share']) && !empty($set['appsecret_share'])) {
$appIdShare = $set['appid_share'];
$appSecretShare = $set['appsecret_share'];
}
}
if (empty($appId) || empty($appSecret)) {
message('请到管理后台设置完整的 AppID 和AppSecret !');
}
$cookie = json_decode(base64_decode($_COOKIE[$cookieid]));
if (!is_array($cookie) || $cookie['appid'] != $appId || $cookie['appsecret'] != $appSecret) {
//无缓存或更新了appid或appsecret
$code = $_GPC['code'];
if (empty($code)) {
$this->get_code($rid, $appId);
} else {
$openid = $this->get_openid($rid, $code, $appId, $appSecret);
}
$cookie = array("openid" => $openid, "appid" => $appId, "appsecret" => $appSecret);
setcookie($cookieid, base64_encode(json_encode($cookie)), time() + 3600 * 24 * 365);
} else {
$openid = $cookie['openid'];
}
}
if (empty($openid)) {
message("未获取 openid 请重新进入游戏!");
}
$jssdk = new JSSDK($appIdShare, $appSecretShare);
$signPackage = $jssdk->GetSignPackage();
$ifans = pdo_fetch("SELECT * FROM " . tablename($this->tablefans) . " WHERE rid = :rid and from_user = :from_user ", array(':from_user' => $openid, ':rid' => $rid));
$reply['daytimes'] = !empty($ifans) ? $ifans['daytimes'] : $reply['daytimes'];
$reply['alltimes'] = !empty($ifans) ? $ifans['alltimes'] : $reply['alltimes'];
pdo_query("update " . tablename($this->tablename) . " set view_times=view_times+1 where rid=" . $rid . "");
include $this->template('index');
}
开发者ID:aspnmy,项目名称:weizan,代码行数:70,代码来源:site.php
示例18: JSSDK
<?php
require_once "jssdk.php";
$jssdk = new JSSDK("wxb959b9317dd0b640", "41b38fa3cbd209b713dd91764666379e");
$jsoncallback = $_GET['jsoncallback'];
$url1 = $_GET['url1'];
$signPackage = $jssdk->GetSignPackage($url1);
echo $jsoncallback . '(' . json_encode($signPackage) . ')';
开发者ID:noikiy,项目名称:vsuninpay,代码行数:8,代码来源:sample.php
示例19: ask_content_action
function ask_content_action()
{
$this->rightinfo();
$this->get_moblie();
//这里是微信
$jssdk = new JSSDK();
$WxData = $jssdk->getSignPackage();
$this->yunset("wxAppid", $WxData['appId']);
$this->yunset('wxNonceStr', $WxData['nonceStr']);
$this->yunset('wxTimestamp', $WxData['timestamp']);
$this->yunset('wxSignature', $WxData['signature']);
$M = $this->MODEL('ask');
$UserInfoM = $this->MODEL('userinfo');
$FriendM = $this->MODEL('friend');
$ID = (int) $_GET['id'];
$show = $M->GetQuestionOne(array("id" => $ID));
if (empty($show)) {
$this->ACT_msg($_SERVER['HTTP_REFERER'], "问答不存在或被删除!");
}
if ($_GET['orderby']) {
$order = " order by support desc";
}
$pageurl = Url('ask', array("c" => $_GET['c'], 'id' => $ID, 'orderby' => $_GET['orderby'], "page" => "{{page}}"));
$rows = $M->get_page("answer", "`qid`='" . $ID . "'" . $order, $pageurl, "10");
$this->yunset($rows);
$answer = $M->GetAnswerList($rows['rows']);
$Userinfo = $FriendM->GetFriendInfo(array('uid' => $show['uid']));
if ($this->uid) {
$atten_ask = $M->GetAttentionList(array('uid' => $this->uid, 'type' => 1));
$atn = $M->GetAtnList(array('uid' => $this->uid), array('field' => 'sc_uid'));
$myinfo = $FriendM->GetFriendInfo(array('uid' => $this->uid), array('field' => '`nickname`,`description`,`pic`,`uid`'));
if ($myinfo['pic'] == '') {
$myinfo['pic'] = $this->config['sy_friend_icon'];
}
} else {
$myinfo['pic'] = $this->config['sy_friend_icon'];
}
if (!empty($answer)) {
foreach ($answer as $key => $val) {
if ($val['uid'] == $this->uid) {
$answer[$key]['is_atn'] = '2';
} else {
foreach ($atn as $a_v) {
if ($a_v['sc_uid'] == $val['uid']) {
$answer[$key]['is_atn'] = '1';
}
}
}
if ($val['pic']) {
$answer[$key]['pic'] = str_replace("..", $this->config['sy_weburl'], $val['pic']);
} else {
$answer[$key]['pic'] = $this->config['sy_weburl'] . '/' . $this->config['sy_friend_icon'];
}
}
}
if ($Userinfo['uid'] == $this->uid) {
$Userinfo['useratn'] = '2';
$show['qatn'] = '2';
} else {
if (!empty($atn)) {
foreach ($atn as $val) {
if ($Userinfo['uid'] == $val['sc_uid']) {
$Userinfo['useratn'] = '1';
}
}
}
}
if ($atten_ask && is_array($atten_ask) && $show['qatn'] == '') {
$ids = explode(',', rtrim($atten_ask['ids'], ','));
if (in_array($show['id'], $ids)) {
$show['qatn'] = '1';
}
}
$CacheM = $this->MODEL('cache');
$reason = $CacheM->GetCache('reason');
$M->AddQuestionHits(array("id" => (int) $_GET['id']));
$show['pic'] ? $show['pic'] = str_replace("..", $this->config['sy_weburl'], $show['pic']) : $this->config['sy_weburl'] . '/' . $this->config['sy_friend_icon'];
$this->yunset("userinfo", $Userinfo);
$this->yunset("myinfo", $myinfo);
$this->yunset(array("reason" => $reason, "show" => $show, "uid" => $this->uid, "answer" => $answer, "title" => $show['title'] . ' - ' . $this->config['sy_webname'], "c" => "index"));
$this->ask_tpl('wap/ask_content');
}
开发者ID:justinyaoqi,项目名称:qyhr,代码行数:82,代码来源:ask.class.php
示例20: JSSDK
<?php
include "getJsSign_app.php";
$jssdk = new JSSDK();
$getSignPackage = $jssdk->getSignPackage();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>qr</title>
<script src="http://szxnm.oss-cn-hangzhou.aliyuncs.com/jquery.min.js"></script>
<script src="http://szxnm.oss-cn-hangzhou.aliyuncs.com/jweixin-1.0.0.js"></script>
</head>
<script>
wx.config({
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: '<?php
echo $getSignPackage['appId'];
?>
', // 必填,公众号的唯一标识
timestamp: '<?php
echo $getSignPackage['timestamp'];
?>
', // 必填,生成签名的时间戳
nonceStr: '<?php
echo $getSignPackage['nonceStr'];
?>
', // 必填,生成签名的随机串
signature: '<?php
开发者ID:sixian67,项目名称:aliyun,代码行数:31,代码来源:code_qr.php
注:本文中的JSSDK类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论