<%@ LANGUAGE="VBSCRIPT" %> <%=ForumName%>--显示贴子 <% dim rs,sql dim urs,usql dim rsboard,boardsql dim boardtype dim boardid dim announceid dim username dim rootid dim topic dim abgcolor abgcolor="#FFFFFF" Rem ------获取参数(get or post的)------ Rem ------包括版面的ID和页次------ Call getInput() call chkInput() set rs=server.createobject("adodb.recordset") if foundErr then call error() else call showPage() end if sub showPage() 'on error resume next if foundErr then call error() else call announceinfo() if founderr then call error() end if if err.number<>0 then err.clear end sub sub announceinfo() sql="select boardtype from board where boardID="&BoardID rs.open sql,conn,1,1 if not(rs.bof and rs.eof) then boardtype=rs("boardtype") else foundErr = true ErrMsg=ErrMsg+"
"+"
  • 您指定的论坛版面不存在
  • " exit sub end if rs.close 'Rs.open "Select topic from bbs1 Where announceID="&AnnounceID&"",conn,1,1 set rs=conn.execute("select topic from bbs1 where announceID="&rootID&"") if not(rs.bof and rs.eof) then topic=rs("topic") else foundErr = true ErrMsg=ErrMsg+"
    "+"
  • 您指定的贴子不存在
  • " exit sub end if rs.close %>
    以文本方式查看主题

    -  <%=ForumName%>  (<%=HostURL%><%=ForumURL%>index.asp)
    --  <%=boardtype%>  (<%=HostURL%><%=ForumURL%>bbs.asp?boardid=<%=boardid%>)
    ----  <%=htmlencode(topic)%>  (<%=HostURL%><%=ForumURL%>dispbbs.asp?boardid=<%=boardid%>&rootid=<%=rootid%>&id=<%=announceid%>)


    <% Rs.open "Select UserName,Topic,dateandtime,body from bbs1 where boardid="&boardid&" and rootid="&rootid&" order by announceid",conn,1,1 do while not rs.eof %>
    --  作者:<%=rs("username")%>
    --  发布时间:<%=rs("dateandtime")%>

    --  <%=htmlencode(rs("topic"))%>
    <%=ubbcode(rs("body"))%>
    <% rs.movenext loop rs.close %> <% end sub Sub getInput() 'On Error Resume Next Rem ------获取版面ID------ BoardID = Request("BoardID") AnnounceID=Cstr(Request("ID")) RootID=request("RootID") End Sub sub chkInput 'on error resume next if boardID="" then foundErr = true ErrMsg=ErrMsg+"
    "+"
  • 请指定论坛版面
  • " end if if announceid="" then foundErr = true ErrMsg=ErrMsg+"
    "+"
  • 请指定相关贴子
  • " end if if rootid="" then foundErr = true ErrMsg=ErrMsg+"
    "+"
  • 请指定相关贴子
  • " end if end sub set urs=nothing set rs=nothing stats="浏览帖子" call endline() %>