📄 default.asp
字号:
<!--#include file="Conn.asp"-->
<!--#include file="public.asp"-->
<%
function HTMLEncodeNO(fString)
if fString <> "" and Not isnull(fString) Then
fString = Replace(fString, "<", ",")
fString = Replace(fString, "/>", ",")
fString = Replace(fString, ">", ",")
End IF
HTMLEncodeNO = fString
end function
ThenURL = Split(Request.ServerVariables("QUERY_STRING"), "&")
'===================================================读取
DIM Searchkey
DIM nextkey
DIM page
DIM C
DIM O
Searchkey = KeyArr(Trim(Request("q"))) '关键词
O = Trim(Request.QueryString("O")) '排序
CS = TRIM(Request.QueryString("CS")) '本类中搜索
IF CS = "Yes" THEN
C = TRIM(Request("C")) '分类
end if
'========================================================================================
page = Request.QueryString("page") '分页
O = Trim(Request.QueryString("O")) '排序
T = Request.QueryString("T") '显示条数
E = Trim(Request.QueryString("E")) '显示模式
IF isnull(T) or T = "" then
T = 20
end if
if isnull(page) or page="" then
page=1
end if
nextkey = replace(searchkey," ","+")
'=========================================函数
function SearchEncode(fString)
if fString<>"" and not Isnull(fString) then
fStringlen_1 = len(fString)
fStringlen_2 = len(Replace(fString,"<",""))
fStringlen_3 = fStringlen_1 - fStringlen_2
For i = 0 to fStringlen_3
fStringlen = len(fString)
fStringopen = instr(fString,"<")
fStringend = instr(Right(fString,fStringlen-fStringopen),">")
IF fStringopen > 0 and fStringend > 0 Then
fString_1 = Mid(fString,fStringopen,fStringend+1)
End IF
IF fString_1 <> "" Then
fString = Replace(fString,fString_1,"")
End IF
Next
end if
if Searchkey<>"" and not isnull(Searchkey) then
if len(fString) > 150 then
Searchkey_1=split(Searchkey, " ")
for i = 0 to ubound(Searchkey_1)
Searchkey_2=Searchkey_1(i)
Searchkey_3 = Instr(fString,Searchkey_2)
next
L = Searchkey_3 - 60
IF L < 1 THEN
L = 1
END IF
fString = mid(fString,L,150)
end if
Searchkey_1=split(Searchkey, " ")
fString_2 = ""
fStringStr = false
for i = 0 to ubound(Searchkey_1)
Searchkey_2=Searchkey_1(i)
if not isnull(fString_2) and fString_2 <> "" then
fString_3 = split(fString_2, "|")
for abc = 1 to ubound(fString_3)
fString_4 = fString_3(abc)
if fString_4 = Searchkey_2 then
fStringStr = true
end if
next
end if
if fStringStr = false and fString<>"" and not Isnull(fString) then
fString = replace(fString,Searchkey_2,"<font color=red>"& Searchkey_2 &"</font>")
end if
fString_2 = fString_2 &"|"&Searchkey_2
next
else
fString = left(fString,150)
end if
SearchEncode = fString
end function
'=================================
function Is_odd(num)
n=num mod 2
if n=1 then
Is_odd=true
else
Is_odd=false
end if
end function
'=================================================================================
ClassArr = ""
ThenTemp_C = "CS=Yes&"
For Each g In ThenURL
IF g <>"" then
gg = Split(g, "=")
if gg(0) <> "C" AND gg(0) <> "S" and gg(0) <> "submit" and gg(0) <> "S1" and gg(0) <> "CS" THEN
ThenTemp_C = ThenTemp_C & gg(0) & "="& gg(1) &"&"
end if
end if
Next
IF C = "" Then
Set Rs = Conn.Execute("Select * From MyClass Where ShopNumberID = '"& ShopNumberID &"' AND LagID=0")
Else
Set Rs = Conn.Execute("Select * From MyClass Where ShopNumberID = '"& ShopNumberID &"' and PartID = '"& C &"'")
End IF
While Not Rs.eof
ClassArr = ClassArr & " · <a href = Default.asp?"& ThenTemp_C &"C="& Rs("NumberID") &">"& Rs("Class") &"</a><br>"
Rs.MoveNext
Wend
Rs.Close
Set Rs = Nothing
NavigationArr = "<a href=./ class=none1>"& ShopName &"</a> > <a href=./ class=none1>商品列表</a>"
IF Not Isnull(C) and C <> "" Then
N = len(C)/3
x = 0
For i = 1 to N
x = x + 3
IF x > 2 Then
Set Rs = Conn.Execute("Select * From MyClass where ShopNumberID = '"& ShopNumberID &"' and NumberID = '"& Left(C,x) &"'")
IF Not (rs.bof and rs.bof) Then
NavigationArr = NavigationArr &" > <a href=./?CS=Yes&C="& Left(C,x) &" class=none1>"& Rs("Class") &"</a>"
End if
Rs.Close
Set Rs = Nothing
End IF
Next
End IF
Dim LinkArr
Set Rs = Conn.Execute("Select * From Link Where LinkType = 'text' and ShopNumberID = '"& ShopNumberID &"' Order By LinkOrder")
While Not Rs.Eof
LinkArr = LinkArr & "·<a href="& Rs("LinkURL") &" target=_blank>"& Rs("LinkName") &"</A><br>"
Rs.MoveNext
Wend
Rs.Close
Set Rs = Nothing
Dim LinkArr_p
Set Rs = Conn.Execute("Select * From Link Where LinkType = 'pic' and ShopNumberID = '"& ShopNumberID &"' Order By LinkOrder")
While Not Rs.Eof
LinkArr_p = LinkArr_p & "<a href="& Rs("LinkURL") &" target=_blank><img src="& ViewImageFile &"?w=120&h=100&picUrl="& Rs("LinkName") &" border=0></A><br><br>"
Rs.MoveNext
Wend
Rs.Close
Set Rs = Nothing
'=============================================================================叛断
'---------------------------------------------------分类
if C <> "" and not isnull(C) then
SQLC = "MyClass like '"& C &"%' and "
end if
'---------------------------------------------------排序
Select Case O
'价格从低到高
Case "L"
SQLO = "Price,Good Desc,EditTime Desc,Product.DateTime Desc"
'价格从高到低
Case "H"
SQLO = "Price Desc,Good Desc,EditTime Desc,Product.DateTime Desc"
Case "TH"
SQLO = "EditTime,Product.DateTime,Good Desc"
Case "TL"
SQLO = "EditTime Desc,Product.DateTime Desc,Good Desc,"
End Select
if isnull(SQLO) or SQLO="" then
SQLO = "Good Desc,EditTime Desc,Product.DateTime Desc"
end if
'---------------------------------------------------搜索内容
Searchkeytmp = split(Searchkey," ")
max = ubound(Searchkeytmp)
if max=0 then
sql = sql & "(ProductName like '%"&Searchkey&"%' or Goods_Key like '%"&Searchkey&"%' or Brand like '%"&Searchkey&"%' or Spec like '%"&Searchkey&"%' or Content like '%"&Searchkey&"%') "
else
for i=0 to max
if i < max then
sql = sql & "(ProductName like '%"&searchkeytmp(i)&"%' or Goods_Key like '%"&searchkeytmp(i)&"%' or Brand like '%"&searchkeytmp(i)&"%' or Spec like '%"&searchkeytmp(i)&"%' or Content like '%"&searchkeytmp(i)&"%') and "
else
sql = sql & "(ProductName like '%"&searchkeytmp(i)&"%' or Goods_Key like '%"&searchkeytmp(i)&"%' or Brand like '%"&searchkeytmp(i)&"%' or Spec like '%"&searchkeytmp(i)&"%' or Content like '%"&searchkeytmp(i)&"%') "
end if
next '循环结束
end if
if isNull(sql) or sql = "" then
sql = "ProductName <> ''"
end if
'=====================================================================================调用
Dim Price
Dim PCount
PCount = 0
Set rs=server.CreateObject("adodb.recordset")
SQL = "Select Product.ShopNumberID,Product.*,Product.DateTime,Shop.ShopNumberID,Shop.UserNumberID,Shop.City,Shop.Authentication,[User].UserNumberID,[User].Credit From Product,Shop,[User] where Product.ShopNumberID = Shop.ShopNumberID and Shop.UserNumberID = [User].UserNumberID and ShopAuditing>0 and Auditing=1 and Product.ShopNumberID='"& ShopNumberID &"' and "& SQLC &" "& SQL &" Order By "& SQLO &""
rs.open SQL,Conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>商品列表-<%=HTMLEncodeNO(ShopName)%>-<%=HTMLEncodeNO(ShopTitle)%>-互联之光大卖场</title>
<meta name="keywords" content="<%=HTMLEncodeNO(ShopKey)%>">
<meta name="description" content="<%=HTMLEncodeNO(ShopContent)%>">
<link href="../../../Search/images/search.css" rel="stylesheet" type="text/css">
</head>
<body>
<!--#include File="Top.asp"-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" height="24"><img src="../../../Search/images/search_5.gif" width="10" height="24"></td>
<td width="97%" align="center" valign="bottom" background="../../../Search/images/search_7.gif"><table width="82%" height="23" border="0" cellpadding="0" cellspacing="0">
<tr align="center">
<td width="18%" bgcolor="#F16507" class="text_4"><span class="text_3"><a href="./" class="link2"><span class="text_3">商品/服务展示</span></a></span></td>
<td width="12%" class="text_4"><a href="News.asp" class="link2">新闻动态</a></td>
<td width="12%" class="text_4"><a href="SeaveInfo.asp" class="link2">服务中心</a></td>
<td width="12%" class="text_4"><a href="Ask.asp" class="link2">留言反馈</a></td>
<td width="12%" class="text_4"><a href="../../../Historical/Info.asp?ID=<%=ShopNumberID%>" target="_blank" class="link2">卖家档案</a></td>
<td width="34%"> </td>
</tr>
</table>
</td>
<td width="1%" align="right"><img src="../../../Search/images/search_6.gif" width="10" height="24"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="4" bgcolor="#FF6600"></td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="63%" height="40" align="left" valign="bottom"> <%=NavigationArr%> </td>
<td width="37%" align="right" valign="bottom">
<%
For Each g In ThenURL
IF g <>"" then
gg = Split(g, "=")
if gg(0) <> "E" AND gg(0) <> "S" and gg(0) <> "submit" and gg(0) <> "S1" THEN
ThenTemp_E = ThenTemp_E & gg(0) & "="& gg(1) &"&"
end if
END IF
Next
%>
<select name="select" onChange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}">
<option value="Default.asp?<%=ThenTemp_E%>E=1" <%if E = "1" then%>Selected<%end if%>>列表模式</option>
<option value="Default.asp?<%=ThenTemp_E%>E=3" <%if E = "3" then%>Selected<%end if%>>图片模式</option>
</select>
<%
For Each g In ThenURL
IF g <>"" then
gg = Split(g, "=")
if gg(0) <> "T" AND gg(0) <> "S" and gg(0) <> "submit" and gg(0) <> "S1" THEN
ThenTemp_T = ThenTemp_T & gg(0) & "="& gg(1) &"&"
end if
END IF
Next
%>
<select name="select" onChange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}">
<option value="Default.asp?<%=ThenTemp_T%>T=10" <%if T = 10 then%>Selected<%end if%>>每页10条</option>
<option value="Default.asp?<%=ThenTemp_T%>T=20" <%if T = 20 then%>Selected<%end if%>>每页20条</option>
<option value="Default.asp?<%=ThenTemp_T%>T=30" <%if T = 30 then%>Selected<%end if%>>每页30条</option>
<option value="Default.asp?<%=ThenTemp_T%>T=40" <%if T = 40 then%>Selected<%end if%>>每页40条</option>
<option value="Default.asp?<%=ThenTemp_T%>T=60" <%if T = 60 then%>Selected<%end if%>>每页60条</option>
<option value="Default.asp?<%=ThenTemp_T%>T=80" <%if T = 80 then%>Selected<%end if%>>每页80条</option>
</select>
<%
For Each g In ThenURL
IF g <>"" then
gg = Split(g, "=")
if gg(0) <> "O" AND gg(0) <> "S" and gg(0) <> "submit" and gg(0) <> "S1" THEN
ThenTemp_O = ThenTemp_O & gg(0) & "="& gg(1) &"&"
end if
END IF
Next
%>
<select name="select" onChange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}">
<option value="Default.asp?<%=ThenTemp_O%>O=TL" <%if O = "TL" then%>Selected<%end if%>>按最近更新</option>
<option value="Default.asp?<%=ThenTemp_O%>O=TH" <%if O = "TH" then%>Selected<%end if%>>按最早更新</option>
<option value="Default.asp?<%=ThenTemp_O%>O=L" <%if O = "L" then%>Selected<%end if%>>按价格低>高</option>
<option value="Default.asp?<%=ThenTemp_O%>O=H" <%if O = "H" then%>Selected<%end if%>>按价格高>低</option>
</select></td>
</tr>
</table>
<table width="100%" height="300" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="180" valign="top">
<table width="98%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CDCDCD">
<tr>
<td bgcolor="ffffff"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" align="center" bgcolor="#FF6600"><font color="#FFFFFF" size="2"><strong>商品分类</strong></font></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td>
<%
Response.write ClassArr
%>
</td>
</tr>
</table> </td>
</tr>
</table>
<br>
<table width="98%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CDCDCD">
<tr>
<td bgcolor="ffffff"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" align="center" bgcolor="#FF6600"><font color="#FFFFFF" size="2"><strong>友情链接</strong></font></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td><%=LinkArr%></td>
</tr>
<tr>
<td align="center"><%=LinkArr_p%></td>
</tr>
</table></td>
</tr>
</table></td>
<td align="left" valign="top">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td height="1" bgcolor="#999999"></td>
</tr>
</table>
<%if E<>"2" AND E<>"3" Then %>
<!--#include File="E1.Asp"-->
<%
end if
if E = "2" Then
%>
<!--#include File="E2.Asp"-->
<%
end if
if E = "3" Then
%>
<!--#include File="E3.Asp"-->
<%
end if
rs.close
set rs=nothing
%>
</td>
</tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td height="1" bgcolor="#999999"></td>
</tr>
</table>
<!--#include file="Foot.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -