• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_mobile函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中is_mobile函数的典型用法代码示例。如果您正苦于以下问题:PHP is_mobile函数的具体用法?PHP is_mobile怎么用?PHP is_mobile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了is_mobile函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: search_result_action

 public function search_result_action()
 {
     if (!in_array($_GET['search_type'], array('questions', 'topics', 'users', 'articles'))) {
         $_GET['search_type'] = null;
     }
     $search_result = $this->model('search')->search(cjk_substr($_GET['q'], 0, 64), $_GET['search_type'], $_GET['page'], get_setting('contents_per_page'), null, $_GET['is_recommend']);
     if ($this->user_id and $search_result) {
         foreach ($search_result as $key => $val) {
             switch ($val['type']) {
                 case 'questions':
                     $search_result[$key]['focus'] = $this->model('question')->has_focus_question($val['search_id'], $this->user_id);
                     break;
                 case 'topics':
                     $search_result[$key]['focus'] = $this->model('topic')->has_focus_topic($this->user_id, $val['search_id']);
                     break;
                 case 'users':
                     $search_result[$key]['focus'] = $this->model('follow')->user_follow_check($this->user_id, $val['search_id']);
                     break;
             }
         }
     }
     TPL::assign('search_result', $search_result);
     if (is_mobile()) {
         TPL::output('m/ajax/search_result');
     } else {
         TPL::output('search/ajax/search_result');
     }
 }
开发者ID:wenyinos,项目名称:wecenter,代码行数:28,代码来源:ajax.php


示例2: run

 /**
  * 项目运行函数
  */
 public static function run()
 {
     global $config;
     if (!empty($config['site_mobile']) && is_mobile()) {
         $config['site_theme'] = is_dir(TEMPLATE_DIR . 'mobile') ? 'mobile' : $config['site_theme'];
     }
     static $_app = array();
     $app_id = self::$controller . '_' . self::$action;
     define('SYS_THEME_DIR', $config['site_theme'] . DIRECTORY_SEPARATOR);
     //模板风格
     self::parse_request();
     if (!isset($_app[$app_id])) {
         $controller = self::$controller;
         $action = self::$action . 'Action';
         if (is_file(CONTROLLER_DIR . $controller . '.php')) {
             self::load_file(CONTROLLER_DIR . $controller . '.php');
         } else {
             exit('XiaoCms:Controller does not exist.');
         }
         $app_object = new $controller();
         if (method_exists($controller, $action)) {
             $_app[$app_id] = $app_object->{$action}();
         } else {
             exit('XiaoCms:Action does not exist.');
         }
     }
     return $_app[$app_id];
 }
开发者ID:43431655,项目名称:qizhongbao,代码行数:31,代码来源:xiaocms.php


示例3: getMethod

 public function getMethod($address, $total)
 {
     $this->load->language('payment/alipay_direct');
     $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int) $this->config->get('pp_standard_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_direct_total') > $total) {
         $status = false;
     } elseif (!$this->config->get('alipay_direct_geo_zone_id')) {
         $status = true;
     } elseif ($query->num_rows) {
         $status = true;
     } else {
         $status = false;
     }
     //判断是否移动设备访问
     $this->load->helper('mobile');
     if (is_mobile()) {
         $status = false;
     }
     $currencies = array('CNY');
     if (!in_array(strtoupper($this->currency->getCode()), $currencies)) {
         $status = false;
     }
     $method_data = array();
     if ($status) {
         $method_data = array('code' => 'alipay_direct', 'title' => $this->language->get('text_title'), 'terms' => '', 'sort_order' => $this->config->get('alipay_direct_sort_order'));
     }
     return $method_data;
 }
开发者ID:monkeychen,项目名称:website,代码行数:28,代码来源:alipay_direct.php


示例4: do_login

 /**
  * 登录接口
  */
 public function do_login()
 {
     $this->load->helper('validate');
     $account = $this->input->post('account');
     $password = $this->input->post('password');
     $device_id = $this->input->post('device_id');
     $device = $this->input->post('device');
     $check_mobile = is_mobile($account);
     $logined = false;
     if (!$check_mobile['status']) {
         $check_account = is_email($account);
         if (!$check_account['status']) {
             $this->set_response(10800);
         } else {
             $logined = $this->api_auth->login($account, $password, true, array($device, $device_id));
         }
     } else {
         $logined = $this->api_auth->login($account, $password, false, array($device, $device_id));
     }
     if (!$logined) {
         $errors = $this->api_auth->get_error();
         if (isset($errors['banned'])) {
             // banned user
             $this->set_response(20501);
         } elseif (isset($errors['not_activated'])) {
             // not activated user
             $this->set_response(20502);
         } else {
             $this->set_response(20503);
         }
     }
     $this->set_response(0, array($this->api_auth->get_user()->user_id, $this->api_auth->get_token()));
 }
开发者ID:lwl1989,项目名称:paintmore,代码行数:36,代码来源:Login.php


示例5: embed_bbs_appgame_callback

function embed_bbs_appgame_callback($match)
{
    $ori_url = $match[1];
    $ori_url = preg_replace("#amp;#", "", $ori_url);
    $save_name = get_savename($ori_url);
    if ($res = get_cache_data($save_name)) {
        return $res;
    }
    if ($res = get_cache_data($save_name . ERROR_NAME)) {
        return $res;
    }
    $pid = null;
    if ($match[2] == 'redirect') {
        $pid = $match[4];
    }
    $mobile = is_mobile();
    $return = get_bbspage_form_url($ori_url, $pid, $mobile);
    if ($return) {
        put_cache_data($save_name, $return);
        error_log('new done: ' . $ori_url . ' from ' . $_SERVER['REQUEST_URI']);
    } else {
        //错误?需要通知相关人等
        put_cache_data($save_name . ERROR_NAME, $return);
        error_log('not done: ' . $ori_url . ' from ' . $_SERVER['REQUEST_URI']);
    }
    return $return;
}
开发者ID:sdgdsffdsfff,项目名称:web-pusher,代码行数:27,代码来源:function-oembed.php


示例6: list_action

 public function list_action()
 {
     if ($_GET['feature_id']) {
         $topic_ids = $this->model('feature')->get_topics_by_feature_id($_GET['feature_id']);
     } else {
         $topic_ids = explode(',', $_GET['topic_id']);
     }
     if ($_GET['per_page']) {
         $per_page = intval($_GET['per_page']);
     } else {
         $per_page = get_setting('contents_per_page');
     }
     if ($_GET['sort_type'] == 'hot') {
         $posts_list = $this->model('posts')->get_hot_posts($_GET['post_type'], $_GET['category'], $topic_ids, $_GET['day'], $_GET['page'], $per_page);
     } else {
         $posts_list = $this->model('posts')->get_posts_list($_GET['post_type'], $_GET['page'], $per_page, $_GET['sort_type'], $topic_ids, $_GET['category'], $_GET['answer_count'], $_GET['day'], $_GET['is_recommend']);
     }
     if (!is_mobile() and $posts_list) {
         foreach ($posts_list as $key => $val) {
             if ($val['answer_count']) {
                 $posts_list[$key]['answer_users'] = $this->model('question')->get_answer_users_by_question_id($val['question_id'], 2, $val['published_uid']);
             }
         }
     }
     TPL::assign('posts_list', $posts_list);
     if (is_mobile()) {
         TPL::output('m/ajax/explore_list');
     } else {
         TPL::output('explore/ajax/list');
     }
 }
开发者ID:Gradven,项目名称:what3.1.7,代码行数:31,代码来源:ajax.php


示例7: 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


示例8: sendErrorImage

function sendErrorImage($message)
{
    /* get all of the required data from the HTTP request */
    $document_root = $_SERVER['DOCUMENT_ROOT'];
    $requested_uri = parse_url(urldecode($_SERVER['REQUEST_URI']), PHP_URL_PATH);
    $requested_file = basename($requested_uri);
    $source_file = $document_root . $requested_uri;
    if (!is_mobile()) {
        $is_mobile = "FALSE";
    } else {
        $is_mobile = "TRUE";
    }
    $im = ImageCreateTrueColor(800, 300);
    $text_color = ImageColorAllocate($im, 233, 14, 91);
    $message_color = ImageColorAllocate($im, 91, 112, 233);
    ImageString($im, 5, 5, 5, "Adaptive Images encountered a problem:", $text_color);
    ImageString($im, 3, 5, 25, $message, $message_color);
    ImageString($im, 5, 5, 85, "Potentially useful information:", $text_color);
    ImageString($im, 3, 5, 105, "DOCUMENT ROOT IS: {$document_root}", $text_color);
    ImageString($im, 3, 5, 125, "REQUESTED URI WAS: {$requested_uri}", $text_color);
    ImageString($im, 3, 5, 145, "REQUESTED FILE WAS: {$requested_file}", $text_color);
    ImageString($im, 3, 5, 165, "SOURCE FILE IS: {$source_file}", $text_color);
    ImageString($im, 3, 5, 185, "DEVICE IS MOBILE? {$is_mobile}", $text_color);
    header("Cache-Control: no-store");
    header('Expires: ' . gmdate('D, d M Y H:i:s', time() - 1000) . ' GMT');
    header('Content-Type: image/jpeg');
    ImageJpeg($im);
    ImageDestroy($im);
    exit;
}
开发者ID:vishalishere,项目名称:accessyoutube,代码行数:30,代码来源:adaptive-images.php


示例9: getMethod

 public function getMethod($address, $total)
 {
     $this->load->language('extension/payment/qrcode_wxpay');
     $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int) $this->config->get('qrcode_wxpay_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('qrcode_wxpay_total') > $total) {
         $status = false;
     } elseif (!$this->config->get('qrcode_wxpay_geo_zone_id')) {
         $status = true;
     } elseif ($query->num_rows) {
         $status = true;
     } else {
         $status = false;
     }
     //只在PC端显示
     $this->load->helper('mobile');
     if (is_mobile()) {
         $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' => 'qrcode_wxpay', 'title' => $this->language->get('text_title'), 'terms' => '', 'sort_order' => $this->config->get('qrcode_wxpay_sort_order'));
     }
     return $method_data;
 }
开发者ID:brunoxu,项目名称:mycncart,代码行数:28,代码来源:qrcode_wxpay.php


示例10: index

 /**
  * 淘宝跳转
  */
 public function index()
 {
     $id = I('id', '', 'trim');
     $iid = I('iid', '', 'number_int');
     $date = I('date');
     $dt = '1';
     if ($date) {
         $dt = '2';
     }
     $tpl = 'index';
     if ($id) {
         if (!intval($id)) {
             exit('input error');
         }
         if (strlen($id) > 9) {
             $item = $this->_mod->where(array('num_iid' => $id))->find();
         } else {
             $item = $this->_mod->where(array('id' => $id))->find();
         }
         if (!$item) {
             $item['num_iid'] = $id;
         }
     }
     if ($iid) {
         if (!intval($iid)) {
             exit('input error');
         }
         $this->_mod = M('items');
         $item = $this->_mod->where(array('num_iid' => $iid))->find();
         if (!$item) {
             $item['num_iid'] = $iid;
         }
     }
     if (C('ftx_click_ai')) {
         $tpl = 'taobao';
         if (!is_mobile()) {
             if ($item['click_url'] && 0 < strpos($item['click_url'], "s.click")) {
                 $this->jump_hidden_referer($item['click_url']);
             } else {
                 if (0 < strpos($item['click_url'], "redirect.simba.taobao.com")) {
                     $this->jump_hidden_referer($item['click_url']);
                 }
             }
         }
     }
     if ($item['shop_type'] == "D") {
         $this->jump_hidden_referer($item['click_url']);
     }
     $taodianjin = C('ftx_taojindian_html');
     if (strpos($taodianjin, 'text/javascript')) {
         $pid = get_word($taodianjin, 'pid: "', '"');
     } else {
         $pid = $taodianjin;
     }
     $this->assign('pid', $pid);
     $this->assign('date', $dt);
     $this->assign('item', $item);
     $this->display($tpl);
 }
开发者ID:lzstg,项目名称:guangchangwu_web,代码行数:62,代码来源:jumpAction.class.php


示例11: cls

 public function cls()
 {
     echo "开发中。。。";
     if ($this->Config["wap"] && is_mobile()) {
         $tmp = THEME_PATH . "wap/Index_index.html";
     }
     $this->display($tmp);
 }
开发者ID:anywn3773,项目名称:gzsrex,代码行数:8,代码来源:ShareAction.class.php


示例12: _empty

 public function _empty()
 {
     if ($this->Config["wap"] && is_mobile()) {
         /*开启手机访问*/
         $tmp = THEME_PATH . "wap/Index_" . ACTION_NAME . ".html";
     }
     $this->display($tmp);
 }
开发者ID:anywn3773,项目名称:gzsrex,代码行数:8,代码来源:IndexAction.class.php


示例13: page_split

function page_split($total_page, $current_page, $base = '', $query_str = '')
{
    global $lan;
    $base = rtrim($base, '/');
    $is_moible = is_mobile();
    $page_string = '';
    $query_str = preg_replace('/page\\=[^&]*(&amp;|&)*/i', '', $query_str);
    if ($query_str != '') {
        $query_str = '&amp;' . $query_str;
    }
    if ($total_page == 1) {
        return '';
    }
    if ($current_page == 2) {
        $page_string = ($is_moible ? '' : '<a href="' . $base . '/"><strong>' . $lan['page_first'] . '</strong></a> ') . '<a href="' . $base . $page_base . '/page_' . ($current_page - 1) . '/" class="_p_p"><strong>' . $lan['page_previous'] . '</strong></a> ';
    } elseif ($current_page > 2) {
        $page_string = ($is_moible ? '' : '<a href="' . $base . '/"><strong>' . $lan['page_first'] . '</strong></a> ') . '<a href="' . $base . $page_base . '/page_' . ($current_page - 1) . '/" class="_p_p"><strong>' . $lan['page_previous'] . '</strong></a> ';
    } else {
        $page_string = ($is_moible ? '' : '<del><strong>' . $lan['page_first'] . '</strong></del> ') . '<del class="_p_p"><strong>' . $lan['page_previous'] . '</strong></del> ';
    }
    if ($current_page > 6) {
        $page_string .= '<a href="' . $base . '/">1</a> ';
        $page_string .= '...';
        for ($i = $current_page - 3; $i <= $current_page - 1; $i++) {
            $page_string .= ' <a href="' . $base . $page_base . '/page_' . $i . '/">' . $i . '</a> ';
        }
        $page_string .= '<b>' . $current_page . '</b> ';
    } else {
        for ($i = 1; $i <= $current_page; $i++) {
            if ($i == $current_page) {
                $page_string .= '<b>' . $current_page . '</b> ';
            } elseif ($i == 1) {
                $page_string .= ' <a href="' . $base . '/">' . $i . '</a> ';
            } else {
                $page_string .= ' <a href="' . $base . $page_base . '/page_' . $i . '/">' . $i . '</a> ';
            }
        }
    }
    if ($total_page - $current_page > 5) {
        for ($i = $current_page + 1; $i <= $current_page + 3; $i++) {
            $page_string .= ' <a href="' . $base . $page_base . '/page_' . $i . '/">' . $i . '</a> ';
        }
        $page_string = $page_string . '...';
        for ($i = $total_page; $i <= $total_page; $i++) {
            $page_string .= ' <a href="' . $base . $page_base . '/page_' . $i . '/">' . $i . '</a> ';
        }
    } else {
        for ($i = $current_page + 1; $i <= $total_page; $i++) {
            $page_string .= ' <a href="' . $base . $page_base . '/page_' . $i . '/">' . $i . '</a> ';
        }
    }
    if ($current_page < $total_page) {
        $page_string .= '<a href="' . $base . $page_base . '/page_' . ($current_page + 1) . '/" class="_p_n"><strong>' . $lan['page_next'] . '</strong></a>' . ($is_moible ? '' : ' <a href="' . $base . $page_base . '/page_' . $total_page . '/"><strong>' . $lan['page_last'] . '</strong></a>');
    } else {
        $page_string .= '<del class="_p_n"><strong>' . $lan['page_next'] . '</strong></del>' . ($is_moible ? '' : ' <del><strong>' . $lan['page_last'] . '</strong></del>');
    }
    return $page_string;
}
开发者ID:duanshuyong0,项目名称:Murloc,代码行数:58,代码来源:functions.php


示例14: fix_links

function fix_links($html)
{
    if (isset($_GET["print"]) || is_mobile()) {
        $patterns = array('/<a href=([\'"])#!?\\/(api\\/[^-\'"]+)-([^\'"]+)/' => '<a href=$1?print=/$2#$3', '/<a href=([\'"])#!?\\//' => '<a href=$1?print=/');
        return preg_replace(array_keys($patterns), array_values($patterns), $html);
    } else {
        return $html;
    }
}
开发者ID:nelinger,项目名称:jsduck,代码行数:9,代码来源:index.php


示例15: _empty

 public function _empty()
 {
     if ($this->Config["wap"] && is_mobile()) {
         /*开启手机访问*/
     } else {
         $tmp = TMPL_PATH . 'User/' . C('DEFAULT_THEME') . "/" . MODULE_NAME . '_' . ACTION_NAME . ".html";
     }
     $this->display($tmp);
 }
开发者ID:anywn3773,项目名称:gzsrex,代码行数:9,代码来源:ChoujianAction.class.php


示例16: index_square_action

 public function index_square_action()
 {
     if (is_mobile()) {
         HTTP::redirect('/m/people/');
     }
     if (!$_GET['page']) {
         $_GET['page'] = 1;
     }
     $this->crumb(AWS_APP::lang()->_t('用户列表'), '/people/');
     if ($_GET['topic_id']) {
         if ($helpful_users = $this->model('topic')->get_helpful_users_by_topic_ids($this->model('topic')->get_child_topic_ids($_GET['topic_id']), get_setting('contents_per_page'), 4)) {
             foreach ($helpful_users as $key => $val) {
                 $users_list[$key] = $val['user_info'];
                 $users_list[$key]['experience'] = $val['experience'];
                 foreach ($val['experience'] as $exp_key => $exp_val) {
                     $users_list[$key]['total_agree_count'] += $exp_val['agree_count'];
                 }
             }
         }
     } else {
         $where = array();
         if ($_GET['group_id']) {
             $where[] = 'group_id = ' . intval($_GET['group_id']);
         }
         $users_list = $this->model('account')->get_users_list(implode('', $where), calc_page_limit($_GET['page'], get_setting('contents_per_page')), true, false, 'reputation DESC');
         $where[] = 'forbidden = 0 AND group_id <> 3';
         TPL::assign('pagination', AWS_APP::pagination()->initialize(array('base_url' => get_js_url('/people/group_id-' . $_GET['group_id']), 'total_rows' => $this->model('account')->get_user_count(implode(' AND ', $where)), 'per_page' => get_setting('contents_per_page')))->create_links());
     }
     if ($users_list) {
         foreach ($users_list as $key => $val) {
             if ($val['reputation']) {
                 $reputation_users_ids[] = $val['uid'];
                 $users_reputations[$val['uid']] = $val['reputation'];
             }
             $uids[] = $val['uid'];
         }
         if (!$_GET['topic_id']) {
             $reputation_topics = $this->model('people')->get_users_reputation_topic($reputation_users_ids, $users_reputations, 5);
             foreach ($users_list as $key => $val) {
                 $users_list[$key]['reputation_topics'] = $reputation_topics[$val['uid']];
             }
         }
         if ($uids and $this->user_id) {
             $users_follow_check = $this->model('follow')->users_follow_check($this->user_id, $uids);
         }
         foreach ($users_list as $key => $val) {
             $users_list[$key]['focus'] = $users_follow_check[$val['uid']];
         }
         TPL::assign('users_list', array_values($users_list));
     }
     if (!$_GET['group_id']) {
         TPL::assign('parent_topics', $this->model('topic')->get_parent_topics());
     }
     TPL::assign('custom_group', $this->model('account')->get_user_group_list(0, 1));
     TPL::output('people/square');
 }
开发者ID:wenyinos,项目名称:wecenter,代码行数:56,代码来源:main.php


示例17: search_result_action

 public function search_result_action()
 {
     if (!in_array($_GET['search_type'], array('questions', 'topics', 'users', 'articles'))) {
         $_GET['search_type'] = null;
     }
     $search_result = $this->model('search')->search(cjk_substr($_GET['q'], 0, 64), $_GET['search_type'], $_GET['page'], get_setting('contents_per_page'), null, $_GET['is_recommend']);
     if ($search_result) {
         foreach ($search_result as $key => $val) {
             switch ($val['type']) {
                 case 'questions':
                     $search_result_questions[] = $this->model('question')->get_question_info_by_id($val['search_id']);
                     break;
                 case 'topics':
                     $search_result_topics[] = $this->model('topic')->get_topic_by_id($val['search_id']);
                     break;
                 case 'users':
                     $search_result_users[] = $this->model('account')->get_user_info_by_uid($val['search_id']);
                     break;
                 default:
                     $search_result_articles[] = $this->model('article')->get_article_info_by_id($val['search_id']);
             }
         }
     }
     // 问题缩略图
     foreach ($search_result_questions as $key => $value) {
         if ($value['has_attach']) {
             $value['attachs'] = $this->model('publish')->get_attach('question', $value['question_id'], 'min');
         }
         $search_result_questions[$key] = $value;
     }
     // 专题关注
     foreach ($search_result_topics as $key => $value) {
         $search_result_topics[$key]['has_focus'] = $this->model('topic')->has_focus_topic($this->user_id, $value['topic_id']);
     }
     // 文章缩略图
     foreach ($search_result_articles as $key => $value) {
         if ($value['has_attach']) {
             $value['attachs'] = $this->model('publish')->get_attach('article', $value['id'], 'min');
         }
         $search_result_articles[$key] = $value;
     }
     // 用户关注
     foreach ($search_result_users as $key => $value) {
         $search_result_users[$key]['follow_check'] = $this->model('follow')->user_follow_check($this->user_id, $value['uid']);
     }
     TPL::assign('search_result_questions', $search_result_questions);
     TPL::assign('search_result_users', $search_result_users);
     TPL::assign('search_result_topics', $search_result_topics);
     TPL::assign('search_result_articles', $search_result_articles);
     TPL::assign('search_result', $search_result);
     if (is_mobile()) {
         TPL::output('m/ajax/search_result');
     } else {
         TPL::output('search/ajax/search_result');
     }
 }
开发者ID:egogg,项目名称:wecenter-dev,代码行数:56,代码来源:ajax.php


示例18: setup

 public function setup()
 {
     if (is_mobile() and !$_GET['ignore_ua_check']) {
         switch ($_GET['app']) {
             default:
                 HTTP::redirect('/m/');
                 break;
         }
     }
 }
开发者ID:Vizards,项目名称:HeavenSpree,代码行数:10,代码来源:main.php


示例19: register

 public function register()
 {
     $op = ggp('op');
     if ($op == 'do') {
         $where_checkreg['ctime'] = array('between', array(NOW_TIME - 24 * 60 * 60, NOW_TIME));
         $where_checkreg['ip'] = $_SERVER['REMOTE_ADDR'];
         $num = M('member')->where($where_checkreg)->count();
         if ($num > 10) {
             $this->error("注册过于频繁,请稍后重试");
         }
         $uname = ggp('uname:t2');
         $password = ggp('password:t2');
         $password2 = ggp('password2:t2');
         $email = ggp('email:t2');
         $mobile = ggp('mobile:t2');
         $openid = ggp('openid:t2');
         !$uname && $this->myError('请正确填写用户名');
         !$password && $this->myError('请正确填写密码');
         $password2 != $password && $this->myError('两次填写密码不一致');
         if (!$email || !is_email($email)) {
             $this->myError('请正确填写邮箱');
         }
         if (!$mobile || !is_mobile($mobile)) {
             $this->myError('请正确填写手机号');
         }
         $user = D('Member')->getUserByUname($uname);
         $user && $this->myError('用户已存在,请换个用户名');
         $fromUid = base64_decode(cookie('shareFrom'));
         $uid = M('member')->add(array('uname' => $uname, 'password' => md5($password), 'openid' => $openid, 'email' => $email, 'mobile' => $mobile, 'ctime' => TIME));
         $member = M('member')->find($uid);
         if ($fromUid > 0) {
             $shareuser['uid'] = intval($fromUid);
             $score_share = intval($this->setting['score_share']);
             if (!$score_share) {
                 $where_exists['setting_key'] = "score_share";
                 $is_exists = M('setting')->where($where_exists)->find();
                 if (!$is_exists) {
                     $data['setting_key'] = "score_share";
                     $data['setting_val'] = "0";
                     M('setting')->add($data);
                 }
             }
             if ($score_share) {
                 $user = M('member')->find($shareuser['uid']);
                 M('jf_log')->add(array('uid' => $shareuser['uid'], 'uname' => $user['uname'], 'jf_goods_jf' => $score_share, 'ctime' => TIME, 'beizhu' => "“{$member['uname']}”通过您的推广链接注册成功"));
                 M('member')->where($shareuser)->setInc('jifen', $score_share);
             }
         }
         $this->_login($member);
     }
     $this->a('openid', ggp('openid:t2'));
     $this->a('nickname', ggp('nickname:t2'));
     $this->display();
 }
开发者ID:huping112004,项目名称:taobaoke,代码行数:54,代码来源:MemberAction.class.php


示例20: _user_mobile

 private function _user_mobile($data)
 {
     $check_mobile = is_mobile($data['mobile']);
     if (!$check_mobile['status']) {
         $this->json_response(false, null, '手机不可用');
     }
     $user = $this->auth_nuan->create_user($data['username'], 'mobile', $data['mobile'], $data['password'], array('device_id' => @$data['device_id'], 'device' => @$data['device']));
     if ($user) {
         $this->json_response(true, array_merge($user, $this->auth_nuan->get_error_message()), '注册成功');
     }
     $this->json_response(false);
 }
开发者ID:lwl1989,项目名称:paintmore,代码行数:12,代码来源:Register.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_mobile_request函数代码示例发布时间:2022-05-15
下一篇:
PHP is_mnet_remote_user函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap