document.write("<head><meta http-equiv='Content-Language' content='zh-cn'><meta http-equiv='Content-Type' content='text/html; charset=gb2312'></head>");

<%
lmid=trim(request("lm"))
lmname=trim(request("lmname"))
n=trim(request("n"))
list=trim(request("list"))
more=trim(request("more"))
open=trim(request("open"))
bg=trim(request("bg"))
hot=trim(request("hot"))
tj=trim(request("tj"))
ord=trim(request("ord"))
fs=trim(request("fs"))
t=trim(request("t"))
if bg="" then bg="ffffff"
if lmname="" then lmname=0
'if lmid=0 then lmid=""
if n="" then n=20
if list="" then list=10
if more="" then more=1
if open="" then open=1
if ord="" then ord="asc"
if lmid="" then lmid=0
if t="" then t=0
if hot="" then hot=0
if tj="0" then
  tj="不推荐"
else
  tj="推荐"
end if
%>
<!--#include file = admin_conn.asp -->

					  <%
					  Set rs = Server.CreateObject("ADODB.RecordSet")
					  rs.Open "select path from [config]",conn,1,1
					  path=rs("path")
					  rs.close
					  set rs=nothing
if fs="1" then			  
					  sql = "select * from lm where lm<>'' "
					   if lmid<>"0" then sql=sql&" and id="&lmid&" "
					  sql=sql&" order by id "&ord&""
					  Set rs = Server.CreateObject("ADODB.RecordSet")
					  rs.Open sql,conn,1,1
					  while not rs.eof
					  id=rs("id")
					  lm=rs("lm")
					  %>
							document.write("<a href=<%=path%>news_more.asp?lm=<%=id%> target=_blank title='<%=lm%>'><B><%=lm%></b></a>");
					 <%
					         sql11 = "select id,lm,lm2 from news where lm='"&rs("ID")&"' or lm2='"&rs("ID")&"' order by id "&ord&" "
					         Set rs11 = Server.CreateObject("ADODB.RecordSet")
					         rs11.Open sql11,conn,1,1
					 %>
							document.write("<font color=999999>(<%=rs11.recordcount%>)</font><BR>");
					 <%
							sql2 = "select * from lm where lmid='"&rs("id")&"' order by id asc"
							Set rs2 = Server.CreateObject("ADODB.RecordSet")
							rs2.Open sql2,conn,1,1
							while not rs2.eof
							id2=rs2("id")
							lm2=rs2("lm2")
					 %>		
							document.write("&nbsp;├<a href=<%=path%>news_more.asp?lm2=<%=id2%>&lmname=0&open=1&n=30&tj=0&hot=0 target=_blank title='<%=lm2%>'><%=lm2%></a>");
					 <%
									sql3 = "select id,lm,lm2 from news where lm2='"&rs2("id")&"' or lm='"&rs2("id")&"'"
									Set rs3 = Server.CreateObject("ADODB.RecordSet")
									rs3.Open sql3,conn,1,1	
					 %>
							document.write("<font color=999999>(<%=rs3.recordcount%>)</font><BR>");
					 <%
							   		rs3.close
							   		set rs3=nothing
							rs2.movenext
							wend
							rs2.close
							set rs2=nothing
					  rs.movenext
					  wend 
					  rs.close
					  set rs=nothing
elseif fs="2" then
  	sql="select * from [lm] where lm2<>'' "
  	 if lmid<>"0" then sql=sql&" and lmid='"&lmid&"' "
  	sql=sql&" order by id "&ord&" "
	Set rs = Server.CreateObject("ADODB.RecordSet")
	rs.Open sql,conn,1,1
	while not rs.eof
	id=rs("id")
	lm2=rs("lm2")
	%>
	document.write("&nbsp;<a href=<%=path%>news_more.asp?lm2=<%=id%>&lmname=0&open=1&n=30&tj=0&hot=0 target=_blank title='<%=lm2%>'><%=lm2%></a>");
	<%
	rs.movenext
	wend
	
	
elseif fs="3" then
  	sql="select * from [lm] where lm<>'' "
  	 
  	sql=sql&" order by id "&ord&" "
	Set rs = Server.CreateObject("ADODB.RecordSet")
	rs.Open sql,conn,1,1
	while not rs.eof
	id=rs("id")
	lm2=rs("lm")
	%>
	document.write("<a href=<%=path%>news_more.asp?lm2=<%=id%>&lmname=0&open=1&n=30&tj=0&hot=0 target=_blank title='<%=lm2%>'><%=lm2%></a>&nbsp;");
	<%
	rs.movenext
	wend
	rs.close
	set rs=nothing
elseif fs="4" and trim(request("lm"))<>"" then
	lmid=trim(request("lm"))
	set rs = Server.CreateObject("ADODB.RecordSet")
	rs.Open "select * from [lm] where lmid='"&lmid&"' order by id desc",conn,1,1
	while not rs.eof
	 	lm2=rs("id")
	 	lmname=rs("lm2")
	%>
			document.write("<li><a href=<%=path%>news_more.asp?lm2=<%=lm2%>&lmname=0&open=1&n=30&tj=0&hot=0 target=_blank title='<%=lmname%>'><font color='<%=color%>'><%=lmname%></font></a><BR>");
	<%
	rs.movenext
	wend
	if rs.recordcount=0 then
		Response.Write "document.write(""<BR>无子栏目<BR><BR>"");"
	end if
	rs.close
	set rs=nothing
end if					 
					%> 
