<!--#include file = admin_conn.asp -->
<!--#include file = language.asp -->
<!--#include file = titleb.asp -->

<%
ztid=trim(Request("ztid"))

if (not isNumeric(ztid)) then
  Response.Write "<Script Language=JavaScript>alert('ＩＤ参数错误或有非法字符或没指定参数.');location.href='/';</Script>"
  response.end  
end if

set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select * from [Newszt] where ID="&ZTID&" order by id desc",conn,1,1

if rs.recordcount<>0 then
	ZTtitle=rs("title")
	ZTmb=rs("mb")
	zticon=rs("icon")
end if
rs.close:set rs=nothing

function newslist()


		n=trim(request("n"))
		list=trim(request("list"))
		more=trim(request("more"))
		lmname=trim(Request("lmname"))
		if lmname="" then lmname=0
		if n="" then n=40
		n=int(n)
		if list="" then list=10
		if more="" then more=1
		if openwindow="0" then
		   openwindow=" target=_top "
		else
		   openwindow=" target=_blank  "
		end if


		lm=trim(request("lm"))
		lm2=trim(request("lm2"))
		
		if lm="" then lm=lm2
		if lm2="" then lm2=lm
		
		word=trim(request("word"))
		
		sql= "select * from news where title<>'' and sh=1 and ztid="&ztid&" "
	    sql=sql & " order by ontop desc , id desc"

		%>
		<div align="center">
			<table border="0" cellpadding="0" cellspacing="0" width="100%">
				
		<%
		Set rs = Server.CreateObject("ADODB.RecordSet")
		rs.Open sql,conn,1,1
		if rs.recordcount<>0 then 
		
		page=int(request.QueryString ("page"))
		rs.PageSize=20
		pagecount=rs.pagesize
		if page<=0 then page=1
		if request.QueryString("page")="" then page=1
		rs.AbsolutePage=page
		
		    for i=1 to pagecount
		    
		    %>
		    <tr>
					<td align=center style='line-height:<%=moreline%>pt'>
		    <%
		    lm2=rs("lm3")
		     if lm2="0" or lm2="" then lm2=rs("lm2")
		        if lm2="0" or lm2="" then lm2=rs("lm")
		         sql2 = "select * from lm where id="&lm2
		         Set rs2 = Server.CreateObject("ADODB.RecordSet")
		         rs2.Open sql2,conn,1,1
		         lm=rs2("lm")&rs2("lm2")&rs2("lm3")
		         pic=rs2("pic")
		         
					   if rs("titlecolor")="默认颜色" or rs("titlecolor")="" then
					     fontcolor=rs2("fontcolor")
					   else
					     fontcolor=rs("titlecolor")
					   end if
		
		    %>
		      <%=zticon%></td><td align=left style='line-height:<%=moreline%>pt'><%if lmname="1" then response.write "[<a href=news_more.asp?lm2="&rs2("id")&">"&lm&"</a>]&nbsp;"%><a href="news_view.asp?newsid=<%=rs("id")%>" <%=openwindow%>><font color="<%=trim(fontcolor)%>"><%=titleb(rs("title"),n)%></font></a>
		      <font color=999999>
		      <%
				if newshit="1" then response.write "阅读:"&rs("hit")
		        if trim(rs("pic"))<>"" and pic="1" then Response.Write "[图]"
		      %>
		      </td><td>
		      <%
		        if newstime="1" then response.write "("&formatdatetime(rs("time"),1)&")"
		      %>
		      </font>
		      </td></tr>
		    <%
		    rs.movenext
		    if rs.eof then exit for
		    next
		else
		  response.write "<center><BR><BR><BR>无记录<BR><BR><BR><BR>"
		end if
		%>
		</table><BR><center>
		<%
		if rs.recordcount<>0 then
		  if page>1 then%>
		     <a href='<%=request.servervariables("URL")%>?page=1&word=<%=word%>&lm=<%=trim(request("lm"))%>&lm2=<%=trim(request("lm2"))%>&lmname=<%=trim(request("lmname"))%>&open=<%=trim(request("open"))%>&n=<%=trim(request("n"))%>&hot=<%=trim(request("hot"))%>&tj=<%=trim(request("tj"))%>&ztid=<%=ztid%>'>首页</a>
		     <a href='<%=request.servervariables("URL")%>?page=<%=page-1%>&word=<%=word%>&lm=<%=trim(request("lm"))%>&lm2=<%=trim(request("lm2"))%>&lmname=<%=trim(request("lmname"))%>&open=<%=trim(request("open"))%>&n=<%=trim(request("n"))%>&hot=<%=trim(request("hot"))%>&tj=<%=trim(request("tj"))%>&ztid=<%=ztid%>'>上一页</a>
		  <%end if%>
		  <%if page<rs.pagecount then%>
		     <a href='<%=request.servervariables("URL")%>?page=<%=page+1%>&word=<%=word%>&lm=<%=trim(request("lm"))%>&lm2=<%=trim(request("lm2"))%>&lmname=<%=trim(request("lmname"))%>&open=<%=trim(request("open"))%>&n=<%=trim(request("n"))%>&hot=<%=trim(request("hot"))%>&tj=<%=trim(request("tj"))%>&ztid=<%=ztid%>'>下一页</a>
		     <a href='<%=request.servervariables("URL")%>?page=<%=rs.pagecount%>&word=<%=word%>&lm=<%=trim(request("lm"))%>&lm2=<%=trim(request("lm2"))%>&lmname=<%=trim(request("lmname"))%>&open=<%=trim(request("open"))%>&n=<%=trim(request("n"))%>&hot=<%=trim(request("hot"))%>&tj=<%=trim(request("tj"))%>&ztid=<%=ztid%>'>尾页</a>
		  <%end if%>
		　共<%=rs.recordcount%>条　每页显示<%=pagecount%>条　　第<%=page%>页　共<%=rs.pagecount%>页				
		    <script language="JavaScript">
		      <!--
		       function FP_jumpMenu(el,frm,sel) {//v1.0
		       var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
		       if('_new'==frm) open(href); else eval(frm+".location='"+href+"'");
		        }
		       // -->
		     </script>
		
		   <select size="1" onchange="FP_jumpMenu(this,'window',false)" id="id1" name="D1" style="font-size: 9pt; border-style: solid; border-width: 1px">
		        <%for i=1 to rs.pagecount%>
		          <option value="<%=request.servervariables("URL")%>?page=<%=i%>&word=<%=word%>&lm=<%=trim(request("lm"))%>&lm2=<%=trim(request("lm2"))%>&lmname=<%=trim(request("lmname"))%>&open=<%=trim(request("open"))%>&n=<%=trim(request("n"))%>&hot=<%=trim(request("hot"))%>&tj=<%=trim(request("tj"))%>&ztid=<%=ztid%>" <%if page=i then response.write "selected"%>>第<%=i%>页</option>
		        <%next%>
		    </select>
		</p>
		<%end if
end function


'ztmb=replace(ztmb,"&&列表&&",newslist())
ztmb=replace(ztmb,"$$专题名$$",ZTtitle)
ztmb=replace(ztmb,"$$ZTID$$",ZTID)

	     if instr(ztmb,"$$列表$$")<>0 then
		     nr=split(ztmb,"$$列表$$")
		     response.write nr(0)
		     Response.Write newslist()
		     Response.Write nr(1)
		 else
			 Response.Write "模版代码不正确，没有找到“$$列表$$”，不知道应该显示在哪里？"
		 end if
		 
'Response.Write ztmb
conn.close:set conn=nothing
%>