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


PHP is_weixin函数代码示例

本文整理汇总了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);
     }
 }
开发者ID:brunoxu,项目名称:mycncart,代码行数:25,代码来源:qq_login.php

示例2: __construct

 public function __construct()
 {
     check_shop_auth();
     if (is_weixin()) {
         m('member')->checkMember();
     }
 }
开发者ID:ChainBoy,项目名称:wxfx,代码行数:7,代码来源:core1.php

示例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);
         }
     }
 }
开发者ID:xiaoyueer98,项目名称:pc.rrl.com,代码行数:30,代码来源:IndexController.class.php

示例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);
 }
开发者ID:brunoxu,项目名称:mycncart,代码行数:34,代码来源:weixin_login.php

示例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);
     }
 }
开发者ID:brunoxu,项目名称:mycncart,代码行数:32,代码来源:weibo_login.php

示例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;
 }
开发者ID:brunoxu,项目名称:mycncart,代码行数:34,代码来源:alipay_wap.php

示例7: __construct

 public function __construct()
 {
     global $_W;
     $this->autoFinishOrders();
     if (is_weixin()) {
         m('member')->checkMember();
     }
 }
开发者ID:noikiy,项目名称:mygit,代码行数:8,代码来源:core.php

示例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);
 }
开发者ID:xiaoyueer98,项目名称:pc.rrl.com,代码行数:9,代码来源:ActiveController.class.php

示例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;
 }
开发者ID:jasonhzy,项目名称:wxfx,代码行数:50,代码来源:controller.php

示例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));
 }
开发者ID:brunoxu,项目名称:mycncart,代码行数:46,代码来源:logout.php

示例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");
 }
开发者ID:ChainBoy,项目名称:wxfx,代码行数:17,代码来源:plugin.php

示例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();
 }
开发者ID:zqstudio2015,项目名称:smeoa,代码行数:18,代码来源:CommonAction.class.php

示例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);
    }
    //收货地址
开发者ID:fkssei,项目名称:pigcms10,代码行数:31,代码来源:global.php

示例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 == '') {
开发者ID:Winsen1990,项目名称:easyilife,代码行数:31,代码来源:index.php

示例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'));
     }
 }
开发者ID:xiaoyueer98,项目名称:pc.rrl.com,代码行数:68,代码来源:CompanyController.class.php


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