1.2中首页调用留言的方法!
作者:cmscn 日期:2005-04-11
方法如下:在index2.asp中定义:
sub ly()
sql="select top 8 topic,re_word,nname,hidden,tim,icon from gb_data order by id desc"
dim topic,tmp1
set rs=joekoe_cms.exec(sql,1)
do while not rs.eof
topic=rs("topic")
tmp1=tmp1&vbcrlf&"<tr><td height="&dim_num(6)&" class=under_dotline><img src='images/icon/"&rs("icon")&".gif' border=0 align=absMiddle> <a href='gbook.asp' target=_blank alt='"&joekoe_cms.code_html(topic,1,0)&"'>"&rs("nname")&": "&joekoe_cms.code_html(topic,1,10)&"</a></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> 最新留言</td></tr>" & _
vbcrlf&"<tr class=bg_td><td align=center>"&tmp1&"</td></tr>" & _
vbcrlf&"</table>"&ukong
end sub
%>
然后再调用的地方加入:
<% call ly() %>
评论: 6 | 引用: 0 | 查看次数: 1163
发表评论