最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp无限级分类支持js收缩伸展
时间:2022-07-02 22:33:12 编辑:袖梨 来源:一聚教程网
<%
catstr=""
depath=0
Call cat111(0,0,2)
%>
<%=catstr%> |
<%
function cat111(parent_id,tid,stype)
set rs1 =server.createobject("adodb.recordset")
sql="select cat_name,cat_id,parent_id from category where parent_id="&parent_id&" and u_id="&stype&" and is_show=1 order by cat_order asc"
set rs1=conn.execute(sql)
If rs1.eof Then
Else
if(depath>2) then
display2="none"
else
display2="block"
end if
dim j
j=1
do while not rs1.eof
cat_name1 = rs1("cat_name")
cat_id1 = rs1("cat_id")
parent_id1=rs1("parent_id")
'******************下面是你要显示的******************'
m9=0
sql2="select count(cat_id) as t from category where parent_id="&cat_id1&" and u_id="&stype&""
set rs2=server.createobject("adodb.recordset")
set rs2=conn.execute(sql2)
if not rs2.eof then
m9=rs2("t")
else
m9=0
end if
rs2.close
if(depath<=2) then
mgif="images/-.gif"
a="block"
else
if(m9>0) then
mgif="images/+.gif"
else
mgif="images/-.gif"
end if
if(depath=4) Then
a="block"
else
a="none"
end if
end If
If cat_id1=8 or cat_id1=10 Then
a="block"
mgif="images/+.gif"
ElseIf cat_id1>82 Then
a="none"
mgif="images/-.gif"
else
End if
catstr=catstr & "
for i=1 to depath
catstr=catstr&" "
Next
catstr=catstr&" "
if(m9>0) then
catstr=catstr&"" &vbnewline
else
catstr=catstr&""&vbnewline
end if
If depath=0 Then
cat_name1=""&cat_name1&""
End If
catstr=catstr&cat_name1&"
m9=0
sql2="select cat_name,cat_id from category where parent_id="&parent_id1&" and u_id="&stype&" order by cat_order asc"
set rs2=server.createobject("adodb.recordset")
set rs2=conn.execute(sql2)
if not rs2.eof then
depath=depath+4
call cat111(cat_id1,tid,stype)
end if
rs2.close
set rs2=nothing
depath=depath-4
'******************上面是你要显示的******************'
j=j+1
rs1.movenext
loop
End If
rs1.close
set rs1=nothing
end Function
%>
数据库教程连接文件adoconn.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
response.Charset="utf-8"
response.codepage="65001"
DB="db1.mdb"
path=Server.MapPath(DB)
set conn=server.createobject("adodb.Connection")
connstr="provider=Microsoft.Jet.OLEDB.4.0;Data Source="&path
conn.Open connstr
Set rs=server.CreateObject("adodb.recordset")
%>
相关文章
- 《真三国无双:起源》反击方法 11-25
- 《真三国无双:起源》武艺使用方法 11-25
- 《潜行者2:切尔诺贝利之心》手动存档方法介绍 11-25
- 《潜行者2:切尔诺贝利之心》支线任务盗亦无道攻略 11-25
- 《真三国无双:起源》回避作用分享 11-25
- 《潜行者2:切尔诺贝利之心》战役存档槽作用介绍 11-25