ASP文章中,怎么给最新发布的文章加上NEW的字样,等到第二天就自己没了呢?

来源:百度知道 编辑:UC知道 时间:2024/05/11 01:40:19
ASP文章中,怎么给最新发布的文章加上NEW的字样,等到第二天就自己没了呢?

'days 几天内的新闻显示new图片 addtime 新闻添加的时间
function showgif(days,addtime)
dim nowtime
nowtime=now
if datediff("d",addtime,nowtime)<=days then
showgif="<font color=red>new!</font>"
else
showgif=""
end if
showgif=showgif
end function
'例子
dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="select top 10 * from PE_Article order by updatetime desc"
rs.open sql,conn,1,1
do while not rs.eof
response.write(""&rs("title")&""&showgif(58,rs("updatetime"))&"")
response.write "<a href='javascript:confirmdel("&rs("Articleid")&","&rs("Articleid")&")'><font color=#0000FF>删除</font></a><br>"
rs.movenext
loop
rs.close
set rs=nothing

不懂怎么用加我QQ 52527129