index.php
4.01 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?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('pl');//關閉模塊
//用戶名
$lusername=getcvar('mlusername');
$lpassword='';
if($lusername)
{
$lusername=RepPostVar($lusername);
$lpassword=md5($lusername);
}
$id=(int)$_GET['id'];
$classid=(int)$_GET['classid'];
//專題
$doaction=$_GET['doaction']=='dozt'?'dozt':'';
$rewritedoaction='doinfo';
if($doaction=='dozt')
{
$rewritedoaction='dozt';
if(empty($classid))
{
printerror("ErrorUrl","history.go(-1)",1);
}
$n_r=$empire->fetch1("select ztid,ztname,intro,ztimg,ztpagekey,restb from {$dbtbpre}enewszt where ztid='$classid'");
if(!$n_r['ztid'])
{
printerror("ErrorUrl","history.go(-1)",1);
}
$pubid='-'.$classid;
$search="&doaction=dozt&classid=$classid";
//標題鏈接
$titleurl=sys_ReturnBqZtname($n_r);
$title=stripSlashes($n_r['ztname']);
$pagetitle=ehtmlspecialchars($title);
//評分
$infopfennum=0;
$pinfopfen=0;
$url=ReturnZtLink($n_r['ztid'])." > ".$fun_r[pl];
}
else
{
if(empty($id)||empty($classid))
{
printerror("ErrorUrl","history.go(-1)",1);
}
if(empty($class_r[$classid][tbname])||InfoIsInTable($class_r[$classid][tbname]))
{
printerror("ErrorUrl","history.go(-1)",1);
}
$n_r=$empire->fetch1("select * from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where id='$id' limit 1");
if(!$n_r['id']||$n_r['classid']!=$classid)
{
printerror("ErrorUrl","history.go(-1)",1);
}
$pubid=ReturnInfoPubid($classid,$id);
$search="&classid=$classid&id=".$id;
//標題鏈接
$titleurl=sys_ReturnBqTitleLink($n_r);
$title=stripSlashes($n_r[title]);
$pagetitle=ehtmlspecialchars($title);
//評分
$infopfennum=$n_r['infopfennum'];
$pinfopfen=$infopfennum?round($n_r['infopfen']/$infopfennum):0;
$url=ReturnClassLink($n_r[classid])." > <a href=".$titleurl.">".$title."</a> > ".$fun_r[pl];
}
//使用模板
$rewritetempid=0;
if($_GET['tempid'])
{
$tempid=(int)$_GET['tempid'];
$tempnum=$empire->gettotal("select count(*) as total from ".GetTemptb("enewspltemp")." where tempid='$tempid'");
$tempid=$tempnum?$tempid:$public_r['defpltempid'];
$search.='&tempid='.$tempid;
$rewritetempid=$tempid;
}
else
{
if($doaction=='dozt')
{
$tempid=$class_zr[$classid]['pltempid']?$class_zr[$classid]['pltempid']:$public_r['defpltempid'];
}
else
{
$tempid=$class_r[$classid]['pltempid']?$class_r[$classid]['pltempid']:$public_r['defpltempid'];
}
}
if(empty($tempid))
{
$tempid=1;
}
$page=(int)$_GET['page'];
$page=RepPIntvar($page);
$start=0;
$page_line=10;//每頁顯示鏈接數
$line=$public_r['pl_num'];//每頁顯示記錄數
$offset=$page*$line;//總偏移量
$query="select * from {$dbtbpre}enewspl_".$n_r['restb']." where pubid='$pubid' and checked=0";
//總數量
if($doaction=='dozt')
{
$totalquery="select count(*) as total from {$dbtbpre}enewspl_".$n_r['restb']." where pubid='$pubid' and checked=0";
$num=$empire->gettotal($totalquery);
}
else
{
//需審核
if($class_r[$classid][checkpl])
{
$totalquery="select count(*) as total from {$dbtbpre}enewspl_".$n_r['restb']." where pubid='$pubid' and checked=0";
$num=$empire->gettotal($totalquery);
}
else
{
$num=$n_r['plnum'];
}
}
//排序
$addorder='plid desc';
$myorder=(int)$_GET['myorder'];
if($myorder==1)
{
$addorder='plid';
$search.='&myorder='.$myorder;
}
$query.=" order by ".$addorder." limit $offset,$line";
$sql=$empire->query($query);
//偽靜態
$pagefunr=eReturnRewritePlUrl($classid,$id,$rewritedoaction,$myorder,$rewritetempid,0);
$pagefunr['repagenum']=0;
//分頁
if($pagefunr['rewrite']==1)
{
$listpage=InfoUsePage($num,$line,$page_line,$start,$page,$search,$pagefunr);
}
else
{
$listpage=page1($num,$line,$page_line,$start,$page,$search);
}
@require(ECMS_PATH.'e/data/filecache/template/pl'.$tempid.'.php');
db_close();
$empire=null;
?>