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
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询