加新闻的代码已经有了,在下面这个代码中哪个位置加最好
<%
sub news_list(n_num,c_num)
dim nsid,nsname,srs,ssql,sqla,n_username,n_topic,n_tim,sid_num
sid_num=0
ssql="select s_id,s_name from jk_sort where c_id="&cid&" order by s_order"
set srs=joekoe_cms.exec(ssql,1)
do while not srs.eof
sid_num=1
nsid=srs("s_id")
nsname=srs("s_name")
sqla=" and s_id="&nsid
response.write vbcrlf&news_bar_top(nsname,1,1,"?action=more&c_id="&cid&"&s_id="&nsid)
sql="select top "&n_num&" id,topic,tim,username,counter,ispic from news where hidden=1 and s_id="&nsid&" order by id desc"
set rs=joekoe_cms.exec(sql,1)
do while not rs.eof
sid_num=2
n_username=rs("username")
n_topic=rs("topic")
n_tim=rs("tim")
n_tim=joekoe_cms.time_type(n_tim,1)
response.write vbcrlf&news_topic_type(c_num,rs("id"),n_username,n_topic,n_tim,rs("counter"),rs("ispic"),2)
rs.movenext
loop
rs.close
response.write vbcrlf&news_bar_end("",1)
srs.movenext
loop
srs.close
set srs=nothing
end sub
%>
ASP,新闻最后三条显示“new“字样,代码如下,请帮忙修改!
if Request.cookies("reglevel")=2 then rs3.Source ="select top " & top_img & " * from News where piews=1 and checkked=1 and newslevel<=2 and piame<>null order by NewsID DESC"end if if Request.cookies("reglevel")=1 then rs3.Source ="select top " & top_img & ...
asp在最近几天的新闻后加new图标的问题!
rs.open "select * from news where sort="&id&" and datediff(d,addtime,getdate())>7 order by id desc",conn,1,1 上面的7是最近7天显示new 上面这句话只是选择7天的新闻 如果要求有其它的新闻的话 那就要读取你的新闻时间,通过datediff进行对比,如果是小于7 则输出news.gif ...
asp的新闻标题后面添加new这样的一个GIF的小图片?
用一个detediff函数就可以了 < dim nowtime,newstime '定义2个变量,前者是现在时间,后者是新闻添加时间 nowtime=now()newstime = rs("你新闻添加的日期字段")if datediff("d",newstime,nowtime)< 5 then > '计算新闻添加时间和当前时间的差值,如果相差时间在5天之内就显示news.gif的动画。'< ...
asp网页怎么给特定的新闻后面加上NEW图标?
修改两处即可.if now()-rs("AddTime")<=2 then NewsName=Left(rs("NewsName"),18)NewFlag="" '在这里插入一行,写你的New图片 else NewsName=Left(rs("NewsName"),18)NewFlag=""end If 然后,将下面这行修改成这样.Response.Write " "&NewsName&"" & NewFlag & ""&VbCrLf ...
asp 最近三天的新闻加后new标识
<%if data-rs("添加日期的字段名")<4 then response.write ""%>
asp网页怎么给特定的新闻后面加上NEW图标
if a="yes" then%><%end if%> 不就是这么简单吗?sub nx()sqlnx= "select top 20 id,biaoti,fbsj,jiage from xinxi where yz=1 order by fbsj desc,id desc"set rsnx=conn.execute(sqlnx)do while not rsnx.eof jiage=rsnx("jiage")if jiage="0" or jiage="" then jiage="面...
asp网站,如何让新闻列表在最近3天的新闻后加new图标?
加个IF语句 判断新闻添加时间与当前时间的差
asP中我想把当天发布的新闻加上NEW这个标志,请问如何解决?
添加时间:" & YearDa(Rs("News_Date")) & "'>" & gotTopic(Rs("News_Title"),15,1) & "<\/A><\/SPAN><SPAN STYLE='color:#999999;'>" & YearDa(Rs("News_Date")) & "<\/A><\/SPAN>"if DateDiff("d",Rs("News_Date"),now())<1 then response.write "显示NEW 的图片"en...
求助:asp在最近3天的新闻后加new图标的问题!
if datediff("d",now(),rs("posttime"))<=0 then response.Write ""end if 修改成 if datediff("d",date,rs("posttime"))>=0 and datediff("d",now(),rs("posttime"))<=3 then response.Write ""end if
asp中前几条新闻数据加new图标的代码如何写?
desc "rs.open conn, sql, 1, 1 dim i ''这是个关键变量, 用来记录当前是第几笔新闻 i = 0 ''while not rs.eof if i<3 then response.write rs("title") & ""else response.write rs("title")end if i = i + 1 rs.movenext end while ...