

<head>
<!--#include file = language.asp -->
<style>
<!--
a:link       { font-family: 宋体; color: #000000;text-decoration: none; }
a:visited    { color: #000000; font-family: 宋体; text-decoration: none; }
a:hover      { font-family: 宋体; color: #000000;TEXT-DECORATION: underline; }
body         { font-family: 宋体; color: #000000; }
p            { color: #000000; font-family: 宋体}
td           { font-family: 宋体; color: #000000 }
input        { font-family: 宋体; color: #000000 }

-->
</style>
</head>

<%
lmid=trim(request("lm"))
lm2=trim(request("lm2"))
if lmid="" then lmid=lm2
if lm2="" then lm2=lmid
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"))
week=trim(Request("week"))
hit=trim(request("hit"))
font=trim(Request("font"))
t=trim(request("t"))
news=trim(request("news"))
line=trim(Request("line"))
icon=trim(request("icon"))
if bg="" then bg="ffffff"
%>
<Body bgcolor=<%=bg%> topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<%

if lmname="" then lmname=0
if lmid=0 then lmid=lm2
if lm="" then lm=0
if lm2="" then lm2=0
if n="" then n=30
if list="" then list=10
if more="" then more=1
if open="" then open=1
if t="" then t=0
if hot="" then hot=0
if font="" then font=9
if week="" then week=0
if line="" then line=12
if hit="" then hit=0
if icon="" then icon=1
ttjj=tj
week=int(week)
list=int(list)
n=int(n)

if (not isNumeric(lm2)) then
  Response.Write "<Script Language=JavaScript>alert('ＩＤ参数错误或有非法字符或没指定参数，请勿随意提交数据！');</Script>"
  response.end  
end if
%>
<!--#include file = admin_conn.asp -->
<!--#include file = titleb.asp -->
<p style="line-height: <%=line%>pt">
<%

sql = "select top "&list&" id,title,titlecolor,hit,pic,ontop,time,lm,lm2,lm3,filename,updat from news where title<>'' and sh=1 "

if more="2" then sql = "select id,title,titlecolor,hit,pic,ontop,time,lm,lm2,lm3,filename,updat from news where title<>'' and sh=1 "

if lm2<>"0" or lm<>"0" then
  sql=sql&" and (lm='"&lm2&"' or lm2='"&lm2&"' or lm3='"&lm2&"') "  
end if
if tj="1" then sql = sql & " and tj='推荐' "
 
if hot=1 then
 sql = sql&" and datediff('d',time,now())<30 order by hit desc , updat desc , id desc"
else
 sql= sql&" order by ontop desc , updat desc , id desc"
end if
'response.write sql

Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1

if rs.recordcount<>0 then

page=trim(request("page"))
if page="" then page=1
rs.PageSize=cint(list)
pagecount=rs.pagesize
if page<=0 then page=1
rs.AbsolutePage=page

for i=1 to list
    if rs.eof then exit for
   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="&clng(lm2)
   Set rs2 = Server.CreateObject("ADODB.RecordSet")
   rs2.Open sql2,conn,1,1
   lmid=rs2("lmid")
   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
%>
<% if icon="1" then %>
<font face=Wingdings style="font-size: <%=font%>pt">1</font>
<% elseif icon="0" then %>
<% else %>
<img src=<%=icon%> border=0>
<% end if %>
<%if lmname=1 then response.write "<a href=news_more.asp?lm2="&lmid&" target=_blank><font color=999999 style='font-size:"&font&"pt;line-height:"&line&"pt'>["&lm&"]</font></a>"%>
<a href="<%=hrefID(rs("ID"),rs("filename"))%>" title="<%=rs("title")%>" 
 <%
 if open="1" then 
     response.write "target=_blank"
 else
   response.write "target=_top" 
 end if
%>><font color="<%=trim(fontcolor)%>" style="font-size: <%=font%>pt"><%=titleb(rs("title"),n)%></font></a>
<%
if news="1" then

	if datediff("d",rs("time"),date())<=newsx() then 
	  Response.Write "<img src=images/new.gif>"
	end if
end if
%>
<%
if t=1 then response.write "<font color=999999 style='font-size:"&font&"pt'>("&formatdatetime(rs("time"),1)&")</font>"
if t=2 then response.write "<font color=999999 style='font-size:"&font&"pt'>("&formatdatetime(rs("time"),2)&")</font>"
if t=3 then response.write "<font color=999999 style='font-size:"&font&"pt'>("&month(rs("time"))&"月"&day(rs("time"))&"日)</font>"
if t=4 then response.write "<font color=999999 style='font-size:"&font&"pt'>("&month(rs("time"))&"-"&day(rs("time"))&")</font>"
if week=1 then response.write "<font color=999999 style='font-size:"&font&"pt'>("&weekDayName(weekday(rs("time")))&")</font>"
%>
<%
if hit="1" then response.write "<font color=999999 style='font-size:"&font&"pt'>[点击:"&rs("hit")&"]</font>"
if hit="2" then response.write "<font color=999999 style='font-size:"&font&"pt'>["&rs("hit")&"]</font>"
if trim(rs("pic"))<>"" and rs2("pic")="1" then Response.Write "<font color=99999 style='font-size:"&font&"pt'>[图]</font>"
%>
<BR>
<%
rs.movenext
if rs.eof then exit for 
next
%>
<%if more="1" then%>
	<div align=right><a href="news_more.asp?lm=<%=trim(request("lm"))%>&lm2=<%=trim(request("lm2"))%>&lmname=<%=trim(request("lmname"))%>&open=<%=trim(request("open"))%>&n=<%=trim(request("n"))%>&tj=<%=trim(request("tj"))%>&hot=<%=hot%>"
	<%
	if open="1" then
	  response.write "target=_blank"
	else
	  response.write "target=_top"
	end if
	%>
	><font style="font-size: <%=font%>pt">更多内容</font></a></div>
<%elseif more="2" then%>
	<center><font style="font-size: <%=font%>pt">
	<%
	if rs.recordcount<>0 then
	page=int(page)
	lmid=trim(Request("lm2"))
	  if page>1 then%>
	     <a href='<%=request.servervariables("URL")%>?page=1&lm2=<%=lmid%>&hot=<%=hot%>&tj=<%=ttjj%>&t=<%=t%>&week=<%=week%>&font=<%=font%>&line=<%=line%>&lmname=<%=lmname%>&n=<%=n%>&list=<%=list%>&more=<%=more%>&open=<%=open%>&icon=<%=icon%>&bg=<%=bg%>'>首页</a>
	     <a href='<%=request.servervariables("URL")%>?page=<%=page-1%>&lm2=<%=lmid%>&hot=<%=hot%>&tj=<%=ttjj%>&t=<%=t%>&week=<%=week%>&font=<%=font%>&line=<%=line%>&lmname=<%=lmname%>&n=<%=n%>&list=<%=list%>&more=<%=more%>&open=<%=open%>&icon=<%=icon%>&bg=<%=bg%>'>上页</a>
	  <%end if%>
	  <%if page<rs.pagecount then%>
	     <a href='<%=request.servervariables("URL")%>?page=<%=page+1%>&lm2=<%=lmid%>&hot=<%=hot%>&tj=<%=ttjj%>&t=<%=t%>&week=<%=week%>&font=<%=font%>&line=<%=line%>&lmname=<%=lmname%>&n=<%=n%>&list=<%=list%>&more=<%=more%>&open=<%=open%>&icon=<%=icon%>&bg=<%=bg%>'>下页</a>
	     <a href='<%=request.servervariables("URL")%>?page=<%=rs.pagecount%>&lm2=<%=lmid%>&hot=<%=hot%>&tj=<%=ttjj%>&t=<%=t%>&week=<%=week%>&font=<%=font%>&line=<%=line%>&lmname=<%=lmname%>&n=<%=n%>&list=<%=list%>&more=<%=more%>&open=<%=open%>&icon=<%=icon%>&bg=<%=bg%>'>尾页</a>
	  <%end if%>
	　共<%=rs.recordcount%>条				
	    <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 <% if int(i)=int(page) then response.write " selected "%> value="<%=request.servervariables("URL")%>?page=<%=i%>&lm2=<%=lmid%>&hot=<%=hot%>&tj=<%=ttjj%>&t=<%=t%>&week=<%=week%>&font=<%=font%>&line=<%=line%>&lmname=<%=lmname%>&n=<%=n%>&list=<%=list%>&more=<%=more%>&open=<%=open%>&icon=<%=icon%>&bg=<%=bg%>" <%if page=i then response.write "selected"%>>第<%=i%>页</option>
	        <%next%>
	    </select>
<%end if%></font>
</center>
<%end if%>
<%end if%>

</body>

<%
conn.close:set conn=nothing
%>