📄 html.asp
字号:
<%response.expires=0%>
<!--#include file="inc/conn.asp"-->
<%
sql="categoryid,title,pic,otime,hits,path,filenum from news"
id=strFilter(request("id"),10)
if id><"" then
if isnumeric(id) then
sql=sql&" where categoryid like '%."&id&".%'"
end if
end if
num=strFilter(request("num"),2)
if num><"" then
if isnumeric(num) then
sql="select top "&num&" "&sql
else
sql="select top 10 "&sql
end if
else
sql="select top 10 "&sql
end if
only=strFilter(request("only"),6)
if only><"" then
if only="today" then
lasttime=DateDiff("s","2001-1-1 00:00:00",year(now())&"-"&month(now())&"-"&day(now())&" 00:00:00")
end if
if only="week" then
lasttime=DateDiff("s","2001-1-1 00:00:00",year(now()-7)&"-"&month(now()-7)&"-"&day(now()-7)&" 00:00:00")
end if
if only="month" then
lasttime=DateDiff("s","2001-1-1 00:00:00",year(now()-30)&"-"&month(now()-30)&"-"&day(now()-30)&" 00:00:00")
end if
if only="month" then
lasttime=DateDiff("s","2001-1-1 00:00:00",year(now()-90)&"-"&month(now()-90)&"-"&day(now()-90)&" 00:00:00")
end if
if lasttime><"" then
sql=sql&" and filenum>"&lasttime
end if
end if
cont=strFilter(request("sort"),3)
order=strFilter(request("order"),4)
if cont><"" then
if cont="top" or cont="pic" then
if cont="top" then
if order="time" then
sql=sql&" order by otime DESC, hits DESC"
else
sql=sql&" order by hits DESC"
end if
else
sql=sql&" and pic=1 order by otime DESC"
end if
else
sql=sql&" order by otime DESC"
end if
else
if order="hits" then
sql=sql&" order by otime DESC, hits DESC"
else
sql=sql&" order by otime DESC"
end if
end if
nheight=strFilter(request("height"),2)
nsize=strFilter(request("size"),2)
ndate=len(strFilter(request("date"),1))
ntime=len(strFilter(request("time"),1))
nhits=len(strFilter(request("hits"),1))
sql=replace(sql,"news and","news where")
rs.open sql,conn,1,1
if not rs.eof then
newslist=rs.getrows()
end if
rs.close
response.write "var html='';"&vbcrlf
if isarray(newslist) then
for i=0 to ubound(newslist,2)
response.write "html+='"
if id="" then
category=split(newslist(0,i),".")
response.write "[<a href=""/news/list.asp?id="&category(1)&""">"&category(2)&"</a>]"
else
response.write "·"
end if
response.write "<a href=""/"&newslist(5,i)&newslist(6,i)&".htm"""
if nheight><"" then
if isnumeric(nheight) then
response.write " style=\'line-height:"&nheight&"pt\'"
end if
end if
response.write ">"
if nsize><"" then
if isnumeric(nsize) then
newslist(1,i)=GetWord(newslist(1,i),CCur(nsize),"...")
end if
end if
response.write replace(newslist(1,i),"'","\'")&"</a>"
if newslist(2,i)=true then
response.write "[<font color=D669A5>图</font>]"
end if
if ndate=1 and ntime=1 then
response.write " <font color=aaaaaa>("&newslist(3,i)&")</font>"
else
if ndate=1 then
response.write " <font color=aaaaaa>("&formatdatetime(newslist(3,i),4)&")</font>"
end if
if ntime=1 then
response.write " <font color=aaaaaa>("&formatdatetime(newslist(3,i),3)&")</font>"
end if
end if
if nhits=1 then
response.write " <font color=aaaaaa>(<font color=red>"&newslist(4,i)&"</font>)</font>"
end if
response.write "<br>';"&vbcrlf
next
else
response.write "html+='暂时没有新闻!';"
end if
response.write "document.write(html);"
response.end
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -