<!--#include file = admin_conn.asp -->
<!--#include file = news_list.asp -->
<!--#include file = titleb.asp -->
<%
'本页的页首，页尾，全部读取后台模版中的系统搜索模版！
lm2 =trim(request("lm2"))
lm=trim(request("lm"))
if lm2="" then lm2=lm
if lm="" then lm=lm2
if lm2="" then lm2=0
tj=trim(chkhtm(request("tj")))
tcolor=trim(chkhtm(request("tcolor")))
lryname=trim(chkhtm(request("lryname")))
xsuser=trim(chkhtm(request("xsuser")))

if (not isNumeric(lm)) then
	lm=0
end if
if tcolor="" then tcolor="999999"


  sql2 = "select * from lm where id="&lm2
  Set rs2 = Server.CreateObject("ADODB.RecordSet")
  rs2.Open sql2,conn,1,1
   if rs2.recordcount=0 then
	  sql2 = "select * from lm order by id asc"
	  Set rs2 = Server.CreateObject("ADODB.RecordSet")
	  rs2.Open sql2,conn,1,1
   end if
   if rs2.recordcount <> 0 then
     mb=trim(rs2("mb"))
     lmm=rs2("lm")&rs2("lm2")&rs2("lm3")
     'Response.Write lmm
     if lm2="0" then lmm="所有栏目"
     if lm2="0" and tj="1" then lmm="所有推荐的信息"
     if mb<>"" then

     sql3 = "select * from newsmb where id="&clng(mb)
     Set rs3 = Server.CreateObject("ADODB.RecordSet")
     rs3.Open sql3,conn,1,1
     if rs3.recordcount=0 then
     	set rs3 = Server.CreateObject("ADODB.RecordSet"):rs3.cursorlocation=3
     	rs3.Open "select * from [newsmb] where lx=1 order by id asc",conn,1,1
     end if
     
     if rs3.recordcount<>0 then
	     listmb=rs3("listmb")
	     listshu=rs3("list")
	     tb=rs3("tb")
	     lmnameid=rs3("lmname")
	     newstime=rs3("newstime")
	     NewsTimeColor=rs3("NewsTimeColor")
	     newshit=rs3("newshit")
	     openwindow=rs3("openwindow")
	     ListTD=rs3("ListTD")
	     if (not isNumeric(ListTD)) then ListTD=1
	     NewsListPageLanguage=rs3("NewsListPageLanguage")
	     icon=rs3("icon")
	     ListTitleHJ=rs3("ListTitleHJ")
	     ListTitleSize=rs3("ListTitleSize")
	     listmb=replace(listmb,"$$栏目名$$",lmm)
	     listmb=replace(listmb,"$$路径$$",lmaa())
	     listmb=replace(listmb,"$$LMID$$",trim(request("lm2")))
	     listmb=replace(listmb,"$$XUASPATH$$",Config("Path"))
		 else
		    Response.Write "模版设置不正确或已经被删除!"
		 end if     
	     if instr(listmb,"$$列表$$")<>0 then
		     nr=split(listmb,"$$列表$$")
		     Response.Write lmid
		     response.write nr(0)
		     
		     Response.Write newslist(listshu,tb,lmnameid,openwindow,icon)
		     Response.Write nr(1)
		 else
			 Response.Write "模版代码不正确，没有找到“$$列表$$”，不知道应该显示在哪里？"
		 end if
		 rs3.close:set rs3=nothing
	  else
	  	Response.Write "模版代码不正确或已经被删除!"
	  end if
	  
   else
     Response.Write "模版没有找到或者没有设置"
   end if
%>
<%
conn.close:set conn=nothing
%>