首页竖排显示精彩推荐里的图片
作者:cmscn 日期:2005-05-15
方法1
sub index_gallery(n)
dim m_n,topic,id,smallimg,temp1
temp1="<table border=0 cellspacing=4 cellpadding=2 align=center>"
sql="select top "&n&" id,name,spic from gallery where hidden=1 order by id desc"
set rs=joekoe_cms.exec(sql,1)
do while not rs.eof
id=rs(0)
topic=rs(1)
smallimg=rs(2)
temp1= temp1& vbcrlf&"<tr><td>"&pic_fk(smallimg,1,"gallery_view.asp?id="&id)&"</td></tr>"
temp1= temp1& vbcrlf&"<tr><td><a href='gallery_view.asp?id="&id&"' alt='"&joekoe_cms.code_html(topic,1,0)&"' target=_blank>"&joekoe_cms.code_html(topic,1,11)&"</a></td></tr>"
rs.movenext
loop
rs.close
temp1= temp1&vbcrlf&"</table>"
response.write temp1
end sub
调用:例如想调用4个
call index_gallery(4)
方法2
sub main_up_pic(cs_tnum,cs_cnum)
dim tmp1,tmp_topic,tmp_url
tmp1=vbcrlf&"<tr align=center>"
sql="select top "&cs_tnum&" id,name,spic,emoney,counter from gallery where hidden=1 and types='flash' order by id desc"
set rs=joekoe_cms.exec(sql,1)
do while not rs.eof
tmp_topic=rs(1)
tmp_url="gallery_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("spic"),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><td class=td0> 精彩FLASH</td></tr>" & _
vbcrlf&"<tr class=bg_td><td align=center>"&tmp1&"</td></tr>" & _
vbcrlf&"</table>"&ukong
end sub
调用
call main_up_pic(3,10) '其中的3表示显示数量,10表示图片下面的标题字数。
如果要改成贴图,把 flash 改为 paste 即可。
评论: 7 | 引用: 0 | 查看次数: 585
发表评论