<!-- #include file="include/config_forum.asp" -->
<!-- #include file="include/config_poll.asp" -->
<% if not(isnumeric(forumid)) or not(isnumeric(viewid)) then call cookies_type("view_id") %>
<!-- #include file="include/jk_pagecute.asp" -->
<!-- #include file="include/jk_ubb.asp" -->
<!-- #include file="include/conn.asp" -->
<%
call forum_first()
call forum_word()

dim ii,rssum,nummer,thepages,viewpage,page,pageurl,view_temp,iid,qid,table_bg,id,money_name,weburl,uu_username 
dim u_nname,u_sex,u_whe,u_qq,u_remark,u_bbs_counter,u_integral,u_emoney,u_power,u_popedom,u_face, u_usercp, u_renqi,u_userpower,u_faceurl,u_faceheight,u_facewidth
dim fir_id,fir_topic,fir_top,counter,re_counter,fir_istop,fir_isgood,fir_islock,del_type,fir_ispel
tit=forumname&"（浏览贴子）"
pageurl="?forum_id="&forumid&"&view_id="&viewid&"&"
nummer=web_var(web_num,3):view_temp="":money_name=web_var(web_config,8)

set rs=server.createobject("adodb.recordset")
sql="select bbs_data.*,bbs_topic.counter,bbs_topic.re_counter,bbs_topic.ispel,bbs_topic.islock,bbs_topic.istop,bbs_topic.isgood,bbs_topic.isvote,user_data.username as u_username," & _
    "user_data.nname as u_nname,user_data.sex as u_sex,user_data.whe as u_whe,user_data.qq as u_qq,user_data.email as u_email," & _
    "user_data.url as u_url,user_data.face as u_face,user_data.faceurl as u_faceurl,user_data.faceheight as u_faceheight,user_data.facewidth as u_facewidth,user_data.tim as u_tim,user_data.remark as u_remark,user_data.renqi as u_renqi,user_data.bbs_counter as u_bbs_counter,user_data.emoney as u_emoney,user_data.integral  as u_integral,user_data.usercp as U_usercp,user_data.userpower as u_userpower,user_data.power as u_power,user_data.popedom as u_popedom " & _
    "from user_data inner join ( bbs_topic inner join bbs_data on bbs_data.reply_id=bbs_topic.id )" & _
    " on bbs_data.username=user_data.username where bbs_data.forum_id="&forumid&" and bbs_data.reply_id="&viewid&" order by bbs_data.id"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
  rs.close:set rs=nothing:close_conn
  call cookies_type("view_id")
end if

call web_head(0,0,2,0,0)
'-----------------------------------center---------------------------------
call forum_grade()
%>
<script language=JavaScript>
<!--
function forum_do_del(data1,data2)
{
  if (confirm("此操作将删除id为 "+data2+" 的回贴！\n\n真的要删除吗？\n删除后将无法恢复！"))

    window.location = "forum_isaction.asp?action=del&forum_id="+data1+"&del_id="+data2

}
function forum_do_delete(data1,data2)
{
  if (confirm("此操作将删除id为 "+data2+" 的贴子！\n\n真的要删除吗？\n删除后将无法恢复！"))

    window.location = "forum_isaction.asp?action=delete&forum_id="+data1+"&del_id="+data2

}
//-->
</script>
<%
view_temp=forum_table1
rssum=rs.recordcount
call format_pagecute()

if int(viewpage)>1 then
  fir_id=rs("reply_id")
  fir_topic=rs("topic")
  fir_islock=rs("islock"):fir_istop=rs("istop"):fir_isgood=rs("isgood"):fir_ispel=rs("ispel")
  fir_istop=int(fir_istop):fir_isgood=int(fir_isgood):fir_islock=int(fir_islock)
  fir_top=fir_topic
  fir_top=code_html(fir_top,1,0)
  counter=rs("counter")
  re_counter=rs("re_counter")
  rs.move (viewpage-1)*nummer   
end if
   uu_username=rs("u_username")
for ii=1 to nummer
  if rs.eof then exit for
  iid=rs("id")
  qid=iid
  id=rs("reply_id")
  u_username=rs("u_username")
  u_nname=code_html(rs("u_nname"),1,0)
  u_sex=rs("u_sex")
  u_whe=code_html(rs("u_whe"),1,0)
  u_qq=rs("u_qq")
  u_remark=code_jk2(rs("u_remark"))
  u_bbs_counter=rs("u_bbs_counter")
  u_renqi=rs("u_renqi")
  u_integral=rs("u_integral")
  u_emoney=rs("u_emoney")
  u_userpower=rs("u_userpower")
  u_usercp=rs("u_usercp")
  u_face=rs("u_face")
  u_power=rs("u_power")
  u_popedom=rs("u_popedom")
  del_type="forum_do_del"
  if int(ii)=1 and int(viewpage)=1 then
    fir_id=id
    fir_topic=rs("topic")
    fir_islock=rs("islock"):fir_istop=rs("istop"):fir_isgood=rs("isgood"):fir_ispel=rs("ispel")
    fir_istop=int(fir_istop):fir_isgood=int(fir_isgood):fir_islock=int(fir_islock)
    fir_top=fir_topic
    fir_top=code_html(fir_top,1,0)
    counter=rs("counter")
    re_counter=rs("re_counter")
    iid=viewid
    del_type="forum_do_delete"
  end if
  
  view_temp=view_temp&view_type()
  rs.movenext
next
rs.close:set rs=nothing
view_temp=view_temp&"</td></tr></table>"

fir_istop=int(fir_istop)
if fir_istop<>0 and fir_istop<>1 and fir_istop<>2 then fir_istop=0

if forumreadonly=0 then
response.write forum_top("<a href='forum_reply.asp?forum_id="&forumid&"&view_id="&qid&"'><img src='images/"&web_var(web_config,5)&"/new_reply.gif' align=absMiddle border=0 title='回复当前主题'></a>")
else
response.write forum_top("")
end if
response.write kong & format_table(1,2)
%>
<tr<%response.write forum_table3%>><td width='60%'>&nbsp;主题：<b><font class=red_3 title='<%response.write fir_top%>'><%response.write code_html(fir_topic,1,30)%></font></b></td><td width=25%>&nbsp;浏览贴子（回复：<font class=red><%response.write re_counter%></font>&nbsp;浏览：<font class=red><%response.write counter+1%></font>）</td>
<td height=30 align=center width='15%'>
  <table border=0 cellspacing=0 cellpadding=0><tr align=center>
  <td width=50><a href='javascript:;' onclick="javascript:document.location.reload()"><%response.write img_small("page_refresh")%></a></td>
  <td width=55><a href="javascript:window.external.AddFavorite('<%response.write web_var(web_config,2)&pageurl%>','<%response.write web_var(web_config,1)&" - "&forumname&"（贴子："&fir_topic&"）"%>')"><%response.write img_small("page_fav")%></td>
  </tr></table>
</td></tr></table>
<% response.write kong & view_temp & kong & format_table(1,2) %>
<tr height=30<%response.write forum_table3%>>
<td width='75%'>&nbsp;分页：<% response.write jk_pagecute(nummer,thepages,viewpage,pageurl,6,"#ff0000") %></td>
<td width='25%' align=center><% response.write forum_go() %></td>
</tr>
<tr height=30 align=center<%response.write format_table(3,1)%>><td>主题贴类型：<font class=blue><%
if fir_istop<>0 or fir_isgood<>0 or fir_islock<>0 or fir_ispel<>0 then
  if fir_istop=1 then
    response.write "[ 固顶 ]&nbsp;"
  elseif fir_istop=2 then
    response.write "[ 总固顶 ]&nbsp;"
  end if
  if fir_isgood<>0 then response.write "[ 精华 ]&nbsp;"
  if fir_ispel<>0 then response.write "[ 推荐 ]&nbsp;"
  if fir_islock<>0 then response.write "[ 锁定 ]&nbsp;"
else
  response.write "[ 正常 ]&nbsp;"
end if
response.write "</font>"


if format_user_power(login_username,login_mode,forumpower)="yes" then
%>&nbsp;相关操作：
<a href='forum_isaction.asp?isaction=istop&fir_top=<%=fir_top%>&uusername=<%=uu_username%>&forum_id=<% response.write forumid %>&view_id=<% response.write id %>&action=other<%
select case fir_istop
case 1
  response.write "&cancel=yes' class=red_3>取消固顶</a>&nbsp;  " & _
                 "<a href='forum_isaction.asp?isaction=istops&fir_top="&fir_top&"&uusername="&uu_username&"&forum_id="&forumid&"&view_id="&id&"&action=other'>总固顶</a>"
case 2
  response.write "'>固顶</a>&nbsp;  " & _
                 "<a href='forum_isaction.asp?isaction=istops&fir_top="&fir_top&"&uusername="&uu_username&"&forum_id="&forumid&"&view_id="&id&"&action=other&cancel=yes' class=red_3>取消总固顶</a>"
case else
  response.write "'>固顶</a>&nbsp;  " & _
                 "<a href='forum_isaction.asp?isaction=istops&fir_top="&fir_top&"&uusername="&uu_username&"&forum_id="&forumid&"&view_id="&id&"&action=other'>总固顶</a>"
end select
%>&nbsp;  
<a href='forum_isaction.asp?isaction=isgood&fir_top=<%=fir_top%>&uusername=<%=uu_username%>&forum_id=<% response.write forumid %>&view_id=<% response.write id %>&action=other<%
  if fir_isgood=0 then
    response.write "'>"
  else
    response.write "&cancel=yes' class=red_3>取消"
  end if
%>精华</a>&nbsp;
<a href='forum_isaction.asp?isaction=ispel&fir_top=<%=fir_top%>&uusername=<%=uu_username%>&forum_id=<% response.write forumid %>&view_id=<% response.write id %>&action=other<%
   if fir_ispel=0 then
     response.write "'>"
   else
     response.write "&cancel=yes' class=red_3>取消"
   end if
   %>推荐</a>&nbsp;
<a href='forum_isaction.asp?isaction=islock&fir_top=<%=fir_top%>&uusername=<%=uu_username%>&forum_id=<% response.write forumid %>&view_id=<% response.write id %>&action=other<%
  if fir_islock=0 then
    response.write "'>"
  else
    response.write "&cancel=yes' class=red_3>取消"
  end if
%>锁定</a>&nbsp;  
<a href='forum_isaction.asp?isaction=delete&forum_id=<% response.write forumid %>&del_id=<% response.write id %>'>删除</a>
<% end if %>
</td>
<td><% response.write forum_move(forumid,viewid,fir_top,uu_username) %></td></tr>
</table>
<script language=javascript src='style/form_ok.js'></script>
<% response.write kong & forum_table1 %>
<form name=write_frm action='forum_reply.asp?forum_id=<%=forumid%>&view_id=<%=qid%>' method=post onsubmit="frm_submitonce(this);">
<input type=hidden name=reply value='ok'>
<tr<%response.write forum_table2%>><td height=25 valign=bottom colspan=2>
<%
if fir_islock<>1 then
if forumreadonly=0 then
  if login_mode="" then
    response.write "<div align=center>"&web_var(web_error,2)&"</div>"
  else
%>
&nbsp;<font class=red_2>→ 快速回复：</font><font class=red_3><b><% response.write fir_top %></b></font>
</td></tr>
<tr height=30<%response.write format_table(3,1)%>>
<td width='20%' align=center>主题信息：</td>
<td width='80%'>  回主题：<input type=topic name=topic value='<%response.write fir_topic%>' size=60 
maxlength=50>  <%response.write redx%>长度不能超过50
</td>
</tr>
<tr height=30<%response.write format_table(3,1)%>>
<td width='20%' align=center>用户信息：</td>
<td width='80%'>&nbsp;&nbsp;用户名：<input type=username name=username value='<%response.write login_username%>' size=18 maxlength=20>&nbsp;&nbsp;
密码：<input type=password name=password value='<%response.write login_password%>' size=18 maxlength=20>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font class=gray>[ <a href='user_main.asp?username=<%response.write server.htmlencode(login_username)%>'>用户中心</a> ]</font>&nbsp;&nbsp;&nbsp;&nbsp;
<font class=gray>[ <a href='login.asp?action=logout'>退出登陆</a> ]</font></td>
</tr>
<tr height=30<%response.write forum_table3%>>
<td align=center>表情符号：</td>
<td>&nbsp;&nbsp;<%response.write icon_type(9,3)%></td>
</tr>
<tr align=center<%response.write format_table(3,1)%>>
<td><table border=0><tr><td class=htd>贴子内容：<%response.write redx%><br><%response.write word_remark%></td></tr></table></td>
<td><table border=0><tr><td><textarea name=jk_word rows=8 cols=95 title='按 Ctrl+Enter 可直接发送' onkeydown="javascript:frm_quicksubmit();"></textarea></td></tr></table></td>
</tr>

<tr height=30>
            <td  valign=top colspan=2 bgcolor=#ffffff>
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td height="22" colspan="20"> <script>function New(para_URL){var URL=new String(para_URL);window.open(URL,'','resizable,scrollbars')}</script> 
                    <b>点击动作即可在帖子中加入（<a href=JavaScript:New('images/dongz/index.htm') title=查看所有动作明细>相应的动作</a>）</B><br></td>
                </tr>
                <tr> 
                  <td width="5%" height="20"><div align="center"><a onClick="jk_insert_em('/招呼')" style="CURSOR: hand">招呼</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/欢迎')" style="CURSOR: hand">欢迎</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/灌水')" style="CURSOR: hand">灌水</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/无聊')" style="CURSOR: hand">无聊</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/负责')" style="CURSOR: hand">负责</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/生气')" style="CURSOR: hand">生气</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/高兴')" style="CURSOR: hand">高兴</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/鼓掌')" style="CURSOR: hand">鼓掌</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/等待')" style="CURSOR: hand">等待</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/反对')" style="CURSOR: hand">反对</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/浪漫')" style="CURSOR: hand">浪漫</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/不要')" style="CURSOR: hand">不要</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/找死')" style="CURSOR: hand">找死</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/去死')" style="CURSOR: hand">去死</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/狂笑')" style="CURSOR: hand">狂笑</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/傻笑')" style="CURSOR: hand">傻笑</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/痛哭')" style="CURSOR: hand">痛哭</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/道别')" style="CURSOR: hand">道别</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/跳舞')" style="CURSOR: hand">跳舞</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/失望')" style="CURSOR: hand">失望</a></div></td>
                </tr>
                <tr> 
                  <td width="5%" height="20"><div align="center"><a onClick="jk_insert_em('/害羞')" style="CURSOR: hand">害羞</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/比酷')" style="CURSOR: hand">比酷</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/救命')" style="CURSOR: hand">救命</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/狂妄')" style="CURSOR: hand">狂妄</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/拳击')" style="CURSOR: hand">拳击</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/我踢')" style="CURSOR: hand">我踢</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/我踩')" style="CURSOR: hand">我踩</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/饶命')" style="CURSOR: hand">饶命</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/眨眼')" style="CURSOR: hand">眨眼</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/臭美')" style="CURSOR: hand">臭美</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/变态')" style="CURSOR: hand">变态</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/拼酒')" style="CURSOR: hand">拼酒</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/深情')" style="CURSOR: hand">深情</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/恶心')" style="CURSOR: hand">恶心</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/惊讶')" style="CURSOR: hand">惊讶</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/抽烟')" style="CURSOR: hand">抽烟</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/怀疑')" style="CURSOR: hand">怀疑</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/拉勾')" style="CURSOR: hand">拉勾</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/经典')" style="CURSOR: hand">经典</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/唱歌')" style="CURSOR: hand">唱歌</a></div></td>
                </tr>
                <tr> 
                  <td width="5%" height="20"><div align="center"><a onClick="jk_insert_em('/ＯＫ')" style="CURSOR: hand">ＯＫ</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/同意')" style="CURSOR: hand">同意</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/生日')" style="CURSOR: hand">生日</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/kiss')" style="CURSOR: hand">kiss</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/晕倒')" style="CURSOR: hand">晕倒</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/气你')" style="CURSOR: hand">气你</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/错啦')" style="CURSOR: hand">错啦</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/加油')" style="CURSOR: hand">加油</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/恭喜')" style="CURSOR: hand">恭喜</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/简单')" style="CURSOR: hand">简单</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/鼓励')" style="CURSOR: hand">鼓励</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/过奖')" style="CURSOR: hand">过奖</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/原谅')" style="CURSOR: hand">原谅</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/大笑')" style="CURSOR: hand">大笑</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/感动')" style="CURSOR: hand">感动</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/叹气')" style="CURSOR: hand">叹气</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/道谢')" style="CURSOR: hand">道谢</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/摇头')" style="CURSOR: hand">摇头</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/点头')" style="CURSOR: hand">点头</a></div></td>
                  <td width="5%"><div align="center"><a onClick="jk_insert_em('/拥抱')" style="CURSOR: hand">拥抱</a></div></td>
                </tr>
              </table> 
</td>
</tr>

<script language=javascript src='style/em_type.js'></script>
<tr height=30<%response.write forum_table3%>>
<td align=center>E M 贴图：</td>
<td>&nbsp;<script language=javascript>jk_em_type('s');</script></td>
</tr>
<tr<%response.write format_table(3,1)%>><td colspan=2 align=center width=777 height=60>&nbsp;&nbsp;<script language=javascript>jk_em_type('b');</script></td></tr>
<tr align=center height=30<%response.write forum_table3%>>
<td>快速回复：</td>
<td><input type=submit name=wsubmit value='快速发表我的回贴'>　&nbsp;<%response.write preview_b("write_frm","jk_word","预览我的回复")%>　&nbsp;<input type=reset value='清除重写'>　&nbsp;（按 Ctrl + Enter 可快速回复）
<%
  end if
else
  response.write "<div align=center><font class=red_2>[ 只读论坛不允许对帖子进行回复 ]</font></div>"
end if
else
  response.write "<div align=center><font class=red_2>这个贴子已被锁定！不能再对其进行回复</font></div>"
end if
%>
</td></tr></form></table>
<br>
</font>
<%call preview_form("write_frm","jk_word")%>
<%
sql="update bbs_topic set counter=counter+1 where forum_id="&forumid&" and id="&viewid
conn.execute(sql)
'---------------------------------center end-------------------------------
call web_end(0)
%>