⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 search.asp

📁 大型黄页系统,精美黄页flash演示,10m
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="conn.asp" -->
<!--#include file="inc/const.asp"-->
<%
Dim j
Dim i
Dim ii
Dim keyword
Dim findword
Dim Action
Dim sortid
Dim CurrentPage
Dim maxperpage
Dim totalnumber
Dim Pcount
Dim Rs, Rs5, Rs6
Dim SQL, SQL5, SQL6
Dim HtmlString
Dim SoftImg
Dim Soft_Img
Dim SoftName, Company
Dim Soft_Name
Dim SoftSize
Dim SoftTime
Dim Content
Dim Title
Dim Stitle
Dim InfoTime
Dim DownloadClass_Ads
Dim temphtml
Dim NowStats
Dim HtmlTitle
Dim TempTopStr
Dim TempFootStr, Grade
Dim SoftType
Dim bookmark
Dim thiscolor
Dim CategoryId
Dim postTime
Dim MaterialClassCode, MaterialClassCode1
Dim Rss1
Dim SQLs1
Dim Description

On Error Resume Next
Set Rs = Server.CreateObject("adodb.recordset")
Action = Trim(Request("Action"))
keyword = Trim(Request("keyword"))
CategoryId = Trim(Request("CategoryId"))
postTime = cint(Request("postTime"))
MaterialClassCode = Cint(Request("MaterialClassCode"))
If Not IsEmpty(Request("page")) Then
	CurrentPage = CInt(Request("page"))
Else
	CurrentPage = 1
End If
If Not IsNumeric(Request("page")) And Request("page") <> "" Then
	Response.Write "错误的系统参数!请输入整数"
	Err.Raise -19691969
End If
DownsysClass.LoadTemplates ("search")
Set DownloadClass_Ads = New Adcolumn_Cls
NowStats = "搜索引擎"
HtmlTitle = "搜索引擎"
maxperpage = CInt(DownsysClass.TempSet(1)) '###每页显示数
if  Action = "Hy"  then
temphtml = DownsysClass.mainhtml(0) & DownsysClass.mainhtml(1) & DownsysClass.mainhtml(2) &  DownsysClass.temphtml(8)
else
temphtml = DownsysClass.mainhtml(0) & DownsysClass.mainhtml(1) & DownsysClass.mainhtml(2) &  DownsysClass.temphtml(0)
end if
temphtml = Replace(temphtml, "{$NavMenu}", DownsysClass.SortingMenu)
If CInt(DownsysClass.Setting(5)) = 0 Then
	temphtml = Replace(temphtml, "{$TopMeun}", DownsysClass.mainset(9))
Else
	temphtml = Replace(temphtml, "{$TopMeun}", DownsysClass.mainset(10))
End If
temphtml = Replace(temphtml, "{$Style_CSS}", DownsysClass.Style_CSS)
temphtml = Replace(temphtml, "{$NowStats}", NowStats)
temphtml = Replace(temphtml, "{$Title}", HtmlTitle)
temphtml = Replace(temphtml, "{$KeyWord}", keyword)

If keyword = "" Then
	Response.Write ("<script>alert('" & DownsysClass.TempSet(3) & "');history.go(-1)</script>")
	Err.Raise -19691969
Else
	keyword = Replace(Replace(Replace(keyword, "'", "‘"), "<", "&lt;"), ">", "&gt;")
	if  Action = "soft"  then
		findword = "SoftName like '%" & keyword & "%'"
		SQL = "select Top " & CInt(DownsysClass.TempSet(0)) & " * from NC_SoftInfo where " & findword & " And islock = 0 "
		SQL = SQL & " order by softTime desc,softid desc"
	end if
	if  Action = "Hy"  then

		if len(MaterialClassCode) > 2 then
			if len(MaterialClassCode) < 4 then
	    	MaterialClassCode = "and Left(MaterialClassCode, 4) = " & MaterialClassCode & " "
			else
	    	MaterialClassCode = "and MaterialClassCode = "& MaterialClassCode &" "
			end if
		else
	    	MaterialClassCode = ""
		end if
		
		if CategoryId = 0 then
		CategoryId = ""
		else
		CategoryId = "and CategoryId = "& CategoryId &""
		end if

		findword = "Company like '%" & keyword & "%'"
		SQL = "select Top " & CInt(DownsysClass.TempSet(0)) & " * from NC_User where " & findword & " " & MaterialClassCode & " " & CategoryId & "  And islock = 0 "
		SQL = SQL & " order by userid desc"
	end if
	SoftType = Split(DownsysClass.Setting(35), ",")
	For ii = 0 To UBound(SoftType)
	if  Action = "soft"& ii &"" then
		findword = "SoftName like '%" & keyword & "%'"
		if CategoryId = 0 then
		sortid = ""
		else
		sortid = "and rootid = "& CategoryId &""
		end if
		
		if postTime = 0 then
		postTime = ""
		else
		postTime = "and SoftTime >= GETDATE() - "& postTime &""
		end if 
		Set Rss1 = Server.CreateObject("adodb.recordset")
		SQLs1 = "select * from MaterialClass where MaterialClassCode = "& MaterialClassCode &" "
		Rss1.Open SQLs1, conn, 1, 1
		Description = Rss1("Description")
		if MaterialClassCode = 01 then
		MaterialClassCode = ""
		else
		MaterialClassCode = "and MaterialClassCode like '%" & Description & "%'"
		end if
		Rss1 close
		SQL = "select Top " & CInt(DownsysClass.TempSet(0)) & " * from NC_SoftInfo where " & findword & " " & sortid & " " & postTime & " "& MaterialClassCode &"  And SoftType like '%" & Trim(SoftType(ii)) & "%' And islock = 0 "
		SQL = SQL & " order by softTime desc,softid desc"
	end if
	Next
	if  Action = "info"  then
		findword = "title like '%" & keyword & "%'"
		SQL = "select Top " & CInt(DownsysClass.TempSet(0)) & " * from NC_Article where " & findword & " And islock = 0 "
		SQL = SQL & " order by InfoTime desc,id desc"
	End if
End If
Rs.Open SQL, conn, 1, 1
If Rs.EOF And Rs.bof Then
	Response.Write ("<script>alert('" & DownsysClass.TempSet(4) & "');history.go(-1)</script>")
	Err.Raise -19691969
Else
	totalnumber = Rs.recordcount
	If (totalnumber Mod maxperpage) = 0 Then
		Pcount = totalnumber \ maxperpage
	Else
		Pcount = totalnumber \ maxperpage + 1
	End If
	Rs.MoveFiRst
	If CurrentPage > Pcount Then CurrentPage = Pcount
	If CurrentPage < 1 Then CurrentPage = 1
	Rs.Move (CurrentPage - 1) * maxperpage
	bookmark = Rs.bookmark
	i = 0
	j = (CurrentPage - 1) * maxperpage + 1
	If Action = "soft" Then
		temphtml = temphtml & DownsysClass.temphtml(1)
	End If
	If Action = "Hy" Then
		temphtml = temphtml & DownsysClass.temphtml(6)
	End If
		SoftType = Split(DownsysClass.Setting(35), ",")
	For ii = 0 To UBound(SoftType)
	If Action = "soft"& ii &"" Then
		temphtml = temphtml & DownsysClass.temphtml(1)
	End If
	Next
	If Action = "info" Then
		temphtml = temphtml & DownsysClass.temphtml(3)
	End If

	Do While Not Rs.EOF And i < CLng(maxperpage)
		if Action = "soft" then
			temphtml = temphtml & DownsysClass.TempSet(5)
			temphtml = temphtml & DownsysClass.temphtml(2)
			temphtml = temphtml & DownsysClass.TempSet(6)
			Soft_Img = Rs("SoftImg")
			Soft_Name = Replace(Rs("SoftName"), "" & keyword & "", "<font color=red>" & keyword & "</font>") & " " & Rs("SoftVer")
			If CInt(DownsysClass.Setting(5)) = 0 Then
				SoftImg = "<a href='Software/catalog" & Rs("sortid") & "/" & Rs("SoftID") & ".html'><IMG src=" & Soft_Img & " onload='javascript:if(this.height>this.width){this.height=64}else{this.width=64}'  border='0'></a>"
				SoftName = "<a href='Software/catalog" & Rs("sortid") & "/" & Rs("SoftID") & ".html'>" & Soft_Name & "</a>"
			Else
				SoftImg = "<a href='Software.Asp?id=" & Rs("SoftID") & "'><IMG src=" & Soft_Img & " onload='javascript:if(this.height>this.width){this.height=64}else{this.width=64}'  border='0'></a>"
				SoftName = "<a href='Software.Asp?id=" & Rs("SoftID") & "'>" & Soft_Name & "</a>"
			End If
			
					If i mod 2 = 0 then
				    thiscolor = "#FFFFFF"
					Else
				    thiscolor = "#F6F6F6"
				    End If

		end if
		if Action = "Hy" then
			temphtml = temphtml & DownsysClass.temphtml(7)
			Soft_Name = Replace(Rs("Company"), "" & keyword & "", "<font color=red>" & keyword & "</font>") 
			If CInt(DownsysClass.Setting(5)) = 0 Then
				Company = "<a href='Pageware/" & Rs("MaterialClassCode") & "/" & Rs("userid") & ".html'>" & Soft_Name & "</a>"
			Else
				Company = "<a href='Pageware/" & Rs("MaterialClassCode") & "/" & Rs("userid") & ".html'>" & Soft_Name & "</a>"
			End If
					If i mod 2 = 0 then
				    thiscolor = "#FFFFFF"
					Else
				    thiscolor = "#F6F6F6"
				    End If
				IF Rs("MaterialClassCode") <> "" then 
						Set Rs5 = CreateObject("Adodb.recordset")
						SQL5 = "select * from MaterialClass where MaterialClassCode = "&(Left((Rs("MaterialClassCode")), 4)) &""
						Rs5.Open SQL5, Conn, 1, 1
						Set Rs6 = CreateObject("Adodb.recordset")
						SQL6 = "select * from MaterialClass where MaterialClassCode = "& Rs("MaterialClassCode") &""
						Rs6.Open SQL6, Conn, 1, 1
						MaterialClassCode1 = ""& Rs5("Description") &"-"& Rs6("Description") &""
				Else
						MaterialClassCode1 = "信息不详"
				End if
				Rs5.Close
				Rs6.Close
		end if
		
	SoftType = Split(DownsysClass.Setting(35), ",")
	For ii = 0 To UBound(SoftType)
	if  Action = "soft"& ii &"" then
			temphtml = temphtml & DownsysClass.TempSet(5)
			temphtml = temphtml & DownsysClass.temphtml(2)
			temphtml = temphtml & DownsysClass.TempSet(6)
			Soft_Img = Rs("SoftImg")
			Soft_Name = Replace(Rs("SoftName"), "" & keyword & "", "<font color=red>" & keyword & "</font>") & " " & Rs("SoftVer")
			If CInt(DownsysClass.Setting(5)) = 0 Then
				SoftImg = "<a href='Software/catalog" & Rs("sortid") & "/" & Rs("SoftID") & ".html'><IMG src=" & Soft_Img & " onload='javascript:if(this.height>this.width){this.height=64}else{this.width=64}'  border='0'></a>"
				SoftName = "<a href='Software/catalog" & Rs("sortid") & "/" & Rs("SoftID") & ".html'>" & Soft_Name & "</a>"
			Else

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -