<?php

/**
 *      【橙创家校通v4.0】 (C)2010-2012 Tuntron Inc.
 *      
 *    	 http://www.tuntron.com   QQ：1121251729
 *
 *      &核心入口文件&
 */

if (!defined('IS_RUN')) die('Forbidden');

if (substr(PHP_VERSION, 0, 1) != '5')exit("橙创家校通系统运行环境要求PHP5.x以上版本！");

@set_magic_quotes_runtime(0);

if(DEBUG) {
    error_reporting(E_ALL ^ E_NOTICE);
    @ini_set('display_errors', 'On');
} else {
  error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
}

$_G = $_CO = $_CFG = $_HEAD = $_QUERY  = array();

$no_temp=-1;//是否载入模版

//时区设置
if(function_exists('date_default_timezone_set')) {
	// Edit by zhaobin 2012/11/19 10:50 修改中国时区
    //@date_default_timezone_set('Etc/UTC');
    @date_default_timezone_set('PRC');
    $_G['timestamp'] = time() + $_G['timezone'] * 3600;
    //使用和时间相关的函数(例如filemtime，系统已定义自己的函数myfilemtime),需要在获取的时间上加上 filemtime(file) + $_G['timezone'] * 3600;
} else {
    $_G['timestamp'] = time();
}
file_exists(TUNTRON_DAT.'/config.db.php')?require TUNTRON_DAT.'/config.db.php':'';
require TUNTRON_INC.'/function/function.php';

$_G['cookie'] = cookie();
$_CO =& $_G['cookie'];

$mod = _get('mod','login');  //模块加载
$do = _get('do','index');  	 //动作加载
$c = _get('c');  			 //参数专用

//个人头像专用
define('AVATAR_120', file_exists(TUNTRON_DAT."/upload/user/".$_CO['username'].'_'.$_CO['uid']."/".$_CO['username']."_120.jpg")?"/dat/upload/user/".$_CO['username'].'_'.$_CO['uid']."/".$_CO['username']."_120.jpg":"/public/images/f_m_120.gif");
define('AVATAR_48',file_exists(TUNTRON_DAT."/upload/user/".$_CO['username'].'_'.$_CO['uid']."/".$_CO['username']."_48.jpg")?"/dat/upload/user/".$_CO['username'].'_'.$_CO['uid']."/".$_CO['username']."_48.jpg":"/public/images/f_m_48.gif");
define('AVATAR_24', file_exists(TUNTRON_DAT."/upload/user/".$_CO['username'].'_'.$_CO['uid']."/".$_CO['username']."_24.jpg")?"/dat/upload/user/".$_CO['username'].'_'.$_CO['uid']."/".$_CO['username']."_24.jpg":"/public/images/f_m_24.gif");

//

//启动Memcache
if($_CFG['memcache'] && extension_loaded('memcache')){
	$_CMC = new Memcache;    
	$_CMC->connect($_CFG['memcache']['host'], $_CFG['memcache']['port']);
}



header('Content-Type: text/html; charset=UTF-8');

?>