外设最好的品牌:asp 根据时间的变化出现new图片 如何写代码?

来源:百度文库 编辑:高校问答 时间:2024/05/10 09:05:07
document.write(' · <font class=3><A href="<%=path%>ReadNews.asp?NewsID=<%=rs("NewsID")%>" title="<%=title%>" target="_blank"><%=left(title,nn)%></A><%if tt=1 then%><FONT color="#666666"> [<%=month(rs("updatetime"))%>-<%=day(rs("updatetime"))%> 插入部分]
</FONT><br><%end if%></font>');

这是一个最新动态文件, 我想在“插入部分”这个地方,插入一个代码,代码的功能就是在与当前日期相比 如果间隔小于7天,就显示new的图片,否则什么都不显示

你看代码怎么写?
我这些写不对啊,不知道什么地方有问题

<%if (DateDiff(d, updatetime, Date )<7) then Response.Write("<img border="0" src="img/new.gif" width="21" height="9">"); else %>
两个都试了,还是不行,结果动态新闻也出不来了,
我要修改的网址为:http://www.sdwrp.com/jzgcx/,想要在左边最新动态栏里,根据时间(一周内),在句子后面显示出一个"new'图片,以更加引人注意!!
相关全部代码(news.asp)为: 哪位高手能帮下忙,我现在正在学习,懂的不是很多! 给代码的时候最后详细一点!谢谢~~~~~~~~
document.write(' · <font class=3><A href="<%=path%>ReadNews.asp?NewsID=<%=rs("NewsID")%>" title="<%=title%>" target="_blank"><%=left(title,nn)%></A><%if tt=1 then%><FONT color="#666666">[<%=month(rs("updatetime"))%>-<%=day(rs("updatetime"))%>
]</FONT><br><%end if%></font>');
<%else%>
document.write(' · <font class=3><A href="<%=path%>ReadNews.asp?NewsID=<%=rs("NewsID")%>" title="<%=title%>" target="_blank"><%=left(title,nn)%></A><%if tt=1 then%><FONT color="#666666">[<%=month(rs("updatetime"))%>-<%=day(rs("updatetime"))%>]</FONT><br><%end if%></font>');
<%
end if
rs.movenext
loop
end if
Rs.Close
set Rs=nothing
%>

document.write(' · <font class=3><A href="<%=path%>ReadNews.asp?NewsID=<%=rs("NewsID")%>" title="<%=title%>" target="_blank"><%=left(title,nn)%></A><%if tt=1 then%><FONT color="#666666">[<%=month(rs("updatetime"))%>-<%=day(rs("updatetime"))%>
]</FONT><br><%end if%></font>');
<%else%>
document.write(' · <font class=3><A href="<%=path%>ReadNews.asp?NewsID=<%=rs("NewsID")%>" title="<%=title%>" target="_blank"><%=left(title,nn)%></A><%if tt=1 then%><FONT color="#666666">[<%=month(rs("updatetime"))%>-<%=day(rs("updatetime"))%>]<%if Date()-rs("updatetime")<7 then %>
<img border="0" src="img/new.gif" width="21" height="9">
<%end if%>
</FONT><br><%end if%></font>');
<%
end if
rs.movenext
loop
end if
Rs.Close
set Rs=nothing
%>

if date()-updatetime>=7 then
response.write tupian
else
response.write another
end if