<!--#include file="inc/config.asp"-->
<!--#include file="inc/conn.asp"-->
<%
dim rs,sql,classid,bytype,num,max,imgw,imgh
if(request.QueryString("classid")<>"") then
	classid=Cint(request.QueryString("classid"))
else
	classid=0
end if
if(request.QueryString("bytype")<>"") then
	bytype=Cint(request.QueryString("bytype"))
else
	bytype=0
end if
if(request.QueryString("num")<>"") then
	num=Cint(request.QueryString("num"))
else
	num=10
end if
if(request.QueryString("max")<>"") then
	max=Cint(request.QueryString("max"))
else
	max=10
end if
if(request.QueryString("imgw")<>"") then
	imgw=Cint(request.QueryString("imgw"))
else
	imgw=60
end if
if(request.QueryString("imgh")<>"") then
	imgh=Cint(request.QueryString("imgh"))
else
	imgh=60
end if
sql="select top "&num&" id,title,pagepath,photo from news where checked=true"
if(classid<>0) then
	sql=sql&" and classid="&classid
end if
if(bytype<>0) then
	if(bytype=1) then
		sql=sql&" and top1=1"'头条
	elseif(bytype=2) then
		sql=sql&" and totop=1"'置顶
	elseif(bytype=3) then
		sql=sql&" and tohot=1"'热点
	elseif(bytype=4) then
		sql=sql&" and imgnews=true"'图文
	elseif(bytype=5) then
		sql=sql&" and recommend=true"'推荐
	end if
end if
sql=sql&" order by id desc"
set rs=server.CreateObject("adodb.recordset") 
rs.open sql,conn,3,1
while not rs.eof
	response.Write("document.write('<li>·<a href="""&SiteUrl&"/"&rs(2)&""" target=""_blank""><img src="""&SiteUrl&"/pic/"&rs(3)&""" border=""0"" width="""&imgw&""" height="""&imgh&"""><br />"&left(replace(rs(1),",","\'"),max)&"</a></li>');"&Chr(10))
	rs.movenext
wend

rs.close
set rs=nothing
call connclose
%>
