ASP代码问题,需要在最新两天发布的信息后,加上一个小图标

说明:这是一段代码,其它文件调用了这段函数.现在我想在最新两天发布的信息标题后面,加上一个new的图标,请问怎么加?表名是info,时间表段是adddate.Functi... 说明:这是一段代码,其它文件调用了这段函数.
现在我想在最新两天发布的信息标题后面,加上一个new的图标,请问怎么加?
表名是info,时间表段是adddate.

Function zf11_ShowInfo(s_num,nums,Linenum,S_info,Show_date)
response.write "<table width=""100%"" border=""0"" align=""center"" cellpadding=""1"" cellspacing=""1"">"& vbCrLf
Select case s_num
case 1 '热门
InfoSql="select top "&nums&" * from Info order by hits desc,ID desc"
case 2 '新信息
InfoSql="select top "&nums&" * from Info order by AddDate desc,ID desc"
case 3 '大类热门
InfoSql="select top "&nums&" * from Info where Sort1="&S_info&" order by hits desc,ID desc"
case 4 '小类热门
InfoSql="select top "&nums&" * from Info where Sort2="&S_info&" order by hits desc,ID desc"
case 5 '大类
InfoSql="select top "&nums&" * from Info where Sort1="&S_info&" order by AddDate desc,ID desc"
case 6 '小类
InfoSql="select top "&nums&" * from Info where Sort2="&S_info&" order by AddDate desc,ID desc"
Case 7 '推荐
InfoSql="select top "&nums&" * from Info Where Pw_Good=True ORDER BY id DESC"
Case else '其它
InfoSql="select top "&nums&" * from Info order by hits desc"
End Select

Set InfoRs=Conn.Execute(InfoSql)
if InfoRs.eof or InfoRs.bof then
response.write"<tr><td align='center'>没有信息...</td></tr>"
end if
while not Infors.eof
set title=Infors("title")
set id=Infors("id")
response.write "<tr><td width=""4%""align=""center"" height=""25"" background=""images/table_bg2.gif""><img src=""Images/zf11_ico.gif"" width=""6"" height=""6"" align=""absmiddle""></td><td width=""62%"" height=""25"" background=""images/table_bg2.gif"" ><p style='line-height: 150%'>"& vbCrLf
response.write "<a href='typenews.asp?id="&id&"'title='"&title&"'>"
response.write "<font color='#333333' size=2>"
if GetLen(title)>26 then
response.write ""&LeftStr(title,24)&""
response.write ".."
else
response.write ""&title&""
end if
response.write "</a></td>"
response.write "</font>"
response.write "<td width=""30%""align=""left"" height=""25"" background=""images/table_bg2.gif"">"
if Show_date=1 then
response.write "  "
response.write "<font color='#333333' size=2>"
response.write DateTimeFormat(Infors("AddDate"),3)
response.write "</font>"
End if
response.write "</a></td></tr>"
Infors.movenext
wend
Infors.close
set Infors=nothing
response.write "</table>"
End Function
展开
 我来答
劲捷电子信息
推荐于2016-10-24 · TA获得超过1705个赞
知道小有建树答主
回答量:829
采纳率:33%
帮助的人:406万
展开全部
Function zf11_ShowInfo(s_num,nums,Linenum,S_info,Show_date)
response.write "<table width=""100%"" border=""0"" align=""center"" cellpadding=""1"" cellspacing=""1"">"& vbCrLf
Select case s_num
case 1 '热门
InfoSql="select top "&nums&" * from Info order by hits desc,ID desc"
case 2 '新信息
InfoSql="select top "&nums&" * from Info order by AddDate desc,ID desc"
case 3 '大类热门
InfoSql="select top "&nums&" * from Info where Sort1="&S_info&" order by hits desc,ID desc"
case 4 '小类热门
InfoSql="select top "&nums&" * from Info where Sort2="&S_info&" order by hits desc,ID desc"
case 5 '大类
InfoSql="select top "&nums&" * from Info where Sort1="&S_info&" order by AddDate desc,ID desc"
case 6 '小类
InfoSql="select top "&nums&" * from Info where Sort2="&S_info&" order by AddDate desc,ID desc"
Case 7 '推荐
InfoSql="select top "&nums&" * from Info Where Pw_Good=True ORDER BY id DESC"
Case else '其它
InfoSql="select top "&nums&" * from Info order by hits desc"
End Select

Set InfoRs=Conn.Execute(InfoSql)
if InfoRs.eof or InfoRs.bof then
response.write"<tr><td align='center'>没有信息...</td></tr>"
end if
while not Infors.eof
set title=Infors("title")
set id=Infors("id")
response.write "<tr><td width=""4%""align=""center"" height=""25"" background=""images/table_bg2.gif""><img src=""Images/zf11_ico.gif"" width=""6"" height=""6"" align=""absmiddle""></td><td width=""62%"" height=""25"" background=""images/table_bg2.gif"" ><p style='line-height: 150%'>"& vbCrLf
response.write "<a href='typenews.asp?id="&id&"'title='"&title&"'>"
response.write "<font color='#333333' size=2>"
if GetLen(title)>26 then
response.write ""&LeftStr(title,24)&""
response.write ".."
else
response.write ""&title&""
end if
response.write "</a>"
'=======
'关键是这里了======
if DateDiff("d",Infors("AddDate"),now())<=3 then
response.Write"<img src='images/new.gif' alt='最新发布'>"
end if
'=====================
response.write"</td>"
response.write "</font>"
response.write "<td width=""30%""align=""left"" height=""25"" background=""images/table_bg2.gif"">"
if Show_date=1 then
response.write " "
response.write "<font color='#333333' size=2>"
response.write DateTimeFormat(Infors("AddDate"),3)
response.write "</font>"
End if
response.write "</a></td></tr>"
Infors.movenext
wend
Infors.close
set Infors=nothing
response.write "</table>"
End Function
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
dsheen
2009-09-11 · TA获得超过898个赞
知道大有可为答主
回答量:1874
采纳率:0%
帮助的人:1322万
展开全部
'我给你改的使用文字NEW,如果你要使用图片,替换成img标签就可以。
还有,要改动你截取标题的地方,不能是26了,要考虑多出来的图片或文字的长度。
--------------------------------------------------------------------
Function zf11_ShowInfo(s_num,nums,Linenum,S_info,Show_date)
response.write "<table width=""100%"" border=""0"" align=""center"" cellpadding=""1"" cellspacing=""1"">"& vbCrLf
Select case s_num
case 1 '热门
InfoSql="select top "&nums&" * from Info order by hits desc,ID desc"
case 2 '新信息
InfoSql="select top "&nums&" * from Info order by AddDate desc,ID desc"
case 3 '大类热门
InfoSql="select top "&nums&" * from Info where Sort1="&S_info&" order by hits desc,ID desc"
case 4 '小类热门
InfoSql="select top "&nums&" * from Info where Sort2="&S_info&" order by hits desc,ID desc"
case 5 '大类
InfoSql="select top "&nums&" * from Info where Sort1="&S_info&" order by AddDate desc,ID desc"
case 6 '小类
InfoSql="select top "&nums&" * from Info where Sort2="&S_info&" order by AddDate desc,ID desc"
Case 7 '推荐
InfoSql="select top "&nums&" * from Info Where Pw_Good=True ORDER BY id DESC"
Case else '其它
InfoSql="select top "&nums&" * from Info order by hits desc"
End Select

Set InfoRs=Conn.Execute(InfoSql)
if InfoRs.eof or InfoRs.bof then
response.write"<tr><td align='center'>没有信息...</td></tr>"
end if
while not Infors.eof
set title=Infors("title")
set id=Infors("id")
response.write "<tr><td width=""4%""align=""center"" height=""25"" background=""images/table_bg2.gif""><img src=""Images/zf11_ico.gif"" width=""6"" height=""6"" align=""absmiddle""></td><td width=""62%"" height=""25"" background=""images/table_bg2.gif"" ><p style='line-height: 150%'>"& vbCrLf
response.write "<a href='typenews.asp?id="&id&"'title='"&title&"'>"
response.write "<font color='#333333' size=2>"
if GetLen(title)>26 then
response.write ""&LeftStr(title,24)&""
response.write ".."
else
response.write ""&title&""
end if
if DateDiff("d",Date,Infors("AddDate"))<3 then
response.write "NEW</a></td>"
else
response.write "</a></td>"
end if
response.write "</font>"
response.write "<td width=""30%""align=""left"" height=""25"" background=""images/table_bg2.gif"">"
if Show_date=1 then
response.write " "
response.write "<font color='#333333' size=2>"
response.write DateTimeFormat(Infors("AddDate"),3)
response.write "</font>"
End if
response.write "</a></td></tr>"
Infors.movenext
wend
Infors.close
set Infors=nothing
response.write "</table>"
End Function
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式