%
'on error resume next
dim stype,ordername
dim currentpage,page_count,Pcount
dim totalrec,endpage
dim searchDateLimit,searchday
dim searchboard
dim LastPost,Lastuser,LastID
dim LastTime,LastUserid,LastRootid,body
stats="热门话题"
stype=request("stype")
if request("page")="" or not isInteger(request("page")) then
currentPage=1
else
currentPage=cint(request("page"))
end if
'搜索多少天内帖子
searchDateLimit=180
if request("SearchDate")="ALL" OR request("SearchDate")="" then
searchday=" "
else
if not isInteger(request("SearchDate")) then
Errmsg=Errmsg+"
"+"
搜索多少天必须是整数。"
founderr=true
else
searchday=" datediff('d',dateandtime,Now()) < "&request("SearchDate")&" and "
end if
end if
call nav()
if cint(boardid)<1 then
call head_var(2,0,"","hotlist.asp?boardid=0")
searchboard=""
else
call head_var(1,0,boardtype,"hotlist.asp?boardid="&boardid)
searchboard=" boardid="&boardid&" and "
end if
if Cint(GroupSetting(14))=0 then
Errmsg=Errmsg+"
"+"您没有在本论坛搜索的权限,请登陆或者同管理员联系。"
founderr=true
end if
if founderr then
call dvbbs_error()
else
call search()
if founderr then call dvbbs_error()
end if
call footer()
sub search()
sql=""
set rs=server.createobject("adodb.recordset")
select case stype
case 1
sql="select top 50 TopicID,boardid,title,postusername,postuserid,dateandtime,child,hits,votetotal,lastpost,lastposttime,isvote,isbest,locktopic,Expression from Topic where "&searchboard&" "&searchday&" locktopic<2 and hits>10 ORDER BY hits desc"
ordername="最热门50主题"
case 2
sql="select top 50 TopicID,boardid,title,postusername,postuserid,dateandtime,child,hits,votetotal,lastpost,lastposttime,isvote,isbest,locktopic,Expression from Topic where "&searchboard&" "&searchday&" locktopic<2 ORDER BY hits desc"
ordername="最新50帖"
case else
sql="select top 50 TopicID,boardid,title,postusername,postuserid,dateandtime,child,hits,votetotal,lastpost,lastposttime,isvote,isbest,locktopic,Expression from Topic where "&searchboard&" "&searchday&" locktopic<2 and hits>10 ORDER BY hits desc"
ordername="最热门50主题"
end select
if sql="" then
Errmsg=Errmsg+"
"+"请指定查询条件。"
founderr=true
exit sub
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then
Errmsg=Errmsg+"
"+"没有找到您要查询的内容。"
founderr=true
exit sub
else
rs.PageSize = Forum_Setting(11)
rs.AbsolutePage=currentpage
page_count=0
totalrec=rs.recordcount
call searchinfo()
call listPages3()
end if
rs.close
set rs=nothing
call activeonline()
end sub
sub searchinfo()
%>
"
end sub
sub listPages3()
Pcount=rs.PageCount
response.write ""&_
""&_
"页次:"¤tpage&"/"&Pcount&"页"&_
"每页"&Forum_Setting(11)&" 帖子数"&totalrec&" | "&_
"分页: "
if currentpage > 4 then
response.write "[1] ..."
end if
if Pcount>currentpage+3 then
endpage=currentpage+3
else
endpage=Pcount
end if
for i=currentpage-3 to endpage
if not i<1 then
if i = clng(currentpage) then
response.write " ["&i&"]"
else
response.write " ["&i&"]"
end if
end if
next
if currentpage+3 < Pcount then
response.write "... ["&Pcount&"]"
end if
response.write " |
"
end sub
function renzhen(boardid,username)
dim boarduser,rrs,Board_Setting,BoardMaster
renzhen=false
if master then
renzhen=true
else
sql="select boarduser,Board_Setting,BoardMaster from board where boardid="&boardid
set rrs=server.createobject("adodb.recordset")
rrs.open sql,conn,1,1
Board_Setting=split(rrs("board_setting"),",")
if cint(Board_Setting(2))=1 then
if not (isnull(rrs(2)) or rrs(2)="") then
BoardMaster=split(rrs(2), "|")
for i = 0 to ubound(BoardMaster)
if trim(BoardMaster(i))=trim(username) then
renzhen=true
exit for
end if
next
end if
if renzhen=false then
if isnull(rrs(0)) or rrs(0)="" then
renzhen=false
else
boarduser=split(rrs(0), ",")
for i = 0 to ubound(boarduser)
if trim(boarduser(i))=trim(username) then
renzhen=true
exit for
end if
next
end if
end if
else
renzhen=true
end if
rrs.close
set rrs=nothing
end if
end function
%>