schalltemp.txt
2.97 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
<?php
require("../class/connect.php");
if(!defined('InEmpireCMS'))
{
exit();
}
require("../class/db_sql.php");
require("../data/dbcache/class.php");
require LoadLang("pub/fun.php");
require("../class/schallfun.php");
$link=db_connect();
$empire=new mysqlquery();
eCheckCloseMods('sch');//關閉模塊
$searchtime=time();
$totalnum=(int)$_GET['totalnum'];
$firstsearch=0;
if($totalnum<1)
{
$firstsearch=1;
//搜索間隔
$lastsearchtime=(int)getcvar('lastschalltime');
if($lastsearchtime)
{
if($searchtime-$lastsearchtime<$public_r[schalltime])
{
printerror('SchallOutTime','',1);
}
}
//設置最後搜索時間
esetcookie('lastschalltime',$searchtime,$searchtime+3600*24);
}
$page=(int)$_GET['page'];
$page=RepPIntvar($page);
$start=0;
$page_line=$public_r['schallpagenum'];//每頁顯示鏈接數
$line=$public_r['schallnum'];//每頁顯示記錄數
$offset=$start+$page*$line;//總偏移量
//編碼
$iconv='';
$char='';
$targetchar='';
if($ecms_config['sets']['pagechar']!='gb2312')
{
include_once(ECMS_PATH.'e/class/doiconv.php');
$iconv=new Chinese('');
$char=$ecms_config['sets']['pagechar']=='big5'?'BIG5':'UTF8';
$targetchar='GB2312';
}
$schallr=ReturnSearchAllSql($_GET);
require("../data/dbcache/SearchAllTb.php");
$keyboard=$schallr['keyboard'];
$query="select id,classid from {$dbtbpre}enewssearchall where ".$schallr['where'];
if($totalnum<1)
{
$totalquery="select count(*) as total from {$dbtbpre}enewssearchall where ".$schallr['where'];
$num=$empire->gettotal($totalquery);
if(empty($num))
{
printerror('SchallNotRecord','',1);
}
}
else
{
$num=$totalnum;
}
$search=$schallr['search']."&totalnum=".$num;
$query.=" order by infotime desc limit $offset,$line";
$sql=$empire->query($query);
$listpage=page1($num,$line,$page_line,$start,$page,$search);
$url="<a href='".ReturnSiteIndexUrl()."'>".$fun_r['index']."</a> > ".$fun_r['SearchAllNav'];
?>
<!--empire.listtemp.top-->
<?php
$no=$offset;
$subnum=<!--empire.listtemp.subnum-->;
$formatdate="<!--empire.listtemp.formatdate-->";
while($r=$empire->fetch($sql))
{
$tbname=$class_r[$r[classid]]['tbname'];
if(empty($tbname))
{
continue;
}
$titlefield=$schalltb_r[$tbname]['titlefield'];
$smalltextfield=$schalltb_r[$tbname]['smalltextfield'];
$infor=$empire->fetch1("select id,classid,titlepic,newstime,isurl,titleurl,".$titlefield.",".$smalltextfield." from {$dbtbpre}ecms_".$tbname." where id='$r[id]' limit 1");
if(empty($infor['id']))
{
continue;
}
$no++;
$titleurl=sys_ReturnBqTitleLink($infor);
$titlepic=$infor['titlepic']?$infor['titlepic']:$public_r['newsurl']."e/data/images/notimg.gif";
$smalltext=SubSchallSmalltext($infor[$smalltextfield],$subnum);
$title=DoReplaceFontRed($infor[$titlefield],$keyboard);
$smalltext=DoReplaceFontRed($smalltext,$keyboard);
$newstime=date($formatdate,$infor['newstime']);
?>
<!--empire.listtemp.center-->
<?php
}
db_close();
$empire=null;
?>
<!--empire.listtemp.footer-->