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

-->
</style>
</head>

<%
path=config("path")

lm2=trim(request("lm2"))
if lm2="" then lm2=trim(request("lm"))
if lmid="" then lmid=lm2
if lm2="" then lm2=lmid
open=trim(request("open"))
bg=trim(request("bg"))
w=trim(request("w"))
h=trim(request("h"))
nr=trim(request("nr"))
nrtop=trim(request("nrtop"))
n=trim(request("n"))
pic=trim(request("pic"))
if bg="" then bg="ffffff"
%>
<Body bgcolor=<%=bg%>>
<%
if (not isNumeric(lm2)) then
	lm2=0
end if
if lmname="" then lmname=0
if w="" then w=150
if nr="" then nr=0
if h="" then h=150
if nrtop="" then nrtop=100
if n="" then n=20
if open="" then open=1
if pic="" then pic=1

pic=clng(pic)
if pic<1 then pic=1

if (not isNumeric(lm2)) then
	lm2=0
end if


sql = "select top 1 * from news where title<>'' and sh=1 "
if tj="1" then sql=sql&" and tj='推荐' "
if lm2<>"0" then
  sql=sql&" and (lm='"&lm2&"' or lm2='"&lm2&"' or lm3='"&lm2&"') "  
end if
if hot="1" then
 addtime=year(now())&"-"&month(now())&"-"&day(now())
 sql = sql&" and datediff('d',time,'"&addtime&"')<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 response.write "<center><BR><BR>暂无图片"
while not rs.eof

id=rs("id")
filename=rs("filename")
%><center>


<table border="0" width="100%" id="table1">
	<tr>
		<td align=center><a href="<%=path%><%=hrefID(ID,Filename)%>"
 <%
 if open=1 then 
     response.write "target=_blank"
 else
   response.write "target=_top" 
 end if
%>>
<img hspace=2 vspace=2 src=<%=rs("pic")%> width=<%=w%> height=<%=h%> border=0><br>
<font color="<%=rs("titlecolor")%>">
<%=left(rs("title"),n)%><%if len(rs("title"))>=n then response.write "…"%></font></a></td>

<%
if nr="1" then
%>

<td valign=top>
<%
bbbb=rs("content")
bbbb=replace(bbbb,chr(32),"")
bbbb=replace(bbbb,chr(13),"")
bbbb=replace(bbbb,chr(10),"")
bbbb=replace(bbbb,chr(9),"")
bbbb=replace(bbbb,"&nbsp;","")
bbbb=glhtml(bbbb)
bbbb=trim(bbbb)
response.write left(bbbb,nrtop)
%>
</td>
<%end if%>
	</tr>
	</table></center>
	<%
rs.movenext
wend

conn.close
set conn=nothing
%>


</body>