?? index.php
字號:
<?
/**
* Title: The index page
* File Name: ./index.php
* Copyright (c) 2004 M-logger
* Author: milkliker
* Modify: milkliker
* Last Change: 13:36 04-8-5
* Version: 0.3.0
**/
//---[Time Begin]-------------------------------------------
$beginTime = array_sum(split(' ', microtime()));
//---[Require Files]----------------------------------------
require_once("class/Template.inc.php");
require_once("class/TxtDb.inc.php");
require_once("class/UserClass.inc.php");
//---[Basic Set]--------------------------------------------
define('DATADIR','./db');
define('CACHEDIR','./cache');
define('SESSIONDIR','./tmp');
//---[Load Config]------------------------------------------
$configFile='./config.php';
$configCache=CACHEDIR.'/config.cache.php';
getCache($config,$configFile,$configCache);//function getCache() in TxtDb.inc.php
//---[Set Vars]---------------------------------------------
$thisTime=explode("-",date("Y-m-d-H-i-s"));
$thisTime[3]=$thisTime[3]+intval($config['HourOff']);
$thisTime[4]=$thisTime[4]+intval($config['MiniOff']);
$thisTime=mktime($thisTime[3],$thisTime[4],$thisTime[5],$thisTime[1],$thisTime[2],$thisTime[0]);
if($config['GZipOutput']=='y'){
ob_start('ob_gzhandler');
$Info['UseGZip']='Enabled';
}else{
ob_start();
$Info['UseGZip']='Disabled';
}
$Info['UseCache'] = $config['UseCache']=='y' ? 'Enabled' : 'Disabled';
$modName=trim($_GET['a']);
$name=trim($_GET[name]);
$date=trim($_GET[date]);
if(!empty($date)){
$time=explode('-',$date);
$year=$time[0];
$month=$time[1];
$day=$time[2];
}
$time['year']= empty($year) ? date("Y",$thisTime) : $year;
$time['month']= empty($month) ? date("n",$thisTime) : $month;
$time['day']= empty($day) ? date("j",$thisTime) : $day;
$date=$time['year'].'-'.$time['month'].'-'.$time['day'];
//---[Session Start]----------------------------------------
session_save_path(SESSIONDIR);
if(function_exists(session_cache_limiter)) session_cache_limiter('nocache');
session_start();
//---[Set Style]--------------------------------------------
if(!empty($_GET['style']) and file_exists('./template/'.$_GET['style'].'/index.htm')) $_SESSION['style']=$_GET['style'];
if(!empty($_SESSION['style'])) $config['Style']=$_SESSION['style'];
//---[Send Header]------------------------------------------
@header("Cache-control: private");
@header("Content-Type: text/html; charset=utf-8");
//---[Object User&DB Start]---------------------------------
$user=new user;
$user->txtdb(DATADIR,CACHEDIR);
$user->userIsLogged();
//---[Object Template Start]--------------------------------
$tpl=new Template('./template/'.$config['Style'],CACHEDIR);
//---[Load Language]----------------------------------------
$langFile='./lang/'.$config['Lang'].'.lang.php';
$langCache=CACHEDIR.'/lang['.$config['Lang'].'].cache.php';
getCache($lang,$langFile,$langCache);
//---[Set Module]-------------------------------------------
$modFile='./mods/'.$modName.'.php';
if(!file_exists($modFile)) $modFile='./mods/index.php';
//---[Require Modules]--------------------------------------
require_once($modFile);
require_once('./mods/header.php');
require_once('./mods/footer.php');
//---[Navigation As Rank]-----------------------------------
if($user->logined){
$tpl->set_block_var('LOGINED');
}else{
$tpl->set_block_var('LOGIN');
}
if($user->user['rank']==1) $tpl->set_block_var('ADMIN');
if($user->user['rank']<=$config['AddLog']) $tpl->set_block_var('ADDLOG');
//---[Parse Template]---------------------------------------
$tpl->pparse('tplHeader');
$tpl->pparse('tplModule');
$tpl->pparse('tplFooter');
//---[Output]-----------------------------------------------
echo '<!-- Process: '.number_format((array_sum(split(' ', microtime())) - $beginTime), 6).'s -->';
ob_end_flush();
?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -