<% Dim Key,Flag If Not MNBoard.Founduser Then MNBoard.GotoErr(10) If SESSION(CacheName& "MyGradeInfo")(20)="0" Then MNBoard.GotoErr(75) If MNBoard.BoardID >0 Then MNBoard.CheckBoard() MNBoard.Head"Search.asp",MNBoard.Boardname,"论坛搜索" Key=MNBoard.Fun.Getkey("Key") Flag=MNBoard.CheckNum(Request.querystring("Flag")) If Key<>"" or Flag<>0 Then SearchList() Else Main() End If MNBoard.Footer() Set MNBoard =Nothing Sub SearchList() with MNBoard Dim Temp,intPageNow,arr_Rs,i,Pages,Conut,p,PageInfo,Title,Sqlwhere,orders Dim Topic,TopicS,Caption,Moodpic,LastRe,RePageUrl,UploadType,RePage,leftn,ii,Stype,STime,again SType=.CheckNum(Request.querystring("SType")) STime=.CheckNum(Request.querystring("STime")) again=Request.querystring("again") Sqlwhere="IsDel=0 " Select Case Flag Case 1 Title="精华主题" SqlWhere=Sqlwhere&"And IsGood=1" Case 2 Title="今日新帖" SqlWhere=Sqlwhere&"And DATEDIFF('d',[LastTime],'"&MNBoard.NowBbsTime&"')<1" Case 3 Title="最Hi人气主题" Orders="hits desc," Case 4 Title="最Hi回复主题" Orders="ReplyNum desc," Case Else Title="全部主题" End Select If Key<>"" Then If Len(Key)<2 Then .GotoErr(63) If again<>"" Then If Key<>.Fun.Getkey("Key1") Then Key=.Fun.Getkey("Key1")&" "&Key End If Select Case Stype Case"1":Sqlwhere=Sqlwhere&" And "&.Fun.SplitKey("Name",Key,"and") Case"2":Sqlwhere=Sqlwhere&" And "&.Fun.SplitKey("Caption",Key,"and") Case"3":Sqlwhere=Sqlwhere&" And "&"("&.Fun.SplitKey("Name",Key,"And")&" or "&.Fun.SplitKey("Caption",Key,"And")&")" Case Else .GotoErr(1) End Select Title="论坛搜索 关键字:"&Key End If If STime<>0 Then Sqlwhere=Sqlwhere&" And DATEDIFF('d',[AddTime],'"&.NowBbsTime&"')<"&STime If .BoardID >0 Then Sqlwhere=sqlwhere&" And (BoardID="&.BoardID&" or TopType=5)" If .MyAdmin<>9 Then '过滤特殊版面的帖子 Temp=.NoShowTopic() If Temp<>"" Then Sqlwhere=Sqlwhere&" And BoardID not in ("&Temp&")" If Session(CacheName&"Searh")="" Then Session(CacheName&"Searh")=Sqlwhere If Session(CacheName&"Searh")<>Sqlwhere Then If (Session(CacheName&"SearchTime")+Int(.Info(17))/86400)>Now() Then .GoToErr(64) Session(CacheName&"Searh")=Sqlwhere Session(CacheName&"SearchTime")=Now() End If End If intPageNow = Request.QueryString("page") Set p = New Cls_PageView p.strTableName = "[i_Topic]" p.strPageUrl = "?Flag="&Flag&"&Key="&Key&"&SType="&SType&"&TB="&.TB&"&STime="&STime&"&BoardID="&.BoardID P.strFieldsList = "TopicID,Face,Caption,Name,TopType,IsGood,AddTime,BoardID,LastTime,Hits,LastReply,UploadType,IsVote,ReplyNum,SqlTableID,IsLock,Font" p.strCondiction = SqlWhere p.strOrderList = Orders&"TopicID desc" p.strPrimaryKey = "TopicID" p.intPageSize = 20 p.intPageNow = intPageNow p.strCookiesName = "Search"&SType&STime&.BoardID&.TB p.Reloadtime=0 p.strPageVar = "page" p.InitClass Arr_Rs = p.arrRecordInfo PageInfo = p.strPageInfo Set p = nothing If IsArray(Arr_Rs) Then For i = 0 to UBound(Arr_Rs, 2) Moodpic=.SkinsPIC(16) If Arr_Rs(13,i) > Int(.Info(62)) Then Moodpic=.SkinsPIC(15) If Arr_Rs(5,i)=1 Then Moodpic=.SkinsPIC(13)'精华 If Arr_Rs(15,i)=1 Then Moodpic=.SkinsPIC(17)'锁定 If Arr_Rs(12,i)=1 Then Moodpic=.SkinsPIC(14)'投票 If Arr_Rs(4,i)=5 Then Moodpic=.SkinsPIC(10)'总顶 If Arr_Rs(4,i)=4 Then Moodpic=.SkinsPIC(11)'区顶 If Arr_Rs(4,i)=3 Then Moodpic=.SkinsPIC(12)'顶 UploadType="" If Arr_Rs(11,i)<>"" Then Uploadtype=" " LastRe=split(Arr_Rs(10,i),"|") RePage=(Arr_Rs(13,i)+1)\10 If RePage<(Arr_Rs(13,i)+1)/10 Then RePage=RePage+1 RePageUrl="Topic.asp?id="&Arr_Rs(0,i)&"&BoardID="&Arr_Rs(7,i)&"&TB="&Arr_Rs(14,i)&"" Caption=.Fun.ReplaceKey(.Fun.StrLeft(Arr_Rs(2,i),60),Key) Temp=Arr_Rs(16,i) If Not isNull(Temp) And Temp<>"" Then Temp=Split(Temp,"|") If Temp(0)<>"" Then Caption="<"&Temp(0)&">"&Caption&"" If Temp(1)<>"" Then Caption=""&Caption&"" End If '打开方式 If .Info(69)="1" Then Temp="target='_blank' " Else Temp="" Caption=UploadType&""&Caption&"" If Repage>1 Then Caption=Caption&" [ " If RePage<=5 Then For ii=2 To RePage Caption=Caption&""&ii&" " Next Else For ii=2 To 4 Caption=Caption&""&ii&" " Next Caption=Caption&"... "&RePage&" " End If Caption=Caption&" ]" End If If Datediff("n",Arr_Rs(8,i),.NowbbsTime)<=180 Then Caption=Caption&.SkinsPIC(18) Caption=Moodpic&""&Caption Topic="
"&.GetBoardName(arr_Rs(7,i))&"
"&Caption&""&_ "
作者:"&Arr_Rs(3,i)& " | 发表时间:"&Arr_Rs(6,i)&" | 浏览:"&Arr_Rs(9,i)&" | 回复:"&Arr_Rs(13,i)&"
" TopicS=TopicS&Topic Next Topics=Topics&"
"&PageInfo&"
" TopMain() .ShowTable Title,TopicS Else .ShowTable "论坛搜索","
找不到搜索的内容![返回]
" End If End with End Sub Sub Main() Dim S S="
" S=S&MNBoard.Row1("
搜索说明:
  • 本论坛每次搜索的间隔时间为"&MNBoard.Info(17)&"秒
  • 可以采用分词搜索进行搜索
  • ") S=S&MNBoard.Row("搜索关键字:","","65%","") S=S&MNBoard.Row("搜索类型:"," 按帖子作者 按帖子主题 两者均搜","65%","") S=S&MNBoard.Row("搜索日期范围:","","65%","") S=S&MNBoard.Row("搜索的论坛:","","65%","") S=S&"
    " MNBoard.ShowTable "论坛搜索",S End Sub Sub topMain() Dim S S="
    " S=S&MNBoard.Row1("
    搜索说明:
  • 本论坛每次搜索的间隔时间为"&MNBoard.Info(17)&"秒
  • 可以采用分词搜索进行搜索
  • ") S=S&MNBoard.Row("搜索关键字:","","65%","") S=S&MNBoard.Row("搜索类型:"," 按帖子作者 按帖子主题 两者均搜","65%","") S=S&MNBoard.Row("搜索日期范围:","","65%","") S=S&MNBoard.Row("搜索的论坛:","","65%","") S=S&"
    " MNBoard.ShowTable "论坛搜索",S End Sub %>