麻烦对动网了解的朋友帮下忙...急用...

发布时间:2024-05-15 06:02 发布:上海旅游网

问题描述:

我现在用的动网论坛ASP帖子调用的代码
<%
newtopic1()
sub newtopic1()
dim rs,sql,i,n,ds
i=0
n=8 '新贴调用个数,情感论坛调用
sql="select top "&n&"

a.topicid,a.title,a.boardid,a.postusername,a.lastpost,a.lastposttime,a.dateand

time,b.boardtype from dv_topic a,dv_board b where a.boardid=2 and

b.boardid=a.boardid order by dateandtime desc"
set rs=Dvbbs.Execute(sql)
If Not RS.Eof then
SQL=Rs.GetRows(-1)
else
response.write "<center>"
response.write "目前没有新贴"
response.write "</center>"
exit sub
end if
rs.close:set rs=nothing
For i=0 To Ubound(SQL,2)
response.write "   <font face=Wingdings>W</font> "
response.write "<a href=bbs/dispbbs.asp?boardid="&sql(2,i)&"&id="&sql(0,i)&"

target=""_blank"">"
response.write ""&left(dvbbs.htmlencode(sql(1,i)),16)&""
response.write "</a><br>"
next
end sub
%>

这样只能调用boardid为2的板块下的帖子,但是boardid 2下还有3个板块,ID分别为12、13和14,怎么才能让这个调用将boardid=2下的帖子以及boardid=12,boardid=13,boardid=14下的帖子同时显示出来?

辛苦各位了,帮忙解决下...感激不尽.....
我郁闷郁闷郁闷郁闷郁闷郁闷郁闷

怎么发这个板块来了!◎¥#◎!%!#

问题解答:

sql="select top "&n&"

a.topicid,a.title,a.boardid,a.postusername,a.lastpost,a.lastposttime,a.dateand

time,b.boardtype from dv_topic a,dv_board b where a.boardid=2 and

b.boardid=a.boardid order by dateandtime desc"

改为where a.boardid in(2,12,13,14) and

b.boardid=a.boardid order by dateandtime desc"

如果分别调用几个版块的帖子,然后在把这几个版块的调用再整合在一起,能否实现?

具体点就是说 新建几个首页调用,调用类型为“帖子调用”,调用位置自己选择,只是不选你不想调用的地方,其它的照抄默认的帖子调用设置,在首页插入新建的这几个调用。默认的那些调用只是做为例子,而不是直接给用户使用的。

研究一下!

我老板用的也是动网7.0ASP的.我叫他帮你看看.

热点新闻