Exemplo n.º 1
0
 private function _init_env()
 {
     error_reporting(E_ERROR);
     define('MAGIC_QUOTES_GPC', function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc());
     // ' " \ NULL 等字符转义 当magic_quotes_gpc=On的时候,函数get_magic_quotes_gpc()就会返回1
     define('GZIP', function_exists('ob_gzhandler'));
     // ob 缓存压缩输出
     if (function_exists('date_default_timezone_set')) {
         @date_default_timezone_set('Etc/GMT-8');
         //东八区 北京时间
     }
     define('TIMESTAMP', time());
     if (!defined('BLOG_FUNCTION') && !@(include BLOG_ROOT . '/source/functions.php')) {
         exit('functions.php is missing');
     }
     define('IS_ROBOT', checkrobot());
     global $_B;
     $_B = array('uid' => 0, 'username' => '', 'groupid' => 0, 'timestamp' => TIMESTAMP, 'clientip' => $this->_get_client_ip(), 'mobile' => '', 'agent' => '', 'admin' => 0);
     checkmobile();
     $_B['PHP_SELF'] = bhtmlspecialchars($this->_get_script_url());
     $_B['basefilename'] = basename($_B['PHP_SELF']);
     $sitepath = substr($_B['PHP_SELF'], 0, strrpos($_B['PHP_SELF'], '/'));
     $_B['siteurl'] = bhtmlspecialchars('http://' . $_SERVER['HTTP_HOST'] . $sitepath . '/');
     getReferer();
     $url = parse_url($_B['siteurl']);
     $_B['siteroot'] = isset($url['path']) ? $url['path'] : '';
     $_B['siteport'] = empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == '80' ? '' : ':' . $_SERVER['SERVER_PORT'];
     $this->b =& $_B;
 }
Exemplo n.º 2
0
 function index()
 {
     ////面包屑导航
     //        $data['headpagemenu']=array(
     //            0=>array('name'=>'后台','link'=>"admin.php"),
     //            1=>array('name'=>'网站概况','link'=>""),
     //        );
     //        $data['headpagetitle']="网站概况";
     ////左侧菜单
     //        $data['menumod']="index";
     $product_tech = $this->config->item("product_tech");
     $res = array();
     foreach ($product_tech[4] as $key => $row) {
         $list = fetch_array("select p.* from " . dbtable("product_tech") . " t," . dbtable("product") . " p where t.pid=p.id and t.type='{$key}'");
         $res[$key] = $list;
     }
     $data["list"] = $res;
     if (checkmobile()) {
         $this->load->view('mobile/safety', $data);
     } else {
         $data['tech_type'] = "4";
         $data['type_id'] = "4_1";
         $this->load->view('safety', $data);
     }
 }
Exemplo n.º 3
0
 function index()
 {
     ////面包屑导航
     //        $data['headpagemenu']=array(
     //            0=>array('name'=>'后台','link'=>"admin.php"),
     //            1=>array('name'=>'网站概况','link'=>""),
     //        );
     //        $data['headpagetitle']="网站概况";
     ////左侧菜单
     //        $data['menumod']="index";
     if (checkmobile()) {
         $this->load->view('mobile/slblinchina');
     } else {
         $this->load->view('branch');
     }
 }
Exemplo n.º 4
0
 public function createOrder($options)
 {
     //检测手机号码格式
     $chkmobile = checkmobile($options['mobile']);
     if ($chkmobile !== 0) {
         return $chkmobile;
     }
     //var_dump($options);
     $userinfo = D('Member')->certificate($options['key']);
     if (!is_array($userinfo)) {
         return $userinfo;
     }
     //20002
     $orderModel = M('51_orders');
     //填充订单数据  status - 0: 进行中,1:已结束,2:已取消, 999:已删除
     $orderdata['orderid'] = get_order_sn();
     //订单号
     $orderdata['uid'] = $userinfo['uid'];
     $orderdata['status'] = 0;
     $orderdata['options'] = array2string($options);
     print_r(string2array($orderdata['options']));
     $result = $orderModel->create($orderdata);
 }
Exemplo n.º 5
0
                        showtype('', 'bottom');
                        echo '<br /><center><input type="submit" class="button" name="regsubmit" value="' . $lang['submit'] . '" onclick="this.form.target=\'register\';"><iframe name="register" style="display: none"></iframe> &nbsp; <input type="button" class="button" value="' . $lang['cancel'] . '" onclick="window.location=\'admincp.php?action=insenz\'"></center></form>
						<script type="text/javascript" src="./include/javascript/insenz_reg.js"></script>';
                    } else {
                        $username = checkusername($username);
                        $password = checkpassword($password, $password2);
                        $name = checkname($name);
                        $idcard = checkidcard($idcard);
                        $email1 = checkemail($email1, 'email1');
                        $email2 = $email2 ? checkemail($email2, 'email2') : '';
                        $qq = checkqq($qq);
                        $msn = $msn ? checkemail($msn, 'msn') : '';
                        $tel3 = $tel3 != $lang['insenz_register_extension'] ? intval($tel3) : '';
                        $tel = checktel($tel1, $tel2, $tel3, 'tel');
                        $fax = $fax2 ? checktel($fax1, $fax2, $fax3, 'fax') : '';
                        $mobile = checkmobile($mobile);
                        $cpc = checkcpc($country, $province, $city);
                        $country = $cpc[0];
                        $province = $cpc[1];
                        $city = $cpc[2];
                        $address = checkaddress($address);
                        $postcode = checkpostcode($postcode);
                        $alipay = checkemail($alipay, $lang['insenz_register_alipay']);
                        $response = insenz_request('<cmd id="checkHandle"><handle>' . $username . '</handle></cmd>');
                        if ($response['status']) {
                            insenz_alert($response['data']);
                        } else {
                            $response = $response['data']['response'][0]['data'][0]['VALUE'];
                        }
                        if ($response == 'handle_exists') {
                            insenz_alert('insenz_usernameexists', 'username');
Exemplo n.º 6
0
<?php

//视图文件夹
//判断流览器类型,checkmobile 返回为真,则是手机浏览器;今后如开发 app 客户端,则还应加入一个客户端的识别;
if (checkmobile()) {
    define('VIEW', 'themes' . DS . 'mob');
} else {
    define('VIEW', 'themes');
}
//数据库服务器名
define('HOST', 'localhost');
//数据库用户名
define('HOST_USER', 'root');
//数据表
define('HOST_TAB', 'union');
//数据库密码
define('HOST_PASS', 'danlp0928');
//用户目录
define('US', 'user');
//用户目录分支
$usdir = array('img', 'doc', 'muisc', 'log');
define('BIGNUM', '999989999');
//全局最大的数据库记录个数,超过这个,将扩容//
//商品类型
$prod_type = array(1 => "女装", 2 => "男装", 3 => "美食", 4 => "数码", 5 => "新奇特", 6 => "预定");
//商品预定(待定)
//$prod_buynow = array(1=>"预定",2=>"发售");
//会员注册、登陆类型
$user_type = array(1 => "超级分享家", 2 => "设计师", 3 => "制造商", 4 => "审核员", 5 => "管理员", 6 => "卖家", 7 => "超级管理");
//商品状态
$prod_zhuantai = array(1 => "待审核", 2 => "通过", 3 => "不通过");
Exemplo n.º 7
0
}
if ($DB->query("select * from wjob_config where id='1'") == FALSE) {
    header('Content-type:text/html;charset=utf-8');
    echo '<div class="row">你还没安装!<a href="install/">点此安装</a></div>';
    exit;
}
$conf = $DB->get_row("SELECT * FROM wjob_config WHERE id='1' limit 1");
//获取系统配置
include_once ROOT . "includes/signapi.php";
include_once ROOT . "includes/function.php";
include_once ROOT . "includes/qq.func.php";
//界面样式
if ((!checkpc() || !file_exists(ROOT . 'template/index.html')) && $mod == 'home') {
    $mod = 'index';
}
if (checkmobile() == true) {
    $theme = isset($_COOKIE["uachar"]) ? $_COOKIE["uachar"] : 'mobile';
}
if (!isset($theme)) {
    $theme = isset($_COOKIE["uachar"]) ? $_COOKIE["uachar"] : 'default';
}
if ($mod == 'head') {
    $theme = 'mobile';
}
if ($conf['css2'] == 0) {
    $theme = 'mobile';
}
define('TEMPLATE_ROOT', ROOT . '/template/' . $theme . '/');
define('PUBLIC_ROOT', ROOT . '/template/public/');
if ($conf['version'] <= '5040') {
    header('Content-type:text/html;charset=utf-8');
Exemplo n.º 8
0
 /**
  * 找回密码手机号验证
  * @param string $pmobile
  */
 public function check_forget_mobile_validate($pmobile = '')
 {
     $mobile = !empty($pmobile) ? $pmobile : $this->input->post('mobile', true);
     if (empty($mobile)) {
         $response = array('result' => false, 'tip_type' => 'mobile', 'msg' => $this->lang->line('mobile_empty'));
         exit(json_encode($response));
     } else {
         if (!checkmobile($mobile)) {
             $response = array('result' => false, 'tip_type' => 'mobile', 'msg' => $this->lang->line('mobile_error'));
             exit(json_encode($response));
         } else {
             $user = $this->member->get_user(array('mobile', 'mobilestatus'), array('mobile' => $mobile));
             if (empty($user)) {
                 $response = array('result' => false, 'tip_type' => 'mobile', 'msg' => $this->lang->line('mobile_dismatch'));
                 exit(json_encode($response));
             } else {
                 !$user['mobilestatus'] && exit(json_encode(array('result' => false, 'tip_type' => 'mobile', 'msg' => $this->lang->line('mobile_noactivate'))));
                 if (!empty($pmobile)) {
                     return;
                 } else {
                     $response = array('result' => true, 'tip_type' => 'mobile', 'msg' => '');
                     exit(json_encode($response));
                 }
             }
         }
     }
 }
Exemplo n.º 9
0
</table>
<?php 
if ($totalRows_news != 0) {
    ?>
<table>
 <tr>
  <td class="dataHeadingList">Date</td>
  <td class="dataHeadingList">Headline</td>
  <td class="dataHeadingList">Text</td>
  <td class="dataHeadingList">Posted By</td>
  <?php 
    if ($row_user['userLevel'] == "1") {
        ?>
  <td class="dataHeadingList">&nbsp;</td>
  <td class="dataHeadingList"><?php 
        if (!checkmobile()) {
            ?>
<div id="helpInline"><a href="includes/admin_icons.inc.php?dbTable=<?php 
            echo $dbTable;
            ?>
&KeepThis=true&TB_iframe=true&height=450&width=800" title="Administration Icon Reference" class="thickbox"><img src="<?php 
            echo $imageSrc;
            ?>
information.png" align="absmiddle" border="0" alt="Admin Icon Reference" title="Administration Icon Reference"></a></div><?php 
        } else {
            echo "&nbsp;";
        }
        ?>
</td>
  <?php 
    }
Exemplo n.º 10
0
 function result()
 {
     $section_value = $_POST['section_value'];
     if (empty($section_value)) {
         alert("请选择试题!");
     }
     $re_value = sel_product($section_value);
     $if_value = $re_value['data'];
     if (empty($if_value)) {
         alert("没有找到符合你要求的床垫!");
     }
     $where = "";
     if ($re_value['status'] == "1") {
         $restype = fetch_array("select id from " . dbtable("product_type") . " where upid='2'");
         $type_id = "";
         foreach ($restype as $key => $row) {
             if ($key != 0) {
                 $type_id .= ",";
             }
             $type_id .= "'" . $row['id'] . "'";
         }
         $where .= " p.tid in ({$type_id}) ";
     } else {
         $if_value = $re_value['data'];
         $where .= " p.stitle in ({$if_value})";
     }
     //		$sel_value=explode(",",$section_value);
     //		$pro_name[1]='"经典超级保背健","经典呵背","温度智慧 I 1600","温度智慧 II 1600","皇家皇冠","皇家红宝石"';
     //		$image[1]=array("jdcjbbj.jpg","jdkb.jpg","wdzh1600.jpg","wdzh2600.jpg","hjhg.jpg","hjhbs.jpg");
     //		$pro_name[2]='"经典A-B保背健","经典豪华保背健","温度智慧 I 1200","温度智慧 II 1200","皇家红宝石","帝冠"';
     //		$image[2]=array("jdab.jpg","jdahbbj.jpg","wdzh1200.jpg","wdzh2200.jpg","hjhbs.jpg","dg.jpg");
     //		$pro_name[3]='"经典超级保背健","经典呵背","温度智慧 I 1600","温度智慧 II 1600","皇家金钻石","传家宝"';
     //		$image[3]=array("jdcjbbj.jpg","jdhb.jpg","wdzh1600.jpg","wdzh2600.jpg","hjjzs.jpg","cjb.jpg");
     //		$pro_name[4]='"温度智慧 II 1600","皇家金钻石","传家宝"';
     //		$image[3]=array("wdzh2600.jpg","hjjzs.jpg","cjb.jpg");
     //		$pro_name[5]='"经典薄款保背健","经典保背健","经典A-B保背健","温度智慧 I 1200","温度智慧 II 1200","皇家蓝宝石","皇家绿宝石"';
     //		$image[3]=array("jdpkbbj.jpg","jdbb.jpg","jdab.jpg","wdzh1200.jpg","wdzh2200.jpg","hjlbs.jpg","hjlbs.jpg",);
     ///*
     // * 搜索产品的结果只按第四题目的选择进行产品筛选
     // * 1表示羽毛,2表示棉花,3表示木头,4表示沙滩,5表示草地
     // */
     //		switch($sel_value['3'])
     //		{
     //			case "1":
     //			case "2":
     //			case "3":
     //			case "4":
     //			case "5":
     //				$key=$sel_value[3];
     //			    $res=fetch_array("select p.*,t.tname from ".dbtable("product")." p ,".dbtable("product_type")." t where p.tid=t.id and p.stitle in (".$where.") and p.status=1 order by t.displayorder");
     //				foreach($res as $key=>$row)
     //				{
     //					$pid=$row['id'];
     //					$resimage=fetch_one_array("select imgurl from ".dbtable("product_img")." where pid='".$pid."' and status='1' order by  displayorder limit 1");
     //					$res[$key]['imgurl']=$resimage['imgurl'];
     //				}
     //				$data['res']=$res;
     //			break;
     //		}
     //		$pro_data=array();
     //		$key=0;
     //		for($i=0;$i<count($if_value);$i++)
     //		{
     //			$where ="p.stitle='".$if_value[$i]."'";
     //			$res=fetch_one_array("select p.*,t.tname from ".dbtable("product")." p ,".dbtable("product_type")." t where p.tid=t.id and ".$where." and p.status=1 order by t.displayorder");
     //			if(!empty($res['id']))
     //			{
     //				$pid=$res['id'];
     //				$pro_data[$key]=$res;
     //				$resimage=fetch_one_array("select imgurl from ".dbtable("product_img")." where pid='".$pid."' and status='1' order by  displayorder limit 1");
     //				$pro_data[$key]['imgurl']=$resimage['imgurl'];
     //				$key++;
     //			}
     //		}
     $res = fetch_array("select p.*,t.tname from " . dbtable("product") . " p ," . dbtable("product_type") . " t where p.tid=t.id and (" . $where . ") and p.status=1 order by t.displayorder");
     foreach ($res as $key => $row) {
         $pid = $row['id'];
         $resimage = fetch_one_array("select imgurl from " . dbtable("product_img") . " where pid='" . $pid . "' and status='1' order by  displayorder limit 1");
         $res[$key]['imgurl'] = $resimage['imgurl'];
     }
     $data['res_list'] = $res;
     if (checkmobile()) {
         $this->load->view('mobile/selection_result', $data);
     } else {
         $this->load->view('selection_result', $data);
     }
 }
Exemplo n.º 11
0
function output()
{
    global $_G;
    if (defined('DZZ_OUTPUTED')) {
        return;
    } else {
        define('DZZ_OUTPUTED', 1);
    }
    if ($_G['setting']['ftp']['connid']) {
        @ftp_close($_G['setting']['ftp']['connid']);
    }
    $_G['setting']['ftp'] = array();
    if (defined('CACHE_FILE') && CACHE_FILE && !defined('CACHE_FORBIDDEN') && !defined('IN_MOBILE') && !checkmobile()) {
        if (diskfreespace(DZZ_ROOT . './' . $_G['setting']['cachethreaddir']) > 1000000) {
            if ($fp = @fopen(CACHE_FILE, 'w')) {
                flock($fp, LOCK_EX);
                fwrite($fp, empty($content) ? ob_get_contents() : $content);
            }
            @fclose($fp);
            chmod(CACHE_FILE, 0777);
        }
    }
    if (defined('DZZ_DEBUG') && DZZ_DEBUG && @(include libfile('function/debug'))) {
        function_exists('debugmessage') && debugmessage();
    }
}
Exemplo n.º 12
0
 function aboutus()
 {
     if (checkmobile()) {
         $type = getgpc("type");
         $type = $type ? $type : 1;
         $data['type'] = $type;
         $this->load->view('mobile/introduce', $data);
         // $this->load->view('mobile/aboutus');
     } else {
         $this->load->view('aboutus');
     }
 }
Exemplo n.º 13
0
<?php

header("Content-type: text/html; charset=utf8");
define('IN_TIPASK', TRUE);
define('TIPASK_ROOT', substr(dirname(__FILE__), 0, -4));
// 普通的 http 通知方式
error_reporting(0);
defined('MAGIC_QUOTES_GPC') || define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc());
require_once TIPASK_ROOT . '/lib/global.func.php';
$check_type = trim($_GET['type']);
$check_type = in_array($check_type, array('mobile', 'weixin', 'tel', 'qq')) ? $check_type : 'mobile';
$value = trim($_GET['value']);
if ($check_type == 'mobile') {
    if ($value != "") {
        $result = checkmobile($value);
        if ($result) {
            $return = array('return' => 1);
        } else {
            $return = array('return' => 0, 'comment' => '请输入正确格式的手机号');
        }
    } else {
        $return = array('return' => 0, 'comment' => '请输入正确格式的手机号');
    }
} elseif ($check_type == 'qq') {
    if ($value != "") {
        $result = isQQ($value);
        if ($result) {
            $return = array('return' => 1);
        } else {
            $return = array('return' => 0, 'comment' => '请输入正确格式的QQ号');
        }
Exemplo n.º 14
0
 static function _init_mobile()
 {
     global $_G;
     if ($_G[setting][qq_zone_url]) {
         $host = str_replace(array('http://', '/'), '', $_G[setting][qq_zone_url]);
         if ($host == $_G[host]) {
             $_G[qq_zone] = 1;
         }
     }
     $mobile = checkmobile();
     //手台设定的,手机版强制跳转到某个网站
     if ($_G['mobile'] && $_G['setting']['mobile_jump']) {
         $url1 = parse_url($_G['siteurl']);
         $url2 = parse_url($_G['setting']['mobile_jump']);
         if ($url1 !== false && $url2 !== false && $url1['host'] != $url2['host']) {
             _header("Location:" . $_G['setting']['mobile_jump']);
         }
     }
     if ($_G[setting][mobile_status] == 0) {
         $_G['mobile'] = false;
         return false;
     }
     if (isset($_GET['mobile'])) {
         if ($_GET['mobile'] == 'no') {
             //强制pc版
             $mobile = false;
             dsetcookie('nomobile', 1, 86400 * 3);
         } else {
             if ($_GET['mobile'] == 'yes') {
                 //强制是手机版
                 dsetcookie('nomobile', 2, 86400 * 3);
                 $mobile = true;
             }
         }
     }
     $is_mobile = getcookie('nomobile');
     if ($is_mobile == 1) {
         $mobile = false;
     } else {
         if ($is_mobile == 2) {
             $mobile = true;
         }
     }
     $_G['mobile'] = $mobile;
     define('MOBILE', $mobile);
     define('PAD', $_G['pad']);
 }
Exemplo n.º 15
0
 function onsuggest()
 {
     $question_type = "suggest";
     $question_type_list = $this->ask_config->getQuestionType();
     $title = "服务中心-我要" . $question_type_list[$question_type];
     $all_num = $_ENV['question']->total_question();
     $qtypeId = isset($this->get[2]) ? intval($this->get[2]) : (isset($this->post['qtypeId']) ? intval($this->post['qtypeId']) : 0);
     $loginName = $this->ask_front_name;
     $allQtype = $_ENV['qtype']->GetAllQType(1, "", 0);
     if (!isset($allQtype[$qtypeId])) {
         header("Location: http://sc.5173.com/index.php?question/ask_skip.html");
     }
     $subList = $_ENV['qtype']->GetSubList($qtypeId);
     if (!empty($subList)) {
         header("Location: http://sc.5173.com/index.php?question/subList/suggest/{$qtypeId}.html");
     }
     $qtypeName = $allQtype[$qtypeId];
     $operatorInfo = '';
     // 获取我的专属客服
     if ($this->ask_front_name == '游客') {
         $selfAuthor_where = '';
         // 获取专属客服条件
     } else {
         $t_cid = $_ENV['question']->getType(3);
         $operatorInfo = $_ENV['operator']->getMySelfAuthor($this->ask_front_name);
         $selfAuthor_where = $_ENV['question']->front_selfAuthor_where($operatorInfo['login_name'], '', 1, $t_cid);
     }
     if ($selfAuthor_where) {
         $selfAuthorNum = $_ENV['question']->front_mySelfAuthorNum($selfAuthor_where);
     } else {
         $selfAuthorNum = 0;
     }
     $url = '';
     if ($qtypeName['pid'] > 0) {
         $url = '<a href="http://sc.5173.com/index.php?question/subList/suggest/' . $qtypeName['pid'] . '.html">选择' . $allQtype[$qtypeName['pid']]['name'] . '类' . $question_type_list[$question_type] . '</a>&nbsp;&nbsp;&gt;&nbsp;&nbsp';
     }
     //未登陆跳转地址
     $login_url = "http://" . config::FRONT_LOGIN_DOMAIN . "/?returnUrl=" . urlencode(curPageURL());
     $display_yzm = false;
     if ($this->ask_front_name != '游客') {
         $contact = $this->cache->get(md5('SJ' . $this->ask_front_id));
         if (false === $contact) {
             $contact = get_mobile($this->ask_front_id);
             if (!empty($contact)) {
                 $this->cache->set(md5('SJ' . $this->ask_front_id), $contact, 1800);
             }
             //缓存30分钟
         }
         if (!empty($contact)) {
             $en_contact = substr_replace($contact, '****', 3, 4);
         }
     }
     $suggest_title = isset($this->post['title']) ? htmlspecialchars(trim($this->post['title'])) : '';
     $description = isset($this->post['description']) && $this->post['description'] != "我们非常重视您的" . $question_type_list[$question_type] . ",请在这里告诉我们" ? htmlspecialchars(trim($this->post['description'])) : '';
     $contact_num = isset($this->post['contact_num']) ? htmlspecialchars($this->post['contact_num']) : (isset($en_contact) ? $en_contact : '');
     $J_code = isset($this->post['J_code']) ? strtolower(htmlspecialchars($this->post['J_code'])) : '';
     if ($this->ask_front_name == '游客') {
         $author = isset($this->post['author']) && $this->post['author'] != '请输入5173用户名' ? trim($this->post['author']) : '';
         $author_id = '';
     } else {
         $author_id = $this->ask_front_id;
         $author = $this->ask_front_name;
     }
     $t_yzm = tcookie('yzm');
     if (empty($t_yzm)) {
         tcookie('yzm', time(), 1800);
         //存放半个小时
     } else {
         $over_time = time() - $t_yzm;
         //距离现在的秒数
         if ($over_time < 1800) {
             $display_yzm = true;
         } else {
             tcookie('yzm', '', time() - 3600);
             //删除
         }
     }
     if ($this->ask_front_name != '游客') {
         $display_yzm = false;
     }
     //登陆用户不显示验证码
     if (isset($this->post['contact'])) {
         $comment['contact'] = $this->post['contact'];
     } else {
         $comment['contact']['mobile'] = isset($en_contact) ? $en_contact : '';
     }
     $flag = 0;
     if (isset($this->post['act'])) {
         if (isset($this->post['contact'])) {
             $comment['contact'] = $this->post['contact'];
             if ($comment['contact']['mobile'] != "") {
                 if (isset($en_contact) && $comment['contact']['mobile'] == $en_contact) {
                     $comment['contact']['mobile'] = $contact;
                 }
                 if (!checkmobile($comment['contact']['mobile'])) {
                     $errorMsg['mobile'] = '手机号';
                     unset($comment['contact']['mobile']);
                 } else {
                     $flag++;
                 }
             } else {
                 $errorMsg['mobile'] = '手机号';
                 unset($comment['contact']['mobile']);
             }
             if ($comment['contact']['qq'] != "") {
                 if (!isQQ($comment['contact']['qq'])) {
                     //$errorMsg['qq'] = 'QQ号';
                     unset($comment['contact']['qq']);
                 } else {
                     //$flag++;
                 }
             } else {
                 //$errorMsg['qq'] = 'QQ号';
                 unset($comment['contact']['qq']);
             }
             if ($comment['contact']['weixin'] != '') {
                 if (strlen($comment['contact']['weixin']) > 20 || strlen($comment['contact']['weixin']) < 4 || trim($comment['contact']['weixin']) == "微信号") {
                     //$errorMsg['weixin'] = '微信号';
                     unset($comment['contact']['weixin']);
                 } else {
                     //$flag++;
                 }
             } else {
                 //$errorMsg['weixin'] = '微信号';
                 unset($comment['contact']['weixin']);
             }
         }
         if ($flag == 0 && count($errorMsg) > 0) {
             $error = implode("、", $errorMsg) . "未填写或格式不正确";
             $comment['contact'] = $this->post['contact'];
             @(include template('suggest'));
             echo "<script>alert('" . $error . "');</script>";
             exit;
         }
         if ($description == '') {
             $comment['contact'] = $this->post['contact'];
             @(include template('suggest'));
             echo "<script>alert('建议内容不能为空。');</script>";
             exit;
         } elseif (mb_strlen($description, 'UTF-8') > 500 || mb_strlen($description, 'UTF-8') < 5) {
             $comment['contact'] = $this->post['contact'];
             @(include template('suggest'));
             echo "<script>alert('建议内容请保持在5-500个字内。');</script>";
             exit;
         }
         if ($this->ask_front_name == '游客') {
             if ($author == "" || mb_strlen($author, 'UTF-8') > 20) {
                 @(include template('suggest'));
                 echo "<script>alert('请输正确格式的5173登陆用户名');</script>";
                 exit;
             }
             if ($J_code == "" || $J_code != $_SESSION['code']) {
                 $comment['contact'] = $this->post['contact'];
                 @(include template('suggest'));
                 echo "<script>alert('验证码不正确!');</script>";
                 exit;
             }
         }
         //提问数限制
         $limit_question_num = intval($this->setting['limit_question_num']);
         if (!empty($limit_question_num)) {
             $comment['contact'] = $this->post['contact'];
             $num_ip = $_ENV['question']->get_num_by_ip(getip());
             if ($num_ip >= $limit_question_num) {
                 @(include template('suggest'));
                 echo "<script>alert('您的操作太频繁啦,让服务器休息一下,稍后再进行建议!');</script>";
                 exit;
             }
         }
         //IP黑名单
         $BlackList = explode("|", $this->setting['IpBlackList']);
         if (in_array(getip(), $BlackList)) {
             $comment['contact'] = $this->post['contact'];
             @(include template('suggest'));
             echo "<script>alert('您的操作太频繁啦,让服务器休息一下,稍后再建议!');</script>";
             exit;
         }
         if ($this->ask_front_name != '游客') {
             //登录提问
             $GagLog = $_ENV['user']->getGag($this->ask_front_name);
             if (count($GagLog) > 0) {
                 $comment['contact'] = $this->post['contact'];
                 @(include template('suggest'));
                 echo "<script>alert('很抱歉,您的帐号已被管理员禁言处理,请您自觉遵守5173言论规则。');</script>";
                 exit;
             }
         }
         $description = cutstr(strip_tags($description), 500, '');
         if (md5(trim(strip_tags($description))) == $_COOKIE['last_suggest']) {
             @(include template('suggest'));
             echo "<script>alert('亲,问题提交一次就OK,不用重复提交哦!');</script>";
             exit;
         }
         $img_path = $this->post['imgpath'];
         $img_path = stripcslashes($img_path);
         $img_path = str_replace('"small_pic"', ',"small_pic"', $img_path);
         $img_path = str_replace('"big_pic"', ',"big_pic"', $img_path);
         $p1 = strpos($img_path, "big_pic");
         $path = substr($img_path, $p1 + 10, strlen($img_path) - $p1 - 10 - 2);
         $path = str_replace('\\/', '/', $path);
         $attach = trim($path);
         if (isset($en_contact) && $comment['contact']['mobile'] == $en_contact) {
             $comment['contact']['mobile'] = $contact;
         }
         $cid = $_ENV['question']->getType(2);
         //建议分类id
         $cid = !empty($cid) ? intval($cid) : 0;
         $cid1Info = $_ENV['category']->getByQType($qtypeId, $cid);
         //qtype对应分类id
         $cid1 = intval($cid1Info['id']);
         $time = time();
         $trimDescription = preg_replace('/\\s+/', '', $description);
         $description = $this->keyWordCheck($trimDescription);
         $BrowerInfo = userBrowerInfo();
         $comment['OS'] = $BrowerInfo['OS'];
         $comment['Browser'] = $BrowerInfo['Browser'];
         $questionInfo = array("qtype" => $qtypeId, "author" => $author, "author_id" => $author_id, "title" => $suggest_title, "description" => $description, "attach" => $attach, "time" => $time, "ip" => getip(), "cid" => $cid, "cid1" => $cid1, "comment" => serialize($comment));
         $question_id = $_ENV['question']->insertQuestion($questionInfo);
         //更新Solr服务器
         $q_search = array();
         if ($question_id > 0) {
             setcookie('last_suggest', md5(trim(strip_tags($description))), time() + 3600);
             if ($this->ask_front_name == '游客') {
                 get_que_id('jy', $question_id);
                 //建议id写入cookie
             }
             $date = date("Y-m-d");
             $_ENV['question']->modifyUserQtypeNum($date, $qtypeId, 'suggest', 1);
             $login_name = trim($this->post['login_name']);
             if (!empty($login_name)) {
                 if ($this->setting['selfServiceFirst'] == 1) {
                     $Apply = $_ENV['question']->ApplyToOperator($question_id, $login_name);
                 }
             }
             $q_search['id'] = $question_id;
             $q_search['title'] = $description;
             $q_search['description'] = $description;
             $q_search['tag'] = json_encode(array(), true);
             $q_search['time'] = $time;
             $q_search['atime'] = 0;
             try {
                 $this->set_search($q_search);
             } catch (Exception $e) {
                 send_AIC('http://sc.5173.com/index.php?question/suggest.html', '搜索服务器异常', 1, '搜索接口');
             }
         }
         header("Location: " . url('question/suggest_success/' . $question_id . '/' . $time, true));
     }
     $telDisplay = $this->setting['telDisplay'];
     $xnDisplay = $this->setting['xnDisplay'];
     $qqDisplay = $this->setting['qqDisplay'];
     $_ENV['question']->PageView(1, getip());
     @(include template('suggest'));
 }
Exemplo n.º 16
0
 function index()
 {
     ////面包屑导航
     //        $data['headpagemenu']=array(
     //            0=>array('name'=>'后台','link'=>"admin.php"),
     //            1=>array('name'=>'网站概况','link'=>""),
     //        );
     //        $data['headpagetitle']="网站概况";
     ////左侧菜单
     //        $data['menumod']="index";
     $cid = getgpc("cid");
     $pid = getgpc("pid");
     //分页
     $per_page = getgpc("per_page");
     $per_page = $per_page ? $per_page : 0;
     $pnum = 6;
     $provinceList = getProvinceList();
     $data["provinceList"] = $provinceList;
     $data['tishi_sign'] = "0";
     if (checkmobile()) {
         $this->load->view('mobile/shop', $data);
     } else {
         /*
          * PC端数据取
          */
         if (!$cid) {
             $ip = convertip();
             if (strstr($ip["addr"], "市")) {
                 $city_t = explode("市", $ip["addr"]);
                 if (strstr($city_t[0], "省")) {
                     $city_t = explode("省", $city_t[0]);
                     $province = $city_t[0];
                     $city = $city_t[1];
                     $whereif = " (province like '%" . $province . "%') ";
                 } else {
                     $city = $city_t[0];
                     $province = $city_t[0];
                     $whereif = " (province like '%" . $province . "%') ";
                 }
             } else {
                 $city = "上海";
                 $province = "上海";
                 $whereif = " level>=4 ";
             }
             if (!$pid) {
                 $count = fetch_one_array("select count(*) as num from " . dbtable("shop") . " where " . $whereif . " and status=1");
                 if ($count['num'] > 0) {
                     $list = fetch_array("select * from " . dbtable("shop") . " where " . $whereif . " and status=1 order by  id asc ");
                     // $list=fetch_array("select * from ".dbtable("shop")." where (city like '%".$city."%' or province like '%".$city."%') and status=1 order by  id asc  limit $per_page,$pnum ");
                 } else {
                     $data['tishi_sign'] = "1";
                     $data['tishi_data'] = "您所在的省份暂无门店<br>为您推荐以下门店!";
                     $count = fetch_one_array("select count(*) as num from " . dbtable("shop") . " where (province like '%" . $province . "%') and status=1 limit 6");
                     $list = fetch_array("select * from " . dbtable("shop") . " where (province like '%" . $province . "%') and status=1 order by  id asc  limit 6 ");
                 }
             } else {
                 $count = fetch_one_array("select count(*) as num from " . dbtable("shop") . " where  pid='" . $pid . "' and status=1 ");
                 if ($count['num'] > 0) {
                     $list = fetch_array("select * from " . dbtable("shop") . " where pid='" . $pid . "' and status=1 order by id desc limit {$per_page},{$pnum} ");
                 } else {
                     // $count["num"]=6;
                     $data['tishi_sign'] = "1";
                     $data['tishi_data'] = "您所在的省份暂无门店<br>为您推荐以下门店!";
                     $list = fetch_array("select * from " . dbtable("shop") . " where level>=4 and status=1 order by id desc limit 5 ");
                 }
             }
             // $count=fetch_one_array("select count(*) as num from ".dbtable("shop")." where (city like '%".$city."%' or province like '%".$city."%') and status=1");
             //	            if($count['num']>0)
             //	            {
             //		            $list=fetch_array("select * from ".dbtable("shop")." where (province like '%".$province."%') and status=1 order by  id asc ");
             //		            // $list=fetch_array("select * from ".dbtable("shop")." where (city like '%".$city."%' or province like '%".$city."%') and status=1 order by  id asc  limit $per_page,$pnum ");
             //	            }else{
             //					$data['tishi_sign']="1";
             //					$data['tishi_data']="您所在的省份暂无门店,请选择其它省份进行查询!";
             //		            $count=fetch_one_array("select count(*) as num from ".dbtable("shop")." where (province like '%".$province."%') and status=1 limit 6");
             //		            $list=fetch_array("select * from ".dbtable("shop")." where (province like '%".$province."%') and status=1 order by  id asc  limit 6 ");
             //	            }
             // $list=fetch_array("select * from ".dbtable("shop")." where (province like '%".$province."%') and status=1 order by  id asc  limit $per_page,$pnum ");
         } else {
             $count = fetch_one_array("select count(*) as num from " . dbtable("shop") . " where  cid='" . $cid . "' and status=1 ");
             if ($count['num'] > 0) {
                 $list = fetch_array("select * from " . dbtable("shop") . " where cid='" . $cid . "' and status=1 order by id desc limit {$per_page},{$pnum} ");
             } else {
                 // $count["num"]=6;
                 $data['tishi_sign'] = "1";
                 $data['tishi_data'] = "您选择的区域暂无门店<br>为您推荐以下门店!";
                 $count = fetch_one_array("select count(*) as num from " . dbtable("shop") . " where  pid='" . $pid . "' and level>=4 and status=1 limit 5 ");
                 if ($count['num'] > 0) {
                     $list = fetch_array("select * from " . dbtable("shop") . " where pid='" . $pid . "' and level>=4 and status=1 order by id desc limit 5 ");
                 } else {
                     $count = fetch_one_array("select count(*) as num from " . dbtable("shop") . " where  pid='" . $pid . "' and status=1 ");
                     if ($count['num'] > 0) {
                         $list = fetch_array("select * from " . dbtable("shop") . " where pid='" . $pid . "' and status=1 order by id desc");
                     } else {
                         $count = fetch_one_array("select count(*) as num from " . dbtable("shop") . " where  level>=4 and status=1 limit 5");
                         $list = fetch_array("select * from " . dbtable("shop") . " where level>=4 and status=1 order by id desc limit 5 ");
                     }
                 }
                 // $list=fetch_array("select * from ".dbtable("shop")." where pid='".$pid."' and status=1 order by id desc limit 6 ");
             }
         }
         $data['res'] = $list;
         $this->load->library('pagination');
         $config['base_url'] = 'index.php?c=shop&pid=' . $pid . "&cid=" . $cid;
         $config['total_rows'] = $count["num"];
         $config['per_page'] = $pnum;
         $config['first_link'] = FALSE;
         $config['last_link'] = FALSE;
         $config['per_page'] = $pnum;
         $this->pagination->initialize($config);
         $data["page"] = $this->pagination->create_links();
         if (!$pid || !$cid) {
             $pid = $list[0]["pid"];
             // $cid= $list[0]["cid"];
         }
         $data["pid"] = $pid;
         $data["cid"] = $cid;
         $this->load->view('shop', $data);
     }
 }
Exemplo n.º 17
0
 private function _init_mobile()
 {
     if (!$this->init_mobile) {
         return false;
     }
     if (!$this->var['setting'] || !$this->var['setting']['mobile']['allowmobile'] || !is_array($this->var['setting']['mobile']) || IS_ROBOT) {
         $nomobile = true;
         $unallowmobile = true;
     }
     $mobile = getgpc('mobile');
     $mobileflag = isset($this->var['mobiletpl'][$mobile]);
     if ($mobile === 'no') {
         dsetcookie('mobile', 'no', 3600);
         $nomobile = true;
     } elseif ($this->var['cookie']['mobile'] == 'no' && $mobileflag) {
         checkmobile();
         dsetcookie('mobile', '');
     } elseif ($this->var['cookie']['mobile'] == 'no') {
         $nomobile = true;
     } elseif (!($mobile_ = checkmobile())) {
         $nomobile = true;
     }
     if (!$mobile || $mobile == 'yes') {
         $mobile = isset($mobile_) ? $mobile_ : 2;
     }
     if (!$this->var['mobile'] && !$unallowmobile) {
         if ($mobileflag) {
             //dheader("Location:misc.php?mod=mobile");
         }
     }
     if ($nomobile || !$this->var['setting']['mobile']['mobileforward'] && !$mobileflag) {
         if ($_SERVER['HTTP_HOST'] == $this->var['setting']['domain']['app']['mobile'] && $this->var['setting']['domain']['app']['default']) {
             dheader("Location:http://" . $this->var['setting']['domain']['app']['default'] . $_SERVER['REQUEST_URI']);
             return false;
         } else {
             return false;
         }
     }
     if (strpos($this->var['setting']['domain']['defaultindex'], CURSCRIPT) !== false && CURSCRIPT != 'forum' && !$_GET['mod']) {
         if ($this->var['setting']['domain']['app']['mobile']) {
             $mobileurl = 'http://' . $this->var['setting']['domain']['app']['mobile'];
         } else {
             if ($this->var['setting']['domain']['app']['forum']) {
                 $mobileurl = 'http://' . $this->var['setting']['domain']['app']['forum'] . '?mobile=yes';
             } else {
                 $mobileurl = $this->var['siteurl'] . 'forum.php?mobile=yes';
             }
         }
         dheader("location:{$mobileurl}");
     }
     if ($mobile === '3' && empty($this->var['setting']['mobile']['wml'])) {
         return false;
     }
     define('IN_MOBILE', isset($this->var['mobiletpl'][$mobile]) ? $mobile : '2');
     setglobal('gzipcompress', 0);
     $arr = array();
     foreach (array_keys($this->var['mobiletpl']) as $mobiletype) {
         $arr[] = '&mobile=' . $mobiletype;
         $arr[] = 'mobile=' . $mobiletype;
     }
     $arr = array_merge(array(strstr($_SERVER['QUERY_STRING'], '&simpletype'), strstr($_SERVER['QUERY_STRING'], 'simpletype')), $arr);
     $query_sting_tmp = str_replace($arr, '', $_SERVER['QUERY_STRING']);
     $this->var['setting']['mobile']['nomobileurl'] = ($this->var['setting']['domain']['app']['forum'] ? 'http://' . $this->var['setting']['domain']['app']['forum'] . '/' : $this->var['siteurl']) . $this->var['basefilename'] . ($query_sting_tmp ? '?' . $query_sting_tmp . '&' : '?') . 'mobile=no';
     $this->var['setting']['lazyload'] = 0;
     if ('utf-8' != CHARSET) {
         if (strtolower($_SERVER['REQUEST_METHOD']) === 'post') {
             foreach ($_POST as $pk => $pv) {
                 if (!is_numeric($pv)) {
                     $_GET[$pk] = $_POST[$pk] = $this->mobile_iconv_recurrence($pv);
                     if (!empty($this->var['config']['input']['compatible'])) {
                         $this->var['gp_' . $pk] = daddslashes($_GET[$pk]);
                     }
                 }
             }
         }
     }
     if (!$this->var['setting']['mobile']['mobilesimpletype']) {
         $this->var['setting']['imagemaxwidth'] = 224;
     }
     $this->var['setting']['regstatus'] = $this->var['setting']['mobile']['mobileregister'] ? $this->var['setting']['regstatus'] : 0;
     $this->var['setting']['thumbquality'] = 50;
     $this->var['setting']['avatarmethod'] = 0;
     $this->var['setting']['mobile']['simpletypeurl'] = array();
     $this->var['setting']['mobile']['simpletypeurl'][0] = $this->var['siteurl'] . $this->var['basefilename'] . ($query_sting_tmp ? '?' . $query_sting_tmp . '&' : '?') . 'mobile=1&simpletype=no';
     $this->var['setting']['mobile']['simpletypeurl'][1] = $this->var['siteurl'] . $this->var['basefilename'] . ($query_sting_tmp ? '?' . $query_sting_tmp . '&' : '?') . 'mobile=1&simpletype=yes';
     $this->var['setting']['mobile']['simpletypeurl'][2] = $this->var['siteurl'] . $this->var['basefilename'] . ($query_sting_tmp ? '?' . $query_sting_tmp . '&' : '?') . 'mobile=2';
     unset($query_sting_tmp);
     ob_start();
 }
Exemplo n.º 18
0
                            $useragents[$i]['description'] = $description;
                            $useragents[$i]['useragent'] = $useragent;
                            $i++;
                        }
                    }
                }
                $tree[] = $node;
                break;
            case XMLReader::TEXT:
            case XMLReader::CDATA:
                $tree .= $xml->value;
        }
    }
    return $tree;
}
$xml = new XMLReader();
#$xml->open('useragentswitcher.xml');
$xml->open('useragentswitchertest.xml');
$assoc = xml2assoc($xml, "root");
$xml->close();
// $arr=($assoc[0]['value'][0]['value']);
//print_r($useragents);
foreach ($useragents as $arr) {
    if ($arr['useragent'] != '') {
        #		checkmobile($arr['useragent'],$arr['description'],"DEVICEDETECT");
        checkmobile($arr['useragent'], $arr['description'], "MOBILEDETECT");
    }
}
?>
 
Exemplo n.º 19
0
 function _init_mobile()
 {
     if (!$this->var['setting'] || !$this->init_mobile || !$this->var['setting']['mobile']['allowmobile'] || !is_array($this->var['setting']['mobile']) || IS_ROBOT) {
         $nomobile = true;
         $unallowmobile = true;
     }
     if ($_GET['mobile'] === 'no') {
         dsetcookie('mobile', 'no', 3600);
         $nomobile = true;
     } elseif ($this->var['cookie']['mobile'] == 'no' && $_GET['mobile'] === 'yes') {
         dsetcookie('mobile', '');
     } elseif ($this->var['cookie']['mobile'] == 'no') {
         $nomobile = true;
     }
     if (!checkmobile()) {
         $nomobile = true;
     }
     if ($this->var['setting']['mobile']['mobilepreview'] && !$this->var['mobile'] && !$unallowmobile) {
         if ($_GET['mobile'] === 'yes') {
             dheader("Location:misc.php?mod=mobile");
         }
     }
     if ($nomobile || !$this->var['setting']['mobile']['mobileforward'] && $_GET['mobile'] !== 'yes') {
         if ($_SERVER['HTTP_HOST'] == $this->var['setting']['domain']['app']['mobile'] && $this->var['setting']['domain']['app']['default']) {
             dheader("Location:http://" . $this->var['setting']['domain']['app']['default'] . $_SERVER['REQUEST_URI']);
         } else {
             return;
         }
     }
     if (strpos($this->var['setting']['domain']['defaultindex'], CURSCRIPT) !== false && CURSCRIPT != 'forum' && !$_GET['mod']) {
         if ($this->var['setting']['domain']['app']['mobile']) {
             $mobileurl = 'http://' . $this->var['setting']['domain']['app']['mobile'];
         } else {
             if ($this->var['setting']['domain']['app']['forum']) {
                 $mobileurl = 'http://' . $this->var['setting']['domain']['app']['forum'] . '?mobile=yes';
             } else {
                 $mobileurl = $this->var['siteurl'] . 'forum.php?mobile=yes';
             }
         }
         dheader("location:{$mobileurl}");
     }
     define('IN_MOBILE', true);
     setglobal('gzipcompress', 0);
     $arr = array(strstr($_SERVER['QUERY_STRING'], '&simpletype'), strstr($_SERVER['QUERY_STRING'], 'simpletype'), '&mobile=yes', 'mobile=yes');
     $query_sting_tmp = str_replace($arr, '', $_SERVER['QUERY_STRING']);
     $this->var['setting']['mobile']['nomobileurl'] = ($this->var['setting']['domain']['app']['forum'] ? 'http://' . $this->var['setting']['domain']['app']['forum'] . '/' : $this->var['siteurl']) . $this->var['basefilename'] . ($query_sting_tmp ? '?' . $query_sting_tmp . '&' : '?') . 'mobile=no';
     $this->var['setting']['lazyload'] = 0;
     if ('utf-8' != CHARSET) {
         if (strtolower($_SERVER['REQUEST_METHOD']) === 'post') {
             foreach ($_POST as $pk => $pv) {
                 if (!is_numeric($pv)) {
                     $this->var['gp_' . $pk] = $_GET[$pk] = $_POST[$pk] = $this->mobile_iconv_recurrence($pv);
                 }
             }
         }
     }
     if ($_GET['simpletype']) {
         if ($_GET['simpletype'] == 'yes') {
             $this->var['setting']['mobile']['mobilesimpletype'] = 1;
             dsetcookie('simpletype', 1, 86400);
         } else {
             $this->var['setting']['mobile']['mobilesimpletype'] = 0;
             dsetcookie('simpletype', 0, 86400);
         }
     } elseif ($this->var['cookie']['simpletype']) {
         $this->var['setting']['mobile']['mobilesimpletype'] = $this->var['cookie']['simpletype'] == 1 ? 1 : 0;
     }
     if (!$this->var['setting']['mobile']['mobilesimpletype']) {
         $this->var['setting']['imagemaxwidth'] = 224;
     }
     $this->var['setting']['regstatus'] = $this->var['setting']['mobile']['mobileregister'] ? $this->var['setting']['regstatus'] : 0;
     if (!$this->var['setting']['mobile']['mobileseccode']) {
         $this->var['setting']['seccodestatus'] = 0;
     }
     $this->var['setting']['seccodedata']['type'] = 99;
     $this->var['setting']['thumbquality'] = 50;
     $this->var['setting']['mobile']['simpletypeurl'] = array();
     $this->var['setting']['mobile']['simpletypeurl'][0] = $this->var['siteurl'] . $this->var['basefilename'] . ($query_sting_tmp ? '?' . $query_sting_tmp . '&' : '?') . 'mobile=yes&simpletype=no';
     $this->var['setting']['mobile']['simpletypeurl'][1] = $this->var['siteurl'] . $this->var['basefilename'] . ($query_sting_tmp ? '?' . $query_sting_tmp . '&' : '?') . 'mobile=yes&simpletype=yes';
     unset($query_sting_tmp);
     ob_start();
 }
Exemplo n.º 20
0
 /**
  * 发送短信验证码
  */
 public function send_sms()
 {
     $mobile = $this->input->get_post('mobile', true);
     $source = $this->input->get_post('source', true);
     if (empty($mobile) || !checkmobile($mobile)) {
         $this->echo_api(-1, '你输入的手机号不对,请重新输入.');
     }
     $this->sendsms($mobile, $source);
 }
Exemplo n.º 21
0
function output()
{
    global $_G;
    if (defined('DISCUZ_OUTPUTED')) {
        return;
    } else {
        define('DISCUZ_OUTPUTED', 1);
    }
    if (!empty($_G['blockupdate'])) {
        block_updatecache($_G['blockupdate']['bid']);
    }
    if (defined('IN_MOBILE')) {
        mobileoutput();
    }
    if (!defined('IN_MOBILE') && !defined('IN_ARCHIVER')) {
        $tipsService = Cloud::loadClass('Service_DiscuzTips');
        $tipsService->show();
    }
    $havedomain = implode('', $_G['setting']['domain']['app']);
    if ($_G['setting']['rewritestatus'] || !empty($havedomain)) {
        $content = ob_get_contents();
        $content = output_replace($content);
        ob_end_clean();
        $_G['gzipcompress'] ? ob_start('ob_gzhandler') : ob_start();
        echo $content;
    }
    if ($_G['setting']['ftp']['connid']) {
        @ftp_close($_G['setting']['ftp']['connid']);
    }
    $_G['setting']['ftp'] = array();
    if (defined('CACHE_FILE') && CACHE_FILE && !defined('CACHE_FORBIDDEN') && !defined('IN_MOBILE') && !checkmobile()) {
        if (diskfreespace(DISCUZ_ROOT . './' . $_G['setting']['cachethreaddir']) > 1000000) {
            if ($fp = @fopen(CACHE_FILE, 'w')) {
                flock($fp, LOCK_EX);
                fwrite($fp, empty($content) ? ob_get_contents() : $content);
            }
            @fclose($fp);
            chmod(CACHE_FILE, 0777);
        }
    }
    if (defined('DISCUZ_DEBUG') && DISCUZ_DEBUG && @(include libfile('function/debug'))) {
        function_exists('debugmessage') && debugmessage();
    }
}
Exemplo n.º 22
0
 /**
  * 发送短信验证码
  * @param string $mobile
  * @param string $source
  */
 public function sendsms($mobile, $source)
 {
     empty($mobile) && $this->echo_api(-11, "手机号码为空.");
     if (!checkmobile($mobile)) {
         $this->echo_api(-12, "手机号码为空.");
     } else {
         $sms_source = array('signup_mobile', 'mlostpwd', 'sign', 'mobilemodify_set', 'mobilereset_set', 'mobileunbind_set', 'mobilebind');
         if (empty($source) || !in_array($source, $sms_source)) {
             //来源不对
             $this->echo_api(-13, "手机号码为空.");
         }
         $this->load->model('space/member_db', 'member_m');
         $smslog = $this->member_m->get_sms_log($mobile, $source);
         $sms_max_count = $source == 'signup_mobile' ? 3 : 10;
         if (!empty($smslog)) {
             if ($smslog['count'] >= $sms_max_count) {
                 //超过每天该类型下最大的发送次数
                 $this->echo_api(-14, "手机号码为空.");
             } elseif (time() - $smslog['sendtime'] <= 60) {
                 //60s内只能发送一次
                 $this->echo_api(-15, "手机号码为空.");
             } else {
                 //发送短信验证码
                 $sms = random(5, 1);
                 $content = '(' . $sms . ')' . '赛酷用户验证码';
                 if (sendSMS(array($mobile), $content)) {
                     if (date('Y-m-d', time()) == date('Y-m-d', $smslog['sendtime'])) {
                         //同一天:更新次数及发送时间
                         $result = $this->member_m->update_sms_log(array('sms' => $sms, 'sendtime' => time()), array('mobile' => $mobile, 'source' => $source));
                     } else {
                         //不在同一天,统计次数归零
                         $result = $this->member_m->update_sms_log(array('sms' => $sms, 'sendtime' => time()), array('mobile' => $mobile, 'source' => $source), true);
                     }
                     if ($result) {
                         $msg = sprintf($this->lang->line('sms_send_success'), $sms_max_count - $smslog['count'] - 1);
                         $this->echo_api(1, array('tip_type' => 'sms', 'msg' => $msg));
                     } else {
                         $this->echo_api(-16, "手机号码为空.");
                     }
                 } else {
                     $this->echo_api(-17, "手机号码为空.");
                 }
             }
         } else {
             //发送短信验证码
             $sms = random(5, 1);
             $content = '(' . $sms . ')' . '赛酷用户验证码';
             if (sendSMS(array($mobile), $content)) {
                 $result = $this->member_m->add_sms_log(array('mobile' => $mobile, 'sms' => $sms, 'source' => $source, 'count' => 1, 'sendtime' => time()));
                 if ($result) {
                     $msg = sprintf($this->lang->line('sms_send_success'), $sms_max_count - 1);
                     $this->echo_api(2, array('tip_type' => 'sms', 'msg' => $msg));
                 } else {
                     $this->echo_api(-18, "手机号码为空.");
                 }
             } else {
                 $this->echo_api(-19, "手机号码为空.");
             }
         }
     }
 }
Exemplo n.º 23
0
 /**
  * 检测用户名是否已存在
  * @param $user
  * @return int
  */
 public function exist($user)
 {
     $chkmobile = checkmobile($user);
     if ($chkmobile !== 0) {
         return $chkmobile;
     }
     $usertable = M('51_user');
     $exist = $usertable->where("mobile='{$user}'")->count();
     return $exist > 0 ? 20005 : 20004;
 }
Exemplo n.º 24
0
 function prolist()
 {
     $id = getGP('id');
     $res = fetch_one_array("select p.*,t.tname,t.upid from " . dbtable("product") . " p ," . dbtable("product_type") . " t where p.tid=t.id and p.id='{$id}' and p.status=1 ");
     //读取所有的床垫的TID
     $mattessTid_t = fetch_array("select id from " . dbtable("product_type") . " where id='2' or upid='2'");
     foreach ($mattessTid_t as $row) {
         $mattessTid[] = $row["id"];
     }
     $hardness = $res['hardness'] * 20 - 10;
     $hardness = $hardness < 0 ? 10 : $hardness;
     $data['hardness'] = $hardness;
     $data['res'] = $res;
     $resimage = fetch_array("select * from " . dbtable("product_img") . " where pid='" . $id . "' and status=1 and status='1'");
     $data['resimage'] = $resimage;
     $resptrait = fetch_array("select * from " . dbtable("product_ptrait") . " where pid='" . $id . "'   and status=1 order by  displayorder");
     $data['resptrait'] = $resptrait;
     $ptraitlist = array();
     foreach ($resptrait as $row) {
         $title = $row['title'];
         $ptraitlist[$title] = $row;
     }
     $data['ptraitlist'] = $ptraitlist;
     $tid = $res['tid'];
     $respro_query = $this->db->select('imgurl,title,id,entitle,stitle')->from('web_product')->where("`tid` = '{$tid}' and `id` != '{$id}'")->get();
     $respro = $respro_query->result_array();
     $respro = fetch_array("select * from " . dbtable("product") . " where tid='" . $res['tid'] . "' and status='1' and id not in ({$id}) order by  id");
     foreach ($respro as $key => $row) {
         $pid = $row['id'];
         $resimage = fetch_one_array("select imgurl from " . dbtable("product_img") . " where pid='" . $pid . "' and status='1' order by  displayorder limit 1");
         $respro[$key]['imgurl'] = $resimage['imgurl'];
     }
     $data['prodata'] = $respro;
     $data["mattessTid"] = $mattessTid;
     if (checkmobile()) {
         $indexpushres = fetch_array("select * from " . dbtable("indexpush_type") . "");
         $index_data = array();
         foreach ($indexpushres as $row) {
             $tid = $row['id'];
             $pushres = fetch_array("select * from " . dbtable("indexpush") . " where tid='" . $tid . "' and status='1' and type='2' order by istop desc ,displayorder ");
             $index_data[$tid] = $pushres;
         }
         $data['index_data'] = $index_data;
         $this->load->view('mobile/product_detail', $data);
     } else {
         $indexpushres = fetch_array("select * from " . dbtable("indexpush_type") . "");
         $index_data = array();
         foreach ($indexpushres as $row) {
             $tid = $row['id'];
             $pushres = fetch_array("select * from " . dbtable("indexpush") . " where tid='" . $tid . "' and status='1' and type='1' order by istop desc ,displayorder ");
             $index_data[$tid] = $pushres;
         }
         $data['index_data'] = $index_data;
         //产品类别
         $query_prod_type = $this->db->select('tname,id,upid,displayorder')->from('web_product_type')->order_by('displayorder', 'asc')->get();
         $query_prod = $this->db->select('id,tid,stitle,entitle')->from('web_product')->get();
         $prod_types = $query_prod_type->result_array();
         $prods = $query_prod->result_array();
         foreach ($prod_types as $key => $value) {
             foreach ($prods as $k => $v) {
                 if ($v['tid'] == $value['id']) {
                     $prod_types[$key]['child_1'][] = $prods[$k];
                 }
             }
         }
         $prod_type_list = tree($prod_types, 'upid', 'id');
         $prod_type_list = get_menu($prod_type_list, 'upid', 'id');
         $data['prod_types'] = $prod_type_list;
         $this->load->view('product', $data);
     }
 }