<!-- #include file="../include/skin.asp" -->
<!-- #include file="../include/functions.asp" -->
<%
dim forumid,viewid,istop_var,html_temp,forumtype,tt
html_temp=""
tit="回贴浏览"
call web_head(0,0,5,0,0)

forumid=trim(request.querystring("forum_id"))
viewid=trim(request.querystring("view_id"))
istop_var=trim(request.querystring("istop_var"))
if not(isnumeric(forumid)) or not(isnumeric(viewid)) then
  html_temp="<tr><td><font class=red_2>您的操作有误：ID 出錯（1）！</font></td></tr>"
end if

if var_null(login_username)="" or var_null(login_password)="" then
  html_temp="<tr><td>&nbsp;&nbsp;"&web_nologin&"</td></tr>"
else
  sql="select top 1 forum_type from bbs_forum where forum_id="&forumid&" and forum_hidden=0"
  set rs=joekoe_cms.exec(sql,1)
  if rs.eof then
    html_temp=html_temp&"<tr><td><font class=red_2>ForumID 出錯！</font></td></tr>"
  end if
  rs.close
  if html_temp="" then
    sql="select top 10 bbs_data.username,bbs_data.word,user_data.popedom,bbs_data.pb from bbs_data,user_data where bbs_data.userid=user_data.id and bbs_data.forum_id="&forumid&" and bbs_data.reply_id="&viewid&" order by bbs_data.id"
    set rs=joekoe_cms.exec(sql,1)
    if rs.eof then
      html_temp=html_temp&"<tr><td><font class=red_2>您的操作有误：ID 出錯（2）！</font></td></tr>"
    else
      i=0
      do while not rs.eof
        if cint(i)>0 then
          html_temp=html_temp&"<tr><td><img src='"&joekoe_cms.web_dir_skin&"/small/fk_minus.gif' border=0> "
          
          if joekoe_cms.popedom_p(rs("popedom"),42)=0 then
            tt=joekoe_cms.code_html(rs("word"),1,45)
            tt=replace(tt,vbcrlf&vbcrlf,"")
            tt=replace(tt,CHR(10),"")		'回车
            tt=replace(tt,CHR(13),"")
			if rs("pb") then
          tt="<font class=red2>该贴已暂时被屏蔽！</font>"
          end if
            html_temp=html_temp&tt
          else
            html_temp=html_temp&"<font class=red2>该用户的论坛发言已暂时被屏蔽！</font>"
          end if
          html_temp=html_temp&"&nbsp;<font class=gray>-</font>&nbsp;"&format_user_name(rs("username"),0,"")&"</td></tr>"
        end if
        rs.movenext
        i=i+1
      loop
    end if
    rs.close
  end if
end if

'html_temp=replace(html_temp,"'","\'")
html_temp="<table border=0 width=99% align=right cellspacing=2 cellpadding=0>"&html_temp&"</table>"

response.write vbcrlf&joekoe_cms.js_put("window.parent.followTd"&istop_var&viewid&".innerHTML="""&html_temp&""";",1)

call web_end(0,1)
%>