本文整理匯總了PHP中is_weixin函數的典型用法代碼示例。如果您正苦於以下問題:PHP is_weixin函數的具體用法?PHP is_weixin怎麽用?PHP is_weixin使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了is_weixin函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: index
public function index()
{
if (!$this->customer->isLogged()) {
$data['qq_login_url'] = $this->url->link('extension/module/qq_login/login', '', true);
$this->load->language('extension/module/qq_login');
$data['text_qq_login'] = $this->language->get('text_qq_login');
if ($this->customer->isLogged()) {
$data['logged'] = 1;
} else {
$data['logged'] = 0;
}
if (isset($this->session->data['qq_login_openid'])) {
$data['qq_login_authorized'] = 1;
} else {
$data['qq_login_authorized'] = 0;
}
$this->load->helper('mobile');
if (is_weixin()) {
$data['is_weixin'] = 1;
} else {
$data['is_weixin'] = 0;
}
return $this->load->view('extension/module/qq_login', $data);
}
}
示例2: __construct
public function __construct()
{
check_shop_auth();
if (is_weixin()) {
m('member')->checkMember();
}
}
示例3: __construct
public function __construct()
{
if (is_weixin() === true) {
header('Location: http://m.renrenlie.com/');
}
parent::__construct();
if (!empty($_SESSION['username']) || !empty($_SESSION['cusername'])) {
$username = $_SESSION['username'] ? $_SESSION['username'] : $_SESSION['cusername'];
$decide = M('userinfo')->where("username='" . $username . "'")->select();
if (!empty($decide)) {
$table = array();
foreach ($decide as $key => $val) {
$table = $decide[$key];
}
//判斷是企業or推薦人 1企業用戶 0推薦人
if ($table["flag"] == "0") {
$data['url'] = U('Login/userinfo');
$data['logout'] = U('Login/logout');
$data['savepass'] = U('Login/savepass');
} else {
if ($table["flag"] == "1") {
$data['url'] = U('Company/EnterpriseInformation');
$data['logout'] = U('Login/logout');
$data['savepass'] = U('Login/savepass');
}
}
$this->assign("data", $data);
}
}
}
示例4: index
public function index()
{
$this->load->model('account/customer');
$this->load->language('extension/module/weixin_login');
$this->document->setTitle($this->language->get('heading_title'));
$data['text_weixin_login'] = $this->language->get('text_weixin_login');
if ($this->customer->isLogged()) {
$data['logged'] = 1;
} else {
$data['logged'] = 0;
}
if (isset($this->session->data['weixin_login_unionid'])) {
$data['weixin_login_authorized'] = 1;
} else {
$data['weixin_login_authorized'] = 0;
}
$this->load->helper('mobile');
if (is_weixin()) {
$data['is_weixin'] = 1;
} else {
$data['is_weixin'] = 0;
}
if (is_mobile()) {
$data['is_mobile'] = 1;
} else {
$data['is_mobile'] = 0;
}
$appid = $this->config->get('weixin_login_appid');
$appkey = $this->config->get('weixin_login_appkey');
$data['weixin_login'] = $this->url->link('extension/module/weixin_login/login', '', 'SSL');
$weixin_pclogin_redirect_uri = HTTPS_SERVER . 'index.php?route=extension/module/weixin_login/weixin_pclogin_code';
$data['wxpclogin_url'] = 'https://open.weixin.qq.com/connect/qrconnect?appid=' . $appid . '&redirect_uri=' . urlencode($weixin_pclogin_redirect_uri) . '&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect';
return $this->load->view('extension/module/weixin_login', $data);
}
示例5: index
public function index()
{
if (!$this->customer->isLogged()) {
$appkey = $this->config->get('weibo_login_appkey');
$appsecret = $this->config->get('weibo_login_appsecret');
$callback_url = $this->url->link('extension/module/weibo_login/callback', '', true);
$this->load->language('extension/module/weibo_login');
$data['text_weibo_login'] = $this->language->get('text_weibo_login');
include_once DIR_SYSTEM . 'library/weibo/saetv2.ex.class.php';
$o = new SaeTOAuthV2($appkey, $appsecret);
$data['code_url'] = $o->getAuthorizeURL($callback_url);
if ($this->customer->isLogged()) {
$data['logged'] = 1;
} else {
$data['logged'] = 0;
}
if (isset($this->session->data['weibo_login_access_token']) && isset($this->session->data['weibo_login_uid'])) {
$data['weibo_login_authorized'] = 1;
} else {
$data['weibo_login_authorized'] = 0;
unset($this->session->data['weibo_login_access_token']);
unset($this->session->data['weibo_login_uid']);
}
$this->load->helper('mobile');
if (is_weixin()) {
$data['is_weixin'] = 1;
} else {
$data['is_weixin'] = 0;
}
return $this->load->view('extension/module/weibo_login', $data);
}
}
示例6: getMethod
public function getMethod($address, $total)
{
$this->load->language('extension/payment/alipay_wap');
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int) $this->config->get('alipay_wap_geo_zone_id') . "' AND country_id = '" . (int) $address['country_id'] . "' AND (zone_id = '" . (int) $address['zone_id'] . "' OR zone_id = '0')");
if ($this->config->get('alipay_wap_total') > $total) {
$status = false;
} elseif (!$this->config->get('alipay_wap_geo_zone_id')) {
$status = true;
} elseif ($query->num_rows) {
$status = true;
} else {
$status = false;
}
//判斷是否移動設備訪問
$this->load->helper('mobile');
if (is_mobile()) {
if (is_weixin()) {
$status = false;
} else {
$status = true;
}
} else {
$status = false;
}
$currencies = array('CNY');
if (!in_array(strtoupper($this->session->data['currency']), $currencies)) {
$status = false;
}
$method_data = array();
if ($status) {
$method_data = array('code' => 'alipay_wap', 'title' => $this->language->get('text_title'), 'terms' => '', 'sort_order' => $this->config->get('alipay_wap_sort_order'));
}
return $method_data;
}
示例7: __construct
public function __construct()
{
global $_W;
$this->autoFinishOrders();
if (is_weixin()) {
m('member')->checkMember();
}
}
示例8: __construct
public function __construct()
{
if (is_weixin() === true) {
header('Location: http://m.renrenlie.com/');
}
parent::__construct();
$linkArr = M("friendlink")->where("status=0")->order("orderid desc,id asc")->select();
$this->assign("linkArr", $linkArr);
}
示例9: get_user_wecha_id_new
function get_user_wecha_id_new()
{
$rt = $this->action('common', '_get_appid_appsecret');
if (is_weixin() == false || $rt['is_oauth'] == '0') {
unset($rt);
return "";
}
unset($rt);
$t = Common::_return_px();
$cache = Import::ajincache();
$cache->SetFunction(__FUNCTION__);
$cache->SetMode('user' . $t);
$uid = $this->Session->read('User.uid');
$fn = $cache->fpath(array('0' => $uid));
if (file_exists($fn) && !$cache->GetClose() && !isset($_GET['code'])) {
include $fn;
} else {
if (!isset($_GET['code'])) {
$this->action('common', 'get_user_code');
//授權跳轉
}
$code = isset($_GET['code']) ? $_GET['code'] : '';
if (!empty($code)) {
$rr = $this->action('common', '_get_appid_appsecret');
$appid = $rr['appid'];
$appsecret = $rr['appsecret'];
$access_token = $this->action('common', '_get_access_token');
$url = 'https://api.weixin.qq.com/sns/oauth2/access_token?appid=' . $appid . '&secret=' . $appsecret . '&code=' . $code . '&grant_type=authorization_code';
$con = $this->action('common', 'curlGet', $url);
$json = json_decode($con);
if (empty($access_token)) {
$access_token = $json->access_token;
}
$wecha_id = $json->openid;
$refresh_token = $json->refresh_token;
//獲取 refresh_token
if (!empty($refresh_token) && !empty($access_token)) {
if (empty($wecha_id)) {
$url = 'https://api.weixin.qq.com/sns/oauth2/refresh_token?appid=' . $appid . '&grant_type=refresh_token&refresh_token=' . $refresh_token;
$con = $this->action('common', 'curlGet', $url);
$json = json_decode($con);
$wecha_id = $json->openid;
//獲取 openid
}
}
}
$cache->write($fn, $wecha_id, 'wecha_id');
}
return $wecha_id;
}
示例10: index
public function index()
{
if ($this->customer->isLogged()) {
$this->customer->logout();
unset($this->session->data['shipping_address']);
unset($this->session->data['shipping_method']);
unset($this->session->data['shipping_methods']);
unset($this->session->data['payment_address']);
unset($this->session->data['payment_method']);
unset($this->session->data['payment_methods']);
unset($this->session->data['comment']);
unset($this->session->data['order_id']);
unset($this->session->data['coupon']);
unset($this->session->data['reward']);
unset($this->session->data['voucher']);
unset($this->session->data['vouchers']);
unset($this->session->data['qq_nickname']);
unset($this->session->data['weixin_login_openid']);
unset($this->session->data['weixin_login_unionid']);
unset($this->session->data['weixin_pclogin_openid']);
unset($this->session->data['weixin_pclogin_unionid']);
//remember weixin click logout
$this->load->helper('mobile');
if (is_weixin()) {
$this->session->data['weixin_logout_status'] = 1;
}
$this->response->redirect($this->url->link('account/logout', '', true));
}
$this->load->language('account/logout');
$this->document->setTitle($this->language->get('heading_title'));
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'));
$data['breadcrumbs'][] = array('text' => $this->language->get('text_account'), 'href' => $this->url->link('account/account', '', true));
$data['breadcrumbs'][] = array('text' => $this->language->get('text_logout'), 'href' => $this->url->link('account/logout', '', true));
$data['heading_title'] = $this->language->get('heading_title');
$data['text_message'] = $this->language->get('text_message');
$data['button_continue'] = $this->language->get('button_continue');
$data['continue'] = $this->url->link('common/home');
$data['column_left'] = $this->load->controller('common/column_left');
$data['column_right'] = $this->load->controller('common/column_right');
$data['content_top'] = $this->load->controller('common/content_top');
$data['content_bottom'] = $this->load->controller('common/content_bottom');
$data['footer'] = $this->load->controller('common/footer');
$data['header'] = $this->load->controller('common/header');
$this->response->setOutput($this->load->view('common/success', $data));
}
示例11: __construct
public function __construct($name = '')
{
parent::__construct();
$this->modulename = 'ewei_shop';
$this->pluginname = $name;
$this->loadModel();
if (strexists($_SERVER['REQUEST_URI'], '/web/')) {
cpa($this->pluginname);
} else {
if (strexists($_SERVER['REQUEST_URI'], '/app/')) {
if (is_weixin()) {
$this->setFooter();
}
}
}
$this->module['title'] = pdo_fetchcolumn('select title from ' . tablename('modules') . " where name='ewei_shop' limit 1");
}
示例12: _initialize
function _initialize()
{
$is_weixin = is_weixin();
if ($is_weixin) {
$code = $_REQUEST["code"];
if (!empty($code)) {
$this->_welogin($code);
}
}
$auth_id = session(C('USER_AUTH_KEY'));
if (!isset($auth_id)) {
//跳轉到認證網關
redirect(U(C('USER_AUTH_GATEWAY')));
}
$this->assign('js_file', 'js/' . ACTION_NAME);
$this->_assign_menu();
$this->_assign_new_count();
}
示例13: php_self
$php_self = php_self();
////////////////////////////////////
$wap_user = !empty($_SESSION['wap_user']) ? $_SESSION['wap_user'] : array();
//檢測分銷商是否存在
if (!empty($_SESSION['wap_drp_store']) && $_SESSION['wap_drp_store']['store_id'] != $tmp_store_id) {
$store_exists = D('Store')->where(array('store_id' => $_SESSION['wap_drp_store']['store_id'], 'status' => 1))->find();
if (empty($store_exists)) {
//店鋪不存在或已刪除
unset($_SESSION['wap_drp_store']);
//刪除保存在session中分銷商
}
}
/*是否移動端*/
$is_mobile = is_mobile();
/*是否微信端*/
$is_weixin = is_weixin();
//熱門關鍵詞
$hot_keyword = D('Search_hot')->where('1')->order('sort DESC')->limit(8)->select();
//合並SESSION和UID的購物車、訂單、收貨地址等信息
function mergeSessionUserInfo($sessionid, $uid)
{
//購物車
D('User_cart')->where(array('uid' => 0, 'session_id' => $sessionid))->data(array('uid' => $uid, 'session_id' => ''))->save();
//訂單
$edit_rows = D('Order')->where(array('uid' => 0, 'session_id' => $sessionid))->data(array('uid' => $uid, 'session_id' => ''))->save();
if ($edit_rows && $_COOKIE['wap_store_id']) {
//分銷訂單
D('Fx_order')->where(array('uid' => 0, 'session_id' => $sessionid))->data(array('uid' => $uid, 'session_id' => ''))->save();
M('Store_user_data')->updateData($_COOKIE['wap_store_id'], $uid);
}
//收貨地址
示例14: getGET
/**
* Created by PhpStorm.
* User: apple
* Date: 15/9/16
* Time: 下午2:04
*/
include 'library/init.inc.php';
$code = getGET('code');
$log->record_array($_GET);
if ($code != '') {
$code = $db->escape($code);
$url = $db->fetchOne('select `url` from ' . $db->table('short_link') . ' where `hash`=\'' . $code . '\'');
$log->record($url . ',' . $_SERVER['REQUEST_URI']);
$url = 'http://' . $_SERVER['HTTP_HOST'] . preg_replace('/d\\/[a-zA-Z].*$/', $url, $_SERVER['REQUEST_URI']);
$log->record('target url:' . $url);
if (is_weixin() && $_SESSION['openid'] == '') {
$oathor_url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_userinfo&state=2048#wechat_redirect';
$url = sprintf($oathor_url, $config['appid'], urlencode($url));
redirect($url);
} else {
redirect($url);
}
exit;
}
$opera = getPOST('opera');
if ($opera == 'get_url') {
$response = array('error' => 1, 'msg' => '');
if (true || !check_cross_domain()) {
$url = getPOST('url');
$account = getPOST('account');
if ($url == '') {
示例15: __construct
public function __construct()
{
if (is_weixin() === true) {
header('Location: http://m.renrenlie.com/');
}
parent::__construct();
$linkArr = M("friendlink")->where("status=0")->order("orderid desc,id asc")->select();
$this->assign("linkArr", $linkArr);
import('ORG.Util.Page');
$model2 = M('userinfo', 'stj_', 'DB_CONFIG1');
$model = M('casclist', 'stj_', 'DB_CONFIG1');
$model3 = M('member', 'stj_', 'DB_CONFIG1');
$username = $_SESSION['username'];
$userinfo = M('member')->where("username='" . $username . "'")->find();
$this->userinfo = $userinfo;
if (!empty($_SESSION['username']) || !empty($_SESSION['cusername'])) {
$username = $_SESSION['username'] ? $_SESSION['username'] : $_SESSION['cusername'];
$decide = $model2->where("username='" . $username . "'")->select();
if (!empty($decide)) {
$table = array();
foreach ($decide as $key => $val) {
$table = $decide[$key];
}
$cUserInfo = $this->getCompanyInfo();
//判斷基本資料是否填寫完整
if ($cUserInfo['cpname'] && isset($cUserInfo['mobile'])) {
$leftNavCompleted['userinfo_completed'] = true;
} else {
$leftNavCompleted['userinfo_completed'] = false;
}
//判斷合同
if (isset($cUserInfo['contract']) && $cUserInfo['checkcontract'] == 1) {
$leftNavCompleted['contract_completed'] = true;
} else {
$leftNavCompleted['contract_completed'] = false;
}
$isJob = M("job")->where("cpid='" . $cUserInfo['id'] . "'")->find();
if (!empty($isJob)) {
$leftNavCompleted['job_completed'] = true;
} else {
$leftNavCompleted['job_completed'] = false;
}
$sql = "select r.id from stj_record as r left join stj_job as j on r.j_id=j.id where j.cpid='{$cUserInfo['id']}'";
$jlist = M("record")->query($sql);
if (!empty($jlist)) {
$leftNavCompleted['record_completed'] = true;
} else {
$leftNavCompleted['record_completed'] = false;
}
$this->assign("leftNavCompleted", $leftNavCompleted);
//判斷是企業or推薦人 1企業用戶 0推薦人
if ($table["flag"] == "0") {
$data['url'] = U('Login/userinfo');
$data['logout'] = U('Login/logout');
$data['savepass'] = U('Login/savepass');
} else {
if ($table["flag"] == "1") {
$data['url'] = U('Company/EnterpriseInformation');
$data['logout'] = U('Login/logout');
$data['savepass'] = U('Login/savepass');
}
}
$this->assign("data", $data);
}
} else {
$this->error("您長時間未操作,已登錄超時,若想繼續操作,請重新登錄!", U('Index/index'));
}
}