无限级分类菜单
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--#include file="inc/s.asp" -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Untitled Document</title>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
<%
sub subz(fid)
set rs1=conn.execute("select * from i_class where cid="&fid)
if not rs1.eof then
response.Write("<ul>")
do while not rs1.eof
response.Write("<li><a href=#>"&rs1("id"))
curpath(rs1("id"))
response.Write("</a>")
call subz(rs1("id"))
response.Write("</li>")
rs1.movenext
loop
response.write("</ul>")
end if
set rs1=nothing
end sub
sub curpath(id)
set rs2=conn.execute("select id,cpath from i_class where id="&id)
if not rs2.eof then
cpath=rs2("cpath")
cpath=left(cpath,len(cpath)-1)
apath=split(cpath,",")
set rs2=nothing
set rs2=conn.execute("select cname from i_class where id in ("&cpath&")")
if not rs2.eof then mypath=rs2.getrows else exit sub
set rs2=nothing
for i=0 to ubound(apath)
cname=conn.execute("select cname from i_class where id="&apath(i))(0)
response.Write(cname&">")
next
end if
end sub
%>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="23%">
<ul id="MenuBar1" class="MenuBarVertical">
<%
sql="select * from i_class where cid is null"
rs.open sql,conn,1,1
do while not rs.eof%>
<li><a class="MenuBarItemSubmenu" href="#"><%= rs("id")&rs("cname") %></a>
<% call subz(rs(0)) %>
</li>
<%
rs.movenext
loop
rs.close
%>
</ul>
</td>
<td width="77%"> </td>
</tr>
</table>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
<% endl %>
</body>
</html>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--#include file="inc/s.asp" -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Untitled Document</title>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
<%
sub subz(fid)
set rs1=conn.execute("select * from i_class where cid="&fid)
if not rs1.eof then
response.Write("<ul>")
do while not rs1.eof
response.Write("<li><a href=#>"&rs1("id"))
curpath(rs1("id"))
response.Write("</a>")
call subz(rs1("id"))
response.Write("</li>")
rs1.movenext
loop
response.write("</ul>")
end if
set rs1=nothing
end sub
sub curpath(id)
set rs2=conn.execute("select id,cpath from i_class where id="&id)
if not rs2.eof then
cpath=rs2("cpath")
cpath=left(cpath,len(cpath)-1)
apath=split(cpath,",")
set rs2=nothing
set rs2=conn.execute("select cname from i_class where id in ("&cpath&")")
if not rs2.eof then mypath=rs2.getrows else exit sub
set rs2=nothing
for i=0 to ubound(apath)
cname=conn.execute("select cname from i_class where id="&apath(i))(0)
response.Write(cname&">")
next
end if
end sub
%>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="23%">
<ul id="MenuBar1" class="MenuBarVertical">
<%
sql="select * from i_class where cid is null"
rs.open sql,conn,1,1
do while not rs.eof%>
<li><a class="MenuBarItemSubmenu" href="#"><%= rs("id")&rs("cname") %></a>
<% call subz(rs(0)) %>
</li>
<%
rs.movenext
loop
rs.close
%>
</ul>
</td>
<td width="77%"> </td>
</tr>
</table>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
<% endl %>
</body>
</html>