<!-- #include file="include/con_forum.asp" -->
<!-- #include file="include/con_forum_fir.asp" -->
<!-- #include file="include/con_forum_vote.asp" -->
<!-- #include file="include/jk_ubb.asp" -->
<%
if (not isnumeric(forumid)) or (not isnumeric(viewid)) then
  call format_redirect("forum.asp")
end if

dim dim_topic,fm_15,forum_name
fm_15=int(format_mid_num(15))
ftit="打印主题"

call forum_first()
call forum_view_load()
call web_head(0,0,4,0,0)
'----------------------------中间 开始----------------------------
response.write vbcrlf&"<table border=0 height='100%' width='100%' cellspacing=0 cellpadding=0 class=bg>" & _
               vbcrlf&"<tr><td height='100%' valign=top align=center>" & _
               vbcrlf&"  <table border=0 cellspacing=0 cellpadding=0 width=770>" & _
               vbcrlf&"  <tr><td>"

call forum_print()

call web_copy()
response.write vbcrlf&"  </td></tr>" & _
               vbcrlf&"  </table>" & _
               vbcrlf&"</td></tr>" & _
               vbcrlf&"</table>"
erase dim_topic
'----------------------------中间 结束----------------------------
call forum_end()
call web_end(0,4)

sub forum_view_load()
  sql="select top 1 forum_id,topic,counter,re_counter,islock,istop,isgood,isvote,vote_num from bbs_topic where forum_id="&forumid&" and id="&viewid
  set rs=joekoe_cms.exec(sql,1)
  if rs.eof then
    rs.close
    call format_redirect("forum_list.asp?forum_id="&forumid)
  end if
  dim_topic=rs.getrows(1)
  rs.close
end sub

sub forum_print()
  dim dim_data,dim_data_num
  response.write vbcrlf&"<table cellspacing=1 cellpadding=2 class=table>" & _
                 vbcrlf&"<tr><td class=bg_tds align=center><table border=0 cellspacing=0 cellpadding=2 width='99%'><tr><td class=htd>" & _
                 vbcrlf&"<b>以文本方式查看</b><br><br>" & _
                 vbcrlf&"-&nbsp;&nbsp;<b>"&joekoe_cms.web_name&"</b>&nbsp;&nbsp;("&joekoe_cms.web_url&")<br>" & _
                 vbcrlf&"--&nbsp;&nbsp;<b>"&tit_fir&"</b>&nbsp;&nbsp;("&joekoe_cms.web_urls&"forum.asp)<br>" & _
                 vbcrlf&"---&nbsp;&nbsp;<b>"&forumname&"</b>&nbsp;&nbsp;("&joekoe_cms.web_urls&"forum_list.asp?forum_id="&forumid&")<br>" & _
                 vbcrlf&"----&nbsp;&nbsp;<b>"&joekoe_cms.code_html(dim_topic(1,0),1,0)&"</b>" & _
                 vbcrlf&"&nbsp;&nbsp;&nbsp;&nbsp;("&joekoe_cms.web_urls&"forum_list.asp?forum_id="&forumid&"&view_id="&viewid&")<br>" & _
                 vbcrlf&"</td></tr></table></td></tr>"
  
  if dim_topic(7,0)=true then
    response.write vbcrlf&"<tr><td class=bg_td align=center>"
    call forum_vote_print()
    response.write vbcrlf&"</td></tr>"
  end if
  
  sql="select id,username,topic,word,tim from bbs_data where reply_id="&viewid&" order by id"
  call joekoe_cms.exec(sql,-1)
  rs.open sql,conn,1,1
  do while not rs.eof
    response.write vbcrlf&"<tr><td class=bg_td align=center><table border=0 cellspacing=0 cellpadding=2 width='99%'><tr><td class=htd>" & _
                   vbcrlf&"--&nbsp;&nbsp;作者：<b>"&rs(1)&"</b><br>" & _
                   vbcrlf&"--&nbsp;&nbsp;时间：<font class=gray>"&rs(4)&"</font><br>" & _
                   vbcrlf&"--&nbsp;&nbsp;<b>"&joekoe_cms.code_html(rs(2),1,0)&"</b><br>" & _
                   vbcrlf& code_jk(rs(3)) & _
                   vbcrlf&"</td></tr></table></td></tr>"
    rs.movenext
  loop
  rs.close
  response.write vbcrlf&"</table>"
end sub
%>