-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
50 lines (39 loc) · 1.57 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
session_start();
$_DEBUG=true;//调试模式
include_once 'conn.php';
include_once 'library/basefunction.php';
include_once 'lang/envinit.php';
include_once 'templatefunction/Iron.article.php';
include_once 'templatefunction/Iron.column.php';
include_once 'templatefunction/Iron.label.php';
loadlibrary("library/third/FirePHPCore/fb.php");
FB::log('Log message');
FB::info('Info message');
FB::warn('Warn message');
FB::error('Error message');
readcache();
$siteconfig = getresult("SELECT * FROM I_siteconfig LIMIT 0 , 1");
//如果没有网站配置项
if(getresultNumrows($siteconfig)<1)
die("<script type='text/javascript'>window.location='error.html'</script>");
$templateid = getresultData($siteconfig, 0, "indextemplate");
$templateinfo = getresult("select * from I_template where id=$templateid limit 0,1");
if(getresultNumrows($templateinfo)<1)
die("<script type='text/javascript'>window.location='error.html'</script>");
$templatepath = getresultData($templateinfo,0,"path");
$templatefile = getroot()."/templates/".$templatepath;
//echo $templatefile;
if(!file_exists($templatefile))
die("The template file doesn'n exit!");
$template = file_get_contents($templatefile);
//如果模板被删除
if(!$template)
die("<script type='text/javascript'>alert('The template doesn't exists!')window.location='error.html'</script>");
$template = translatelabel($template);
$template = translateArticlelist($template);
$template = translateCommonlabel($template);
echo $template;
ob_flush();
buildcache($template);
?>