Exemple #1
0
 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');
     }
 }
Exemple #2
0
 /**
  * 项目运行函数
  */
 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];
 }
Exemple #3
0
 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;
 }
Exemple #4
0
 /**
  * 登录接口
  */
 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()));
 }
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;
}
Exemple #6
0
 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');
     }
 }
Exemple #7
0
 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);
 }
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;
}
Exemple #9
0
 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;
 }
 /**
  * 淘宝跳转
  */
 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);
 }
 public function cls()
 {
     echo "开发中。。。";
     if ($this->Config["wap"] && is_mobile()) {
         $tmp = THEME_PATH . "wap/Index_index.html";
     }
     $this->display($tmp);
 }
 public function _empty()
 {
     if ($this->Config["wap"] && is_mobile()) {
         /*开启手机访问*/
         $tmp = THEME_PATH . "wap/Index_" . ACTION_NAME . ".html";
     }
     $this->display($tmp);
 }
Exemple #13
0
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;
}
Exemple #14
0
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;
    }
}
 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);
 }
Exemple #16
0
 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');
 }
Exemple #17
0
 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');
     }
 }
Exemple #18
0
 public function setup()
 {
     if (is_mobile() and !$_GET['ignore_ua_check']) {
         switch ($_GET['app']) {
             default:
                 HTTP::redirect('/m/');
                 break;
         }
     }
 }
 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();
 }
Exemple #20
0
 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);
 }
Exemple #21
0
 private function _user_mobile($data)
 {
     $check_mobile = is_mobile($data['mobile']);
     if (!$check_mobile['status']) {
         $this->set_response(20303);
     }
     $user = $this->api_auth->create_user($data['username'], 'mobile', $data['mobile'], $data['password'], array('device_id' => @$data['device_id'], 'device' => @$data['device']));
     if ($user) {
         $this->set_response(0, array_merge($user, $this->api_auth->get_error_message()), '注册成功');
     }
     $this->set_response(20305);
 }
 function add_image_placeholders($content)
 {
     // Don't lazyload for feeds, previews, mobile
     if (is_feed() || function_exists('is_mobile') && is_mobile() || isset($_GET['preview'])) {
         return $content;
     }
     // In case you want to change the placeholder image
     $image = apply_filters('lazyload_images_placeholder_image', $this->get_url('/libs/images/1x1.trans.gif'));
     // This is a pretty simple regex, but it works
     $content = preg_replace('#<img([^>]+?)src=#', sprintf('<img${1}src="%s" data-lazy-src=', $image), $content);
     return $content;
 }
function video_container($atts, $content = null)
{
    extract(shortcode_atts(array("id" => "ekK7peRxKGc", 'title' => "Title", 'copy' => "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc fermentum elit in posuere ornare. Cras eget sapien nisi. Sed viverra tristique nunc, vitae sollicitudin lacus mollis ut. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nulla in pretium nibh. Interdum et malesuada fames ac ante ipsum primis in faucibus. In facilisis rutrum urna sed varius. Aliquam gravida dui est, id viverra justo posuere nec.", 'video_link' => "https://youtu.be/ekK7peRxKGc", 'more_link' => "#", 'div_id' => 'video_block'), $atts));
    $amountArray = explode("]", $content);
    $amount = count($amountArray);
    $amount = $amount - 1;
    $amount = $amount . " Videos";
    $output = "";
    $output .= '<section class="video-block" id="' . $div_id . '">';
    $output .= '<div class="amount">' . $amount . '</div><div class="video-container">';
    if (is_mobile()) {
        $output .= "<div style='text-align:center'><strong>Swipe Left or Right</strong></div>";
    }
    $output .= ' <div class="vidNav">
                <div class="vidImages">';
    $output .= do_shortcode($content);
    $output .= '</div>
            </div>';
    $output .= '      
            <div class="vidContainer embed-responsive embed-responsive-16by9">
                <iframe class="embed-responsive-item"src="https://www.youtube.com/embed/' . $id . '?rel=0" frameborder="0" allowfullscreen>></iframe>
            </div>';
    $output .= '
            <div class="contentdcm">
                <h1 class="vidTitle">' . $title . '</h1>
                <div class="copy_content">' . $copy . '</div></div></div></section>';
    $output .= '<script type="text/javascript">
            (function ($) {
                var thumb = $("#' . $div_id . ' .imageVideo a");
                var video = $("#' . $div_id . ' iframe");
                var load = $(".loading");
                var id, title, content, morer, to, links;
                 
                thumb.on("click", function(e){
                    e.preventDefault();
                    thumb.parent().removeClass("on").addClass("off")
                    $(this).parent().removeClass("off").addClass("on");
                     
                    id = $(this).attr("data-src");
                    morer = $(this).attr("href");
                    content = $(this).attr("data-content");
                    title = $(this).attr("alt");
                    
                    $("#' . $div_id . ' h1.vidTitle").html(title);
                    $("#' . $div_id . ' .contentdcm .copy_content").html(content);
                    video.attr("src", "https://www.youtube.com/embed/"+id+"?rel=0");
                   
                })
            }(jQuery));
        </script>';
    return $output;
}
Exemple #24
0
 public function setup()
 {
     if (is_mobile() and !$_GET['ignore_ua_check']) {
         switch ($_GET['app']) {
             default:
                 HTTP::redirect('/m/');
                 break;
         }
     }
     if ($_GET['ignore_ua_check'] == 'TRUE') {
         HTTP::set_cookie('_ignore_ua_check', 'TRUE', time() + 3600 * 24 * 7);
     }
 }
 /**
  * 手机,PC模板自动切换
  */
 public function _initialize()
 {
     //移动设备浏览,则切换模板
     if (is_mobile()) {
         //设置默认默认主题为 Mobile
         C('DEFAULT_THEME', 'Mobile');
     } else {
         //header("content-type:text/html;charset=utf-8");
         //echo "WEB版暂停访问!";
         //exit();
         C('DEFAULT_THEME', 'Default');
     }
 }
Exemple #26
0
 public function modify_action()
 {
     if (is_mobile()) {
         HTTP::redirect('/m/find_password_modify/?key=' . $_GET['key']);
     }
     if (!($active_code_row = $this->model('active')->get_active_code($_GET['key'], 'FIND_PASSWORD'))) {
         H::redirect_msg(AWS_APP::lang()->_t('链接已失效'), '/');
     }
     if ($active_code_row['active_time'] or $active_code_row['active_ip']) {
         H::redirect_msg(AWS_APP::lang()->_t('链接已失效'), '/');
     }
     TPL::output('account/find_password/modify');
 }
 public function index()
 {
     if (cookie('auth')) {
         $this->assign('forward', '');
         $this->assign('jumpUrl', '/index.php?g=User');
         $this->success(L('login_ok'));
     }
     $this->assign('bcid', 0);
     if ($this->Config["wap"] && is_mobile()) {
         /*开启手机访问*/
         $tmp = TMPL_PATH . 'User/' . C('DEFAULT_THEME') . "/wap/" . MODULE_NAME . '_' . ACTION_NAME . ".html";
     }
     $this->display($tmp);
 }
Exemple #28
0
 public function list_action()
 {
     if ($drafts = $this->model('draft')->get_all('answer', $this->user_id, intval($_GET['page']) * $this->per_page . ', ' . $this->per_page)) {
         foreach ($drafts as $key => $val) {
             $drafts[$key]['question_info'] = $this->model("question")->get_question_info_by_id($val['item_id']);
         }
     }
     TPL::assign('drafts', $drafts);
     if (is_mobile()) {
         TPL::output('m/ajax/draft');
     } else {
         TPL::output('draft/ajax/list');
     }
 }
Exemple #29
0
 function __construct($sess = null)
 {
     require __DIR__ . "/../config.php";
     $this->zombie_root = $zombie_root;
     $this->app_root = $app_root;
     $this->web_root = $web_root;
     $this->domain = $domain;
     $this->json = array();
     $this->is_page = false;
     $this->is_mobile = is_mobile($_SERVER['HTTP_USER_AGENT']);
     if ($sess == null) {
         require_once $sess_file;
         $this->session = $sess_class::get_session();
     }
 }
 function index()
 {
     if ($this->_userid) {
         $forward = $_POST['forward'] ? $_POST['forward'] : $this->forward;
         $forward = U("User/Index/index");
         $this->assign('jumpUrl', $forward);
         header("Location: " . $forward);
         //$this->success(L('login_ok'));
         exit;
     }
     if ($this->Config["wap"] && is_mobile()) {
         /*开启手机访问*/
         $tmp = TMPL_PATH . 'User/' . C('DEFAULT_THEME') . "/wap/" . MODULE_NAME . '_' . ACTION_NAME . ".html";
     }
     $this->display($tmp);
 }