<% '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() %>
    目前共有><%=totalrec%>个<%=ordername%> ">
    <% while (not rs.eof) and (not page_count = rs.PageSize) if not isnull(rs("lastpost")) then LastPost=split(rs("lastpost"),"$") if ubound(LastPost)=6 then Lastuser=htmlencode(LastPost(0)) LastID=LastPost(1) LastTime=LastPost(2) if not isdate(LastTime) then LastTime=rs("dateandtime") body=htmlencode(LastPost(3)) LastUserid=LastPost(5) LastRootid=LastPost(6) else Lastuser=htmlencode(LastPost(0)) LastID=rs("topicid") LastTime=rs("dateandtime") body="..." LastUserid=rs("postuserid") LastRootid=rs("topicid") end if else Lastuser="------" LastID=rs("topicid") LastTime=rs("dateandtime") body="..." LastUserid=rs("postuserid") LastRootid=rs("topicid") end if response.write""&_ "" response.write "" %> <% page_count = page_count + 1 rs.movenext wend response.write "
    状态 主 题 作 者 回复/人气 最后更新 | 回复人
    " if rs(0)=1 then response.write"" else response.write"" end if response.write"" response.write"0 then response.write rs("Expression") else response.write "face1.gif" end if response.write " border=0 alt=""开新窗口浏览此主题"">"&_ "" if renzhen(rs("boardid"),membername)=false then response.write "(认证论坛帖子,只有认证用户才能查看)" else if len(rs("title"))>26 then response.write ""&left(htmlencode(replace(rs("title"),chr(10)," ")),26)&"..." else response.write htmlencode(rs("title")) end if end if response.write ""&htmlencode(rs("postusername"))&"" if rs("isvote")=1 then response.write ""&rs("votetotal")&" 票" else response.write rs("child") &"/"& rs("hits") end if response.write "  <%=FormatDateTime(LastTime,2)%> <%=FormatDateTime(LastTime,4)%>  |  <%=htmlencode(LastUser)%>
    " 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 %>