[转帖]滚动图片新闻
作者:cmscn 日期:2005-04-11
sub main_center_newspic(cs_tnum,cs_cnum,row_num)
dim tmp1,tmp_topic,tmp_url,tmp2,i,col_num
col_num=round(cs_tnum/row_num)
tmp1=vbcrlf&"<tr align=center>"
sql="select top "&cs_tnum&" id,topic,pic from news where hidden=1 and ispic=1 order by id desc"
set rs=joekoe_cms.exec(sql,1)
i=1
do while not rs.eof
tmp_topic=rs(1)
tmp_url="news_view.asp?id="&rs(0)
tmp1=tmp1&vbcrlf&"<td>" & _
vbcrlf&" <table border=0 cellspacing=0 cellpadding=0>" & _
vbcrlf&" <tr><td align=center>"&pic_fk(rs("pic"),1,tmp_url)&"</td></tr>" & _
vbcrlf&" <tr><td align=center height="&dim_num(6)&"><a href='"&tmp_url&"' target=_blank>"&joekoe_cms.code_html(tmp_topic,1,7)&"</a></td></tr>" & _
vbcrlf&" </table>" & _
vbcrlf&"</td>"
rs.movenext
if i mod col_num =0 then tmp1=tmp1&"</tr><tr>"
i=i+1
loop
rs.close
tmp1=tmp1&vbcrlf&"</tr>"
tmp1="<table border=0 cellspacing=0 cellpadding=2 width='100%'>"&tmp1&vbcrlf&"</table>"
response.write vbcrlf&"<table cellspacing=1 cellpadding=4 class=table>" & _
vbcrlf&"<tr><td class=td0> "&img_skin("m_help")&" <a href='news.asp'><font color=white>图片新闻</font></a></td></tr>" & _
vbcrlf&"<tr class=bg_td><td align=center><marquee scrollamount=7 direction=left width='100%' onMouseOver=this.stop() onMouseOut=this.start()>"&tmp1&"</marquee></td></tr>" & _
vbcrlf&"</table>"&ukong
end sub
调用:call main_center_newspic(10,12,1)
评论: 6 | 引用: 0 | 查看次数: 549
发表评论