1.2首页调用新闻栏目指定子栏目的图片
作者:cmscn 日期:2006-12-18
sub main_news_pic(cs_tnum,cs_cnum,cs_sid)
dim tmp1,tmp_topic,tmp_url
tmp1=vbcrlf&"<tr align=center>"
sql="select top "&cs_tnum&" id,topic,pic from news where hidden=1 and ispic=1 and c_id="&cs_sid&" order by id desc"
set rs=joekoe_cms.exec(sql,1)
do while not rs.eof
tmp_topic=rs(1)
tmp_url="news_view.asp?id="&rs(0)
tmp1=tmp1&vbcrlf&"<td align=center>" & _
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,cs_cnum)&"</a></td></tr>" & _
vbcrlf&" </table>" & _
vbcrlf&"</td></tr>"
rs.movenext
loop
rs.close
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 class=bg_td><td align=center>"&tmp1&"</td></tr>" & _
vbcrlf&"</table>"&ukong
end sub
调用:call main_news_pic(4,20,126)
蓝色:图片数量
绿色:标题字数
红色:一级栏目ID
评论: 7 | 引用: 0 | 查看次数: 755
发表评论