首页调用论坛图片


sub forum_pic(n)
dim tmp1,id,iid,pic,topic,fid,name,counter
tmp1=vbcrlf&"<tr align=center>"
sql="select top "&n&" upload.id,upload.iid,bbs_topic.topic,bbs_topic.counter,bbs_topic.forum_id,bbs_topic.username,upload.url from upload INNER JOIN bbs_topic ON upload.iid = bbs_topic.id where nsort='forum' and genre='jpg' or genre='gif' or genre='bmp' order by upload.id desc"
set rs=joekoe_cms.exec(sql,1)
do while not rs.eof
  id=rs("iid")
  pic=rs("url")
  topic=rs("topic")
  fid=rs("forum_id")
  name=rs("username")
  counter=rs("counter")
  tmp1=tmp1&vbcrlf&" <table border=0 cellspacing=0 cellpadding=0>" & _
            vbcrlf&" <tr><td>"&pic_fk(pic,4,"forum/forum_view.asp?forum_id="&fid&"&view_id="&id)&"</td>" & _
            vbcrlf&" <td><a href='forum/forum_view.asp?forum_id="&fid&"&view_id="&id&"' target=_blank alt='标题:"&joekoe_cms.code_html(topic,1,0)&"<br>人气:"&counter&"<br>发 布 人:"&name&"'>"&joekoe_cms.code_html(topic,1,30)&"</a></td></td>" & _
  rs.movenext
loop
rs.close
tmp1=tmp1&vbcrlf&"</tr>"
tmp1="<table border=0 cellspacing=0 cellpadding=0 width='100%'>"&tmp1&vbcrlf&"</table>"
  response.write vbcrlf&"<table cellspacing=0 cellpadding=0 class=table>" & _
                 vbcrlf&"<tr><td align=center>"&tmp1&"</td></tr>" & _
                 vbcrlf&"</table>"
end sub

调用方法:<%call forum_pic(1)%>

文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
相关日志:
评论: 6 | 引用: 0 | 查看次数: 689
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 20 字 | UBB代码 关闭 | [img]标签 关闭