一级菜单不能联动显示,只能显示第一个,后面三个不能显示
set rs=server.createobject("adodb.recordset")sql="select top 1 [name],[folder],[id],[pid],[ppid] from [category] where ClassType=1 and ppid=1 order by [order]"
rs.open(sql),cn,1,1
if not rs.eof then
ItemID=rs("id")
WebNewNewsName=rs("name")
WebNewNewsFolderName=rs("folder")
select case rs("ppid")
case 1
ClassSQL="cid"
WebNewNewsFolder="/"&rs("folder")
case 2
ClassSQL="pid"
set rs0=server.createobject("adodb.recordset")
sql="select [name],[folder],[id],[pid],[ppid] from [category] where id="&rs("pid")
rs0.open(sql),cn,1,1
if not rs0.eof then
WebNewNewsFolder="/"&rs0("folder")&"/"&rs("folder")
end if
rs0.close
set rs0=nothing
case 3
ClassSQL="ppid"
set rs0=server.createobject("adodb.recordset")
sql="select [name],[folder],[id],[pid],[ppid] from [category] where id="&rs("pid")
rs0.open(sql),cn,1,1
if not rs0.eof then
set rs00=server.createobject("adodb.recordset")
sql="select [name],[folder],[id],[pid],[ppid] from [category] where id="&rs0("pid")
rs00.open(sql),cn,1,1
if not rs00.eof then
WebNewNewsFolder="/"&rs00("folder")&"/"&rs0("folder")&"/"&rs("folder")
end if
rs00.close
set rs00=nothing
end if
rs0.close
set rs0=nothing
end select
end if
rs.close
set rs=nothing
'content
set rs=server.createobject("adodb.recordset")
sql="select [name],[folder],[id],[pid],[ppid] from [category] where ClassType=1 and ppid=1 order by [order] "
rs.open(sql),cn,1,1
if not rs.eof then
for i=1 to rs.recordcount
WebNewNewsTitles=WebNewNewsTitles&"<li><A href='"&WebNewNewsFolder&"/"&rs("Folder")&"'>"&rs("name")&"</A></li> "
WebNewNewsList=WebNewNewsList&"<li><div class='DivList'><table class='MBlockTable' width='100%' border='0' cellspacing='0' cellpadding='0'>"
set rsp=server.createobject("adodb.recordset")
sql="select top 10 [title],file_path,[time] from [article] where ArticleType=1 and cid='"&ItemID&"' and view_yes=1 order by [time] desc"
rsp.open(sql),cn,1,1
if not rsp.eof then
do while not rsp.eof
rs_url=""
rs_url=ArticleContent_FolderName&"/"&rsp("file_path")
WebNewNewsList=WebNewNewsList&"<tr><td width='82%'>· <a href='"&rs_url&"' target='_blank' title='"&rsp("title")&"'>"&left(rsp("title"),28)&"</a></td>"
WebNewNewsList=WebNewNewsList&"<td width='18%'><span>"&year(rsp("time"))&"/"&month(rsp("time"))&"/"&day(rsp("time"))&"</span></td></tr>"
rsp.movenext
loop
end if
rsp.close
set rsp=nothing
WebNewNewsList=WebNewNewsList&"</table><div class='clearfix'></div></div></li>"
rs.movenext
next
end if
rs.close
set rs=nothing
replace_code=replace(replace_code,"$WebNewNewsTitles$",WebNewNewsTitles)
replace_code=replace(replace_code,"$WebNewNewsList$",WebNewNewsList)
replace_code=replace(replace_code,"$WebNewNewsFolder$",WebNewNewsFolder)
[此贴子已经被作者于2017-11-9 13:19编辑过]