예제 #1
0
파일: index.php 프로젝트: macall/baikec_jsd
$request_param['m_latitude']= es_session::get("m_latitude");
$request_param['m_longitude']= es_session::get("m_longitude");
*/
define("FOLDER_NAME", "");
define('TMPL_NAME', 'fanwe');
//define("IS_DEBUG",true);
require '../system/common.php';
require '../system/system_init.php';
require './lib/page.php';
require './lib/functions.php';
require './lib/transport.php';
require './lib/template.php';
define('AS_LOG_DIR', APP_ROOT_PATH . 'wap/log/');
define('AS_DEBUG', true);
require './lib/logUtils.php';
if (es_cookie::is_set("is_pc")) {
    es_cookie::delete("is_pc");
}
$transport = new transport();
$transport->use_curl = true;
//调用模板引擎
//require_once  APP_ROOT_PATH.'system/template/template.php';
if (!file_exists(APP_ROOT_PATH . 'public/runtime/wap/')) {
    mkdir(APP_ROOT_PATH . 'public/runtime/wap/', 0777);
}
if (!file_exists(APP_ROOT_PATH . 'public/runtime/wap/tpl_caches/')) {
    mkdir(APP_ROOT_PATH . 'public/runtime/wap/tpl_caches/', 0777);
}
if (!file_exists(APP_ROOT_PATH . 'public/runtime/wap/tpl_compiled/')) {
    mkdir(APP_ROOT_PATH . 'public/runtime/wap/tpl_compiled/', 0777);
}
예제 #2
0
/**
 * 获取当前团购城市
 */
function get_current_deal_city()
{
    if (es_cookie::is_set("deal_city")) {
        $deal_city_id = es_cookie::get("deal_city");
        $deal_city = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_city where is_effect = 1 and is_delete = 0 and id = " . intval($deal_city_id));
    }
    if (!$deal_city) {
        //设置如存在的IP订位
        if (file_exists(APP_ROOT_PATH . "system/extend/ip.php")) {
            require_once APP_ROOT_PATH . "system/extend/ip.php";
            $ip = get_client_ip();
            $iplocation = new iplocate();
            $address = $iplocation->getaddress($ip);
            foreach ($city_list as $city) {
                if (strpos($address['area1'], $city['name'])) {
                    $deal_city = $city;
                    break;
                }
            }
        }
        if (!$deal_city) {
            $deal_city = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_city where is_default = 1 and is_effect = 1 and is_delete = 0");
        }
    }
    return $deal_city;
}