index.php
2.42 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
require("../class/connect.php");
require("../class/db_sql.php");
require("../class/q_functions.php");
require("../data/dbcache/class.php");
require LoadLang("pub/fun.php");
$link=db_connect();
$empire=new mysqlquery();
eCheckCloseMods('print');//關閉模塊
$id=(int)$_GET['id'];
$classid=(int)$_GET['classid'];
if(empty($id)||empty($classid))
{
printerror("ErrorUrl","history.go(-1)",1);
}
$mid=$class_r[$classid]['modid'];
$tbname=$class_r[$classid][tbname];
if(empty($tbname)||InfoIsInTable($tbname))
{
printerror("ErrorUrl","history.go(-1)",1);
}
$r=$empire->fetch1("select * from {$dbtbpre}ecms_".$tbname." where id='$id' limit 1");
if(empty($r['id'])||$r['classid']!=$classid)
{
printerror("ErrorUrl","history.go(-1)",1);
}
//副表
$finfor=$empire->fetch1("select ".ReturnSqlFtextF($mid)." from {$dbtbpre}ecms_".$tbname."_data_".$r[stb]." where id='$r[id]' limit 1");
$r=array_merge($r,$finfor);
//權限
if($r['groupid']||$class_r[$classid]['cgtoinfo'])
{
include('../data/dbcache/MemberLevel.php');
define('empirecms','wm_chief');
define('PageCheckLevel','wm_chief');
$check_tbname=$tbname;
$check_infoid=$id;
$check_classid=$classid;
$check_path="../../";
$checkinfor=$r;
include("../class/CheckLevel.php");
}
//使用模板
if($_GET['tempid'])
{
$tempid=(int)$_GET['tempid'];
$tempnum=$empire->gettotal("select count(*) as total from ".GetTemptb("enewsprinttemp")." where tempid='$tempid'");
$tempid=$tempnum?$tempid:$public_r['defprinttempid'];
}
else
{
$mod_tempr=$empire->fetch1("select printtempid from {$dbtbpre}enewsmod where mid='$mid'");
$tempid=$mod_tempr[printtempid]?$mod_tempr[printtempid]:$public_r['defprinttempid'];
}
if(empty($tempid))
{
$tempid=1;
}
//存文本
$savetxtf=$emod_r[$mid]['savetxtf'];
if($savetxtf&&$r[$savetxtf])
{
$r[$savetxtf]=GetTxtFieldText($r[$savetxtf]);
}
//分頁字段
$pagef=$emod_r[$mid]['pagef'];
if($pagef&&$r[$pagef])
{
$r[$pagef]=str_replace('[!--empirenews.page--]','',$r[$pagef]);
$r[$pagef]=str_replace('[/!--empirenews.page--]','',$r[$pagef]);
}
$url=ReturnClassLink($r[classid])." > ".$fun_r['zw'];
//標題鏈接
$titleurl=sys_ReturnBqTitleLink($r);
//標題圖片
if(empty($r[titlepic]))
{
$r[titlepic]=$public_r[newsurl].'e/data/images/notimg.gif';
}
$bclassid=$class_r[$classid][bclassid];
@require(ECMS_PATH.'e/data/filecache/template/print'.$tempid.'.php');
db_close();
$empire=null;
?>