<?php
if(file_exists(dirname(__FILE__)."/install.php")){
	exit("<script>alert('请先安装程序，正在跳转到安装文件');location.href='install.php';</script>");
}
require_once("inc/common.php");
/*******************************************************************************************
' Software name: DJCMS Content Management System
' Version:3.0
' Web: http://www.djcms.net
' Author: 心情(qq:1130731)
' Copyright (C) 2009-2010 DJCMS官方 版权所有
' 法律申明：DJCMS程序所有代码100%原创、未引入任何网上代码,对一切抄袭行为、坚决严肃追究法律责任
'*******************************************************************************************/

if (runMode == "static") {
	header("Location:/".sitePath."index".fileSuffix);
} else {
	echoIndex();
}

function echoIndex() {
	global $t1;
	$templatePath = DJCMS_TEMPLATE."index.html";
	if (cacheStart == 1) {
	    if (djcms::$content = memory('get', 'parsed_index')){
        } else {
            parseIndexPart($templatePath);
			memory('set', 'parsed_index',djcms::$content);
        }
	} else {
		parseIndexPart($templatePath);
	}
	echo replaceStr(djcms::$content,"{djcms:runinfo}",getRunTime($t1)); 
}

function parseIndexPart($templatePath) {
	djcms::$content=loadFile($templatePath);
	djcms::parseTopAndFoot();
	djcms::parseSelf();
	djcms::parseGlobal();
	djcms::parseMenuList("");
	djcms::parseNewsList();
	djcms::parseAreaList();
	djcms::parseVideoList();
	djcms::parseTopicList();
	djcms::parseLinkList();
	djcms::$content = replaceCurrentTypeId(djcms::$content,-444);
	djcms::parseIf();
}
?>