<?php
if (!defined('IN_PHPMPS'))
{
    die('Access Denied');
}
//定义错误级别
define('DEBUG', 1);
if(DEBUG) {
	error_reporting(E_ERROR | E_WARNING | E_PARSE);
} else {
	error_reporting(0);
}
/* 取得根目录 */
define('PHPMPS_ROOT', str_replace('m/include/common.inc.php', '', str_replace('\\', '/', __FILE__)));
require PHPMPS_ROOT . 'data/config.php';
require PHPMPS_ROOT . 'include/global.fun.php';
require PHPMPS_ROOT . 'include/table.php';
require PHPMPS_ROOT . 'm/include/wap.fun.php';
@set_magic_quotes_runtime(0);
@ini_set('session.auto_start', 0);
session_start();
header('Content-type: text/html; charset=utf-8');
//转义处理客户端提交的数据
if(!get_magic_quotes_gpc())
{
	if (!empty($_GET))$_GET  = addslashes_deep($_GET);
    if (!empty($_POST))$_POST = addslashes_deep($_POST);
    $_COOKIE   = addslashes_deep($_COOKIE);
    $_REQUEST  = addslashes_deep($_REQUEST);
}
if(function_exists('date_default_timezone_set')){
    date_default_timezone_set('Asia/Shanghai');
}
$CFG['rewrite'] = false;
if($CFG['closesystem'])die($CFG['close_tips']);
if(!$CFG['wap'])die('系统未开启wap功能！');
define('PHPMPS_PATH', $CFG['weburl'].'/');//网址
if (!$_COOKIE['cityname']) {
  $CFG['citysid'] = explode("_", $CFG['citysid']);
  setcookie("cityid",  $CFG['citysid'][0], time() + 3600 * 24 * 15);
  setcookie("cityname",  $CFG['citysid'][1], time() + 3600 * 24 * 15);
}
$_userid = 0;
$_username = '';
if($_COOKIE['userid'])
{
	$user_info = $db->getrow("select * from {$table}member where userid='$_COOKIE[userid]' ");
	if($user_info) {
		$_userid = $user_info['userid'];
		$_username = $user_info['username'];
	}
}
require PHPMPS_ROOT . 'm/include/header.php';
$areaid_sql = !empty($_COOKIE['cityid']) ? 'and areaid='.$_COOKIE['cityid'] : ''; 
?>