asp网页怎么给特定的新闻后面加上NEW图标?
程序是这样的functionNews11(num,SortPath)dimrs,sql,NewsName,NewFlagsetrs=server.createobject...
程序是这样的
function News11(num,SortPath)
dim rs,sql,NewsName,NewFlag
set rs = server.createobject("adodb.recordset")
sql="select top "& num &" * from Qianbo_News where ViewFlag and Instr(SortPath,'"&SortPath&"')>0 order by id desc"
rs.open sql,conn,1,1
i=1
if rs.eof then
response.write "</ul>"
Response.Write "<li>暂无相关信息</li>"&VbCrLf
response.write "</ul>"
else
Response.Write "<table width=""360"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""3"">"
do while not rs.eof
if now()-rs("AddTime")<=2 then
NewsName=Left(rs("NewsName"),18)
else
NewsName=Left(rs("NewsName"),18)
NewFlag=""
end If
If ISHTML = 1 Then
AutoLink = ""&NewName&""&Separated&""&rs("ID")&"."&HTMLName&""
Else
AutoLink = "NewsView.asp?ID="&rs("id")&""
End If
i=i+1
Response.Write " <tr height=""20"">"&VbCrLf
Response.Write " <td style=""border-bottom:1px dashed #DEDEDE;""><img src=""images/122.jpg"" /> <a href="""&AutoLink&""">"&NewsName&"</a></td>"&VbCrLf
Response.Write " <td align=""right"" style=""border-bottom:1px dashed #DEDEDE;"">["&FormatDate(rs("Addtime"),13)&"]</td>"&VbCrLf
Response.Write " </tr>"&VbCrLf
rs.movenext
loop
response.write "</table>"
end if
rs.close
set rs=nothing
end Function
应该怎么改。求帮忙 展开
function News11(num,SortPath)
dim rs,sql,NewsName,NewFlag
set rs = server.createobject("adodb.recordset")
sql="select top "& num &" * from Qianbo_News where ViewFlag and Instr(SortPath,'"&SortPath&"')>0 order by id desc"
rs.open sql,conn,1,1
i=1
if rs.eof then
response.write "</ul>"
Response.Write "<li>暂无相关信息</li>"&VbCrLf
response.write "</ul>"
else
Response.Write "<table width=""360"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""3"">"
do while not rs.eof
if now()-rs("AddTime")<=2 then
NewsName=Left(rs("NewsName"),18)
else
NewsName=Left(rs("NewsName"),18)
NewFlag=""
end If
If ISHTML = 1 Then
AutoLink = ""&NewName&""&Separated&""&rs("ID")&"."&HTMLName&""
Else
AutoLink = "NewsView.asp?ID="&rs("id")&""
End If
i=i+1
Response.Write " <tr height=""20"">"&VbCrLf
Response.Write " <td style=""border-bottom:1px dashed #DEDEDE;""><img src=""images/122.jpg"" /> <a href="""&AutoLink&""">"&NewsName&"</a></td>"&VbCrLf
Response.Write " <td align=""right"" style=""border-bottom:1px dashed #DEDEDE;"">["&FormatDate(rs("Addtime"),13)&"]</td>"&VbCrLf
Response.Write " </tr>"&VbCrLf
rs.movenext
loop
response.write "</table>"
end if
rs.close
set rs=nothing
end Function
应该怎么改。求帮忙 展开
2个回答
展开全部
修改两处即可.
if now()-rs("AddTime")<=2 then
NewsName=Left(rs("NewsName"),18)
NewFlag="<img src=new.gif>" '在这里插入一行,写你的New图片
else
NewsName=Left(rs("NewsName"),18)
NewFlag=""
end If
然后,将下面这行修改成这样.
Response.Write " <td style=""border-bottom:1px dashed #DEDEDE;""><img src=""images/122.jpg"" /> <a href="""&AutoLink&""">"&NewsName&"</a>" & NewFlag & "</td>"&VbCrLf
if now()-rs("AddTime")<=2 then
NewsName=Left(rs("NewsName"),18)
NewFlag="<img src=new.gif>" '在这里插入一行,写你的New图片
else
NewsName=Left(rs("NewsName"),18)
NewFlag=""
end If
然后,将下面这行修改成这样.
Response.Write " <td style=""border-bottom:1px dashed #DEDEDE;""><img src=""images/122.jpg"" /> <a href="""&AutoLink&""">"&NewsName&"</a>" & NewFlag & "</td>"&VbCrLf
logo在线生成器
2024-10-23 广告
2024-10-23 广告
燕雀零一专业logo生成器,是一家科技型的设计公司,团队深耕企业品牌设计服务已有十余年,已助力多家企业塑造其品牌形象及体验,服务内容含:LOGO设计/VI设计/产品包装设计/导视店面门头及空间设计,吉祥物设计/海报设计等。 我们的目标是帮助...
点击进入详情页
本回答由logo在线生成器提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询