<% Server.ScriptTimeOut=999 Response.Buffer = True Response.Expires = -1 Response.ExpiresAbsolute = Now() - 1 Response.CacheControl = "no-cache" response.Charset = "gb2312" ConnectionDatabase Dim ClsMain,ACT_S_Qie_Qie Set ACT_S_Qie_Qie = New ACT_Search Dim MaxPerPage,CurrentPage,ModeID,KeyWord,SearchType,ClassID,RS,SearchForm,TotalPut,i MaxPerPage=20 If request("page") <> "" Then CurrentPage = CInt(Request("page")) Else CurrentPage = 1 End If Dim RefreshTime:RefreshTime = 5 '设置防刷新时间 If DateDiff("s", Session("SearchTime"), Now()) < RefreshTime Then 'Response.Write "
本页面起用了防刷新机制,请不要在"&RefreshTime&"秒内连续刷新本页面
正在打开页面,请稍后……" ' Response.End End If Session("SearchTime")=Now() ModeID=ACTCMS.ChkNumeric(request("ModeID")) If ModeID=0 Then ModeID=1 KeyWord=ACTCMS.s("KeyWord") If KeyWord="" Then KeyWord=ACTCMS.s("Tags") SearchType=ACTCMS.ChkNumeric(request("SearchType")) ClassID=request("ClassID"):If ClassID="" Then ClassID="0" If KeyWord="" Then Call ACTCMS.Alert("你没有输入搜索关键字!",""):response.End Response.Write "" Response.Write "" Response.Write "" Response.Write "搜索"&KeyWord&"结果-By ActCMS.com" Response.Write "" Call TagsHits() Response.Write "" Response.Write "" Response.Write ""& vbcrlf Call ArticleSearchResult() SearchForm=ACT_S_Qie_Qie.ArticleSearch(ModeID) Response.Write "" Response.Write "
" IF KeyWord="" Then Response.Write "

搜索结果...

" & vbcrlf Else Response.Write "

您要查询〖 " & KeyWord & " 〗的信息,以下是搜索结果...

" & vbcrlf End if Response.Write "
" & SearchForm & "
" Sub TagsHits() If SearchType=5 Then Conn.Execute("Update Tags_ACT set hits=hits+1,ClicksTime=" & NowString & " where TagsChar='" & keyword & "'") End IF End Sub Sub ArticleSearchResult() Dim SqlStr,Param Param=" Where isAccept=0 And delif=0" Select Case SearchType Case 100 If IsDate(KeyWord) Then Param=Param & " And UpdateTime>=#" & KeyWord & " 00:00:00# and UpdateTime<=#" &KeyWord & " 23:59:59#" Else Exit Sub End If Case 1:Param=Param & " And (Title Like '%" & KeyWord & "%')" Case 2:Param=Param & " And Content Like '%" & KeyWord & "%'" Case 3:Param=Param & " And Author Like '%" & KeyWord & "%'" Case 4:Param=Param & " And ArticleInput Like '%" & KeyWord & "%'" Case 5:Param=Param & " And KeyWords Like '%" & KeyWord & "%'" Case else: Param=Param & " And (Title Like '%" & KeyWord & "%')" End Select If ClassID<>"0" Then Param=Param & " And ClassID ='"& ClassID &"'" SqlStr="Select ID,Classid,Title,UpdateTime,ChangesLink,FileName,GroupID_ACT,Score_ACT,Hits From "&ACTCMS.ACT_C(ModeID,2)&"" & Param & " Order By ID Desc" Response.Write "
" & vbcrlf Set RS=Server.CreateObject("ADODB.RECORDSET") RS.Open SqlStr,Conn,2,1 IF RS.Eof And RS.Bof Then Response.Write "此次搜索没有找到您查询的任何文章信息,建议重新选择查询条件再搜一次" Else TotalPut = Conn.Execute("Select Count(1) From (Select ID From "&ACTCMS.ACT_C(ModeID,2)&"" & Param & ")a")(0) If CurrentPage < 1 Then CurrentPage = 1 End If If (CurrentPage - 1) * MaxPerPage > totalPut Then If (TotalPut Mod MaxPerPage) = 0 Then CurrentPage = totalPut \ MaxPerPage Else CurrentPage = totalPut \ MaxPerPage + 1 End If End If If CurrentPage = 1 Then Call TypeArticleContent() Else If (CurrentPage - 1) * MaxPerPage < totalPut Then RS.Move (CurrentPage - 1) * MaxPerPage Call TypeArticleContent() Else CurrentPage = 1 Call TypeArticleContent() End If End If End IF RS.Close Set RS=Nothing End Sub Sub TypeArticleContent() Dim N,GainClassName,TempTitle N=(CurrentPage-1)*MaxPerPage Do While Not RS.Eof N=N+1 GainClassName = "[" & ACTCMS.GainClassName(RS("ClassID"), "target=""_blank""", "") & "]" TempTitle = "" & Replace(RS("Title"),KeyWord,"" & KeyWord &"") & "" Response.Write "" & N & "." & GainClassName & "" & TempTitle & " [点击数:" &RS("Hits")& " 发布时间:"&RS("UpdateTime") & "]" & vbcrlf Response.Write "" I = I + 1 If I >= MaxPerPage Then Exit Do RS.MoveNext Loop Response.Write "" Call ShowPagePara(totalPut, MaxPerPage, "", true, "篇", CurrentPage, "SearchType=" & SearchType & "&ClassID=" & ClassID & "&KeyWord=" & KeyWord & "&ModeID=" & ModeID ) Response.Write "" & vbcrlf End Sub Sub ShowProductContent() '显示Product搜索结果 Dim N,GainClassName,TempTitle N=(CurrentPage-1)*MaxPerPage Do While Not RS.Eof N=N+1 GainClassName = "[" & ClsMain.GainClassName(RS("ClassID"), "target=""_blank""", "") & "]" TempTitle = "" & Replace(RS("Title"),KeyWord,"" & KeyWord &"") & "" Response.Write "" & N & "." & GainClassName & "" & TempTitle & " [" & RS("ProducerName") & "][" & RS("Adddate") & "]" & vbcrlf Response.Write "" I = I + 1 If I >= MaxPerPage Then Exit Do RS.MoveNext Loop Response.Write "" Call ShowPagePara(totalPut, MaxPerPage, "", True, "件", CurrentPage, "SearchType=" & SearchType & "&ClassID=" & ClassID & "&KeyWord=" & KeyWord & "&ModeID=" & ModeID ) Response.Write "" & vbcrlf End Sub Sub AllSearchResult() Dim SqlStr Dim ArticleSqlStr:ArticleSqlStr="Select C.ModeID,A.ID,A.classid,A.Title,A.UpdateTime,A.Author,A.FileName,A.GroupID_ACT,A.Score_ACT,A.ChangesLink,A.Hits From "&ACTCMS.ACT_C(ModeID,2)&" A,Class_ACT C Where A.classid=C.classid and A.isAccept=0 And A.delif=0 And (A.Title Like '%" & KeyWord & "%' Like '%" & KeyWord & "%' or A.Author Like '%" & KeyWord & "%')" SqlStr=ArticleSqlStr & " Order By A.UpdateTime Desc" Set RS=Server.CreateObject("ADODB.RECORDSET") RS.Open SqlStr,Conn,1,1 IF RS.Eof And RS.Bof Then Response.Write "此次搜索没有找到您查询的任何信息,建议重新选择查询条件再搜一次" Else TotalPut = RS.RecordCount If CurrentPage < 1 Then CurrentPage = 1 End If If (CurrentPage - 1) * MaxPerPage > totalPut Then If (TotalPut Mod MaxPerPage) = 0 Then CurrentPage = totalPut \ MaxPerPage Else CurrentPage = totalPut \ MaxPerPage + 1 End If End If If CurrentPage = 1 Then Call ShowALLContent() Else If (CurrentPage - 1) * MaxPerPage < totalPut Then RS.Move (CurrentPage - 1) * MaxPerPage Call ShowALLContent() Else CurrentPage = 1 Call ShowALLContent() End If End If End IF RS.Close Set RS=Nothing End Sub Sub ShowAllContent() Dim N,GainClassName,TempTitle N=(CurrentPage-1)*MaxPerPage Do While Not RS.Eof N=N+1 GainClassName = "[" & ClsMain.GainClassName(RS(2), "target=""_blank""", "") & "]" TempTitle = "" & Replace(RS(3),KeyWord,"" & KeyWord &"") & "" Response.Write "" & N & "." & GainClassName & "" & TempTitle & " [点击数:" &RS("Hits")& " 发布时间:"&RS("UpdateTime") & "]" & vbcrlf Response.Write "" I = I + 1 If I >= MaxPerPage Then Exit Do RS.MoveNext Loop Response.Write "" Call ShowPagePara(totalPut, MaxPerPage, "", True, "条", CurrentPage, "SearchType=" & SearchType & "&ClassID=" & ClassID & "&KeyWord=" & KeyWord & "&ModeID=" & ModeID ) Response.Write "" & vbcrlf End Sub Public Function ShowPagePara(totalnumber, MaxPerPage, FileName, ShowAllPages, strUnit, CurrentPage, ParamterStr) Dim N, I, PageStr Const Btn_First = "第一页"'样式定义 Const Btn_Prev = "上一页" Const Btn_Next = "下一页" Const Btn_Last = "最后一页" PageStr = "" If totalnumber Mod MaxPerPage = 0 Then N = totalnumber \ MaxPerPage Else N = totalnumber \ MaxPerPage + 1 End If If N > 1 Then PageStr = PageStr & ("页次:" & CurrentPage & "/" & N & "页 共有:" & totalnumber & strUnit & " 每页:" & MaxPerPage & strUnit & " ") If CurrentPage < 2 Then PageStr = PageStr & Btn_First & " " & Btn_Prev & " " Else PageStr = PageStr & ("" & Btn_First & " " & Btn_Prev & " ") End If If N - CurrentPage < 1 Then PageStr = PageStr & " " & Btn_Next & " " & Btn_Last & " " Else PageStr = PageStr & (" " & Btn_Next & " " & Btn_Last & " ") End If If ShowAllPages = True Then PageStr = PageStr & ("GO:" End If End If ShowPagePara = PageStr response.write ShowPagePara End Function %>