<!-- #include file="include/config.asp" -->
<!-- #include file="include/fir.asp" -->
<!-- #include file="include/vote.asp" -->
<!-- #include file="../include/jk_ubb.asp" -->
<!-- #include file="../include/jk_ubbtst.asp" -->
<!-- #include file="../include/jk_pagecute.asp" -->
<!-- #include file="../include/jk_page_cute.asp" -->
<!-- #include file="../include/jk_ip_sys.asp" -->
<!-- #include file="../include/jk_val_code.asp" -->
<!-- #include file="../pet/pet_conn.asp" -->
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<script language = "JavaScript" src ="../style/magic.js"></script>
<%
if not isnumeric(viewid) then
  call format_redirect("index.asp")
end if

iframe=true

dim vdim,fir_topic,counter,re_counter,fir_istop,fir_isgood,fir_islock,fir_isvote,temp1,rnum,word,remark,ip,u_qq,u_email,u_url,u_popedom,u_lentim
dim nummer,nums,rssum,page,viewpage,thepages,pageurl,nnum,replyid,fm_15,is_recycle,cod
dim special,special_num,special_data,subhead
is_recycle=false
pageurl="?forum_id=&view_id=&"
nummer=dim_num(1)
replyid=0
fm_15=format_mid_num(15)

sql="select top 1 forum_id,topic,counter,re_counter,islock,istop,isgood,isvote,vote_num,form_id,special,special_num,special_data,subhead  from bbs_topic where  id="&viewid
set rs=joekoe_cms.exec(sql,1)
if rs.eof then
  rs.close
  call format_redirect("list.asp?forum_id="&forumid)
end if
forumid=rs(0)
fir_topic=joekoe_cms.code_html(rs(1),1,0)
counter=rs(2)
re_counter=rs(3)
fir_islock=rs(4)
fir_istop=rs(5)
fir_isgood=rs(6)
fir_isvote=rs(7)
fir_vote_num=rs(8)
if trim(request.querystring("recycle"))="yes" then
forumid=rs(9)
end if
special=rs(10)
special_num=rs(11)
special_data=rs(12)
subhead=rs(13)
rs.close

ftit="浏览主题 - "&fir_topic

call forum_first()

if forum_config(4)>0 then
nummer=forum_config(4)
nums=nummer
end if
call web_head(0,0,h_var3,0,0)
'call web_branch(0)
call forum_load()
if is_recycle=true then
  if forum_power_true(forumpower)=false then call format_redirect("list.asp?forum_id="&forumid)
end if
if is_recycle=true then pageurl=pageurl&"recycle=yes&"
response.write joekoe_cms.js_put("../style/data_ads_txt_forum.js",0)
response.write joekoe_cms.js_put("../style/ads_txt_function.js",0)
%><link type=text/css href="../style/code.css" rel=stylesheet><%

'----------------------------中间 开始----------------------------
call forum_ad()
call forum_grade()
call forum_top(""&utit&"（浏览主题）")
'call forum_top(tit)
if fir_isvote then call forum_vote_type()

  sql="select bbs_data.id,bbs_data.topic,bbs_data.icon,bbs_data.word,bbs_data.tim,bbs_data.ip,bbs_data.sys,user_data.username,user_data.nname,user_data.sex,user_data.whe,user_data.qq,user_data.email,user_data.url,user_data.face,user_data.face_w,user_data.face_h,user_data.tim as u_tim,user_data.remark,user_data.emoney,user_data.integral,user_data.power,user_data.last_tim,user_data.bbs_counter,user_data.popedom,user_data.strength,user_data.lentim,user_data.lentimt,bbs_data.pb,user_data.xzdata,user_data.birthday,bbs_data.edited " & _
    "from user_data,bbs_data where user_data.id=bbs_data.userid and bbs_data.reply_id="&viewid&" order by bbs_data.id"
call joekoe_cms.exec("",-1)
rs.open sql,conn,1,1
if rs.eof then
  rs.close
  call format_redirect("list.asp?forum_id="&forumid)
end if
rssum=re_counter+1	'rs.recordcount
call format_pagecute()
'rs.movefirst
nnum=(viewpage-1)*nummer
if int(viewpage)>1 then rs.move nnum
vdim=rs.getrows(nummer)
rs.close

'====================================== 
if fir_isgood=1 and int(viewpage)=1 then response.write "<div style='right: 95px; WIDTH: 0px; POSITION: absolute; TOP: 470px; HEIGHT: 0px'><img border=0 src='"&joekoe_cms.web_dir_skin&"forum/bbs_isgood.gif' width=123 height=104 border=0></div>" 
'====================================== 

response.write vbcrlf&forum_view_top

for i=0 to ubound(vdim,2)
  if replyid=0 then replyid=vdim(0,i)
  rnum=cint(joekoe_cms.rand_num(2))
'--------BY HSCMS--------------------------------------- 
   sql="select cod,id,word from bbs_data where id="&vdim(0,i)
  set rs=joekoe_cms.exec(sql,1)
  if rs.eof then
    rs.close
    call format_redirect("list.asp?forum_id="&forumid)
  end if
  cod=rs("cod")
  if int(cod)<>2 then   
     'word=ubbtst(code_jk(vdim(3,i)))  使用UBB的特殊贴
	 word=code_jk(vdim(3,i))
     word=replace(word,"\n","<br>")
  end if 
  if int(cod)=2 then
	word=rs("word")
	word=html_put(word)
    word=replace(word,"\n","<br>")
    word=replace(word,vbcrlf&vbcrlf,"")
    word=replace(word,CHR(10),"")		'回车
    word=replace(word,CHR(13),"")
  rs.close
end if 

'--------BY HSCMS---------------------------------------
  remark=code_jk2(vdim(18,i))
  remark=replace(remark,"\n","<br>")
  u_popedom=vdim(24,i)
  pb=vdim(28,i)
  if joekoe_cms.popedom_p(u_popedom,42)=1 then
    word="<table border=0><tr><td align=center class=htd><font class=gray>=========================<br><font class=red2><b>该用户的论坛发言已暂时被屏蔽！</b></font><br>=========================</font></td></tr></table>"
    remark=""
  end if
  if pb then
word="<table border=0><tr><td align=center class=htd><font class=gray>=========================<br><font class=red2><b>此贴已暂时被屏蔽！</b></font><br>=========================</font></td></tr></table>"
remark=""
end if
  ip=ip_types(vdim(5,i),"",0)
  if int(fm_15) then
    u_qq=vdim(11,i)
    u_email=joekoe_cms.code_html(vdim(12,i),1,0)
    u_url=joekoe_cms.code_html(vdim(13,i),1,0)
  else
    u_qq=""
    u_email=""
    u_url=""
  end if
  '特殊贴操作开始
  'HSCMS模仿CMS 3.0制作
  if i=0 then '只允许在一楼
   call special_view()
  end if
  response.write vbcrlf&forum_view_body(nnum+i+1,rnum,vdim(0,i),joekoe_cms.code_html(vdim(1,i),1,0),vdim(2,i),word,joekoe_cms.time_type(vdim(4,i),1),ip,vdim(6,i),vdim(7,i),joekoe_cms.code_html(vdim(8,i),1,0),vdim(9,i),joekoe_cms.code_html(vdim(10,i),1,0),vdim(11,i),vdim(12,i),vdim(13,i),joekoe_cms.code_html(vdim(14,i),1,0),vdim(15,i),vdim(16,i),joekoe_cms.time_type(vdim(17,i),1),remark,vdim(19,i),vdim(20,i),vdim(21,i),joekoe_cms.time_type(vdim(22,i),1),vdim(23,i),vdim(25,i),vdim(26,i),vdim(28,i),vdim(29,i),vdim(30,i),vdim(31,i))
next
erase vdim
call joekoe_cms.exec("update bbs_topic set counter=counter+1 where id="&viewid,0)
response.write vbcrlf&forum_view_end()
response.write vbcrlf&forum_main_end()
response.write vbcrlf&forum_view_reply(val_code_num("f_reply_"&forumid,1))
			  
'----------------------------中间 结束----------------------------

call preview_form("write_frm","jk_word")
'call web_branch(0)
call forum_end()
call web_end(0,0)

function forum_view_top()
  dim tmp
  tmp=CMS_Skin.GetDB("forum_view_bar")
  tmp=Replace(tmp,"{$fir_topic}","主题: "&fir_topic)
  tmp=Replace(tmp,"{$forumid}",forumid)
  tmp=Replace(tmp,"{$viewid}",viewid)
  tmp=Replace(tmp,"{$web_skin}",joekoe_cms.web_dir_skin)
  tmp=Replace(tmp,"{$web_url}",joekoe_cms.web_url)
  tmp=Replace(tmp,"{$web_name}",joekoe_cms.web_name)
  tmp=Replace(tmp,"{$fir_topics}",joekoe_cms.code_js(fir_topic,1))
  tmp=Replace(tmp,"{$server}",server.urlencode("view.asp?forum_id="&forumid&"&view_id="&viewid))
  tmp=Replace(tmp,"{$tit}",tit)
  forum_view_top=forum_main_head()&vbcrlf&tmp
end function

function forum_view_body(v_i,v_rnum,v_id,v_topic,v_icon,v_word,v_tim,v_ip,v_sys,u_username,u_nname,u_sex,u_whe,u_qq,u_email,u_url,u_face,u_face_w,u_face_h,u_tim,u_remark,u_emoney,u_integral,u_power,u_last_time,u_bbs_counter,u_strength,u_lentim,u_lentimt,u_xzdata,u_birthday,v_edited)
  dim lt_num
    sql="select count(id) from user_data where lentim>"&u_lentim
    set rs=joekoe_cms.exec(sql,1)
    if not rs.eof then lt_num=rs(0)+1
  dim bg_var,n_user,tmp,nname,whe,email,url,qq,del,code
  '----------------------调用用户组光晕色-----------------------
  dim dim_power,dim_grade,si,sdim,snum,u_color,u_user
  dim_power=dim_user
  dim_grade=split(web_user_grade,"|")
  snum=ubound(dim_power)
  for si=0 to snum
    sdim=split(dim_power(si),":")
    if u_power=sdim(0) then
      u_color=sdim(3)
     u_user=sdim(1)
  end if
  next
  if u_color="" then
    sdim=split(dim_power(0),":")
     u_color=sdim(3)
     u_user=sdim(1)
  end if
 '-----------------------定义模板参数---------------------- 
  web_forum_tcolor=web_forum_tcolor 
  u_color=u_color 
 '-----------------------判断用户类型显示---------------------- 
 if u_power="user" then  u_user=""
 '----------------------------结束--------------------------- 
  bg_var="bbs_tr_list1"
  if (v_i mod 2)=0 then bg_var="bbs_tr_list2"
  n_user=joekoe_cms.code_html(u_username,1,0)
  if u_nname<>"" and var_null(u_nname)<>"" then nname="头衔："&joekoe_cms.code_html(u_nname,1,0)
  if u_whe<>"" and var_null(u_whe)<>"" then whe="来自："&joekoe_cms.code_html(u_whe,1,0)
  if not u_remark="" and var_null(u_remark)<>""  then remark="<tr><td align=center valign=top><table cellspacing=0 cellpadding=0 border=0><tr><td><img src="&joekoe_cms.web_dir_skin&"forum/c1.gif></td><td background="&joekoe_cms.web_dir_skin&"forum/s1.gif align=center><img src="&joekoe_cms.web_dir_skin&"forum/clover.gif></td><td><img src="&joekoe_cms.web_dir_skin&"forum/c2.gif></td></tr><tr><td valign=middle background="&joekoe_cms.web_dir_skin&"forum/s4.gif><img src="&joekoe_cms.web_dir_skin&"forum/clo_tl.gif></td><td>"&u_remark&"</td><td valign=middle background="&joekoe_cms.web_dir_skin&"forum/s2.gif><img src="&joekoe_cms.web_dir_skin&"forum/clo_tr.gif></td></tr><tr><td valign=top><img src="&joekoe_cms.web_dir_skin&"forum/c4.gif></td><td background="&joekoe_cms.web_dir_skin&"forum/s3.gif align=center><img src="&joekoe_cms.web_dir_skin&"forum/clo_y.gif></td><td align=right><img src="&joekoe_cms.web_dir_skin&"forum/c3.gif></td></tr></table></td></tr>"
  if u_email<>"" and var_null(u_email)<>"" then email="<a target=_blank href='mailto:"&u_email&"'><img src='"&joekoe_cms.web_dir_skin&"forum/forum_email.gif' alt='给 "&n_user&" 发邮件' border=0></a>"
  if u_url<>"" and var_null(u_url)<>"" then url="<a href='"&u_url&"' target=_blank><img src='"&joekoe_cms.web_dir_skin&"forum/forum_url.gif' alt='访问 "&n_user&" 的主页' border=0></a>"
  if u_qq<>"0" and var_null(u_qq)<>"" then qq="<a href='http://wpa.qq.com/msgrd?V=1&Uin="&u_qq&"&Site=www.2332.cn&Menu=yes' target='_blank'><img border=0 src='"&joekoe_cms.web_dir_skin&"forum/forum_qq.gif' alt='"&n_user&"的QQ号是"&u_qq&"，点击发送消息给对方'></a>"
  if v_i>1 and forum_power_true(forumpower)=true then del="&nbsp;<a href='isaction.asp?forum_id="&forumid&"&sel_id="&viewid&"&re_id="&v_id&"&action=del'><img src='"&joekoe_cms.web_dir_skin&"small/del2.gif' alt='删除此回贴' align=absMiddle border=0></a>&nbsp;&nbsp;<a href='isaction.asp?forum_id="&forumid&"&sel_id="&viewid&"&re_id="&v_id&"&action=pb'><img src='"&joekoe_cms.web_dir_skin&"small/pb.gif' alt='屏蔽(解除屏蔽)此回贴' align=absMiddle border=0></a>"
if v_i=1 then  code="<tr><td colspan=2 valign=bottom align=right class=gray><br><b>本贴地址</b>：<input onclick=""oCopy(this);window.alert('复制完成，请将本贴推荐给你的朋友！')"" type=text class=gray size=63 value="&joekoe_cms.web_url&"forum/view.asp?forum_id="&forumid&"&view_id="&viewid&"> </td></tr>"
%><!--#include file="../marry/q_marry_show.asp" --><%
  tmp=CMS_Skin.GetDB("forum_view")
  tmp=Replace(tmp,"{$code}",code)
  tmp=Replace(tmp,"{$web_skin}",joekoe_cms.web_dir_skin)
  tmp=Replace(tmp,"{$web_dir}",joekoe_cms.web_path)
  tmp=Replace(tmp,"{$web_unit}",joekoe_cms.web_unit)
  tmp=Replace(tmp,"{$bg_var}",bg_var)
  tmp=Replace(tmp,"{$user}",n_user)
  tmp=Replace(tmp,"{$timt}",lt_num)
  tmp=Replace(tmp,"{$ip}",v_ip)
  tmp=Replace(tmp,"{$user_sys}",user_sys_type(v_sys))
  tmp=Replace(tmp,"{$user_sex}",user_view_sex(u_sex,u_last_time))
  tmp=Replace(tmp,"{$format_user}",format_user_face(u_face,u_face_w,u_face_h))
  tmp=Replace(tmp,"{$forum_user_power}",forum_user_power_grade(u_bbs_counter,u_power))
  tmp=Replace(tmp,"{$nname}",nname)
  tmp=Replace(tmp,"{$birthdy}",constellation(u_birthday,false))
  tmp=Replace(tmp,"{$tcolor}",web_forum_tcolor)
  tmp=Replace(tmp,"{$ucolor}",u_color)
  tmp=Replace(tmp,"{$u_user}",u_user)
  tmp=Replace(tmp,"{$tmp_xzdata}",web_xz(u_xzdata))
  tmp=Replace(tmp,"{$lentim}",rank_img(u_lentimt,u_lentim,0))
  tmp=Replace(tmp,"{$bbs_counter}",u_bbs_counter)
  tmp=Replace(tmp,"{$integral}",u_integral)
  tmp=Replace(tmp,"{$emoney}",u_emoney)
  tmp=Replace(tmp,"{$whe}",whe)
  tmp=Replace(tmp,"{$showPet}",showPet(n_user))
  tmp=Replace(tmp,"{$marry}",love)
  tmp=Replace(tmp,"{$tim}",joekoe_cms.time_type(u_tim,4))
  tmp=Replace(tmp,"{$server}",server.urlencode(u_username))
  tmp=Replace(tmp,"{$email}",email)
  tmp=Replace(tmp,"{$url}",url)
  tmp=Replace(tmp,"{$qq}",qq)
  tmp=Replace(tmp,"{$forumid}",forumid)
  tmp=Replace(tmp,"{$viewid}",viewid)
  tmp=Replace(tmp,"{$id}",v_id)
  tmp=Replace(tmp,"{$i}",v_i)
  tmp=Replace(tmp,"{$mid}",mid(v_tim,1,16))
  tmp=Replace(tmp,"{$icon}",v_icon)
  tmp=Replace(tmp,"{$word}",v_word&v_edited)
  tmp=Replace(tmp,"{$topic}",joekoe_cms.code_html(v_topic,1,0))
  tmp=Replace(tmp,"{$remark}",u_remark)
  tmp=Replace(tmp,"{$rnum}",joekoe_cms.js_put("document.write (ads_txt_type("&v_rnum&",1));",1))
  tmp=Replace(tmp,"{$del}",del)
  tmp=Replace(tmp,"{$strength}",u_strength)
  forum_view_body=tmp
  'call web_branch(0)
end function

function forum_list_pagecute(p_nummer,p_rssum,p_viewpage,p_thepages,p_pageurl)
  dim temp1
  temp1=temp1&vbcrlf&"<tr class=bbs_trline><td colspan=7></td></tr>" & _
              vbcrlf&" <tr height=25><td class=bbs_trp colspan=7> "& _
              vbcrlf&"<table border=0 cellspacing=0 cellpadding=1>" & _
              vbcrlf&"<tr><td width=5></td><td>" & _
              vbcrlf&"共有<font class=red>"&forumtopicnum&"</font>条主题 页次："&p_viewpage&"/"&p_thepages&"</td>" & _
              vbcrlf&"<td width=5></td><td>分页："&jk_pagecute(p_nummer,p_thepages,p_viewpage,p_pageurl,10,"#ff0000")&"</td>" & _
              vbcrlf&"<td width=5></td><form method=post action='list.asp"&p_pageurl&p_thepages&"'><td>转到：<input type=text name=Page size=3 maxlength=10 value='"&p_viewpage&"'> <input type=submit  value=' GO ' name=submit></td></form></tr>" & _
              vbcrlf&"</table></td/></tr>"
  forum_list_pagecute=temp1
end function
function forum_view_end()
  dim temp1
  temp1=""
  temp1=temp1&vbcrlf&"<tr class=trp><td colspan=2>" & _
              vbcrlf&" <table border=0 cellspacing=0 cellpadding=0 width=""100%"">" & _
              vbcrlf&" <tr><td> <table border=0 cellspacing=0 cellpadding=1>" & _
              vbcrlf&"  <tr>" & _
              vbcrlf&"  <td>共有贴子<font class=red>"&re_counter&"</font>贴，浏览<font class=red>"&counter&"</font>人次，分页："&jk_pagecute(nummer,thepages,viewpage,"?forum_id="&forumid&"&view_id="&viewid&"&",5,"#ff0000")&"</td>" & _
              vbcrlf&"  <form method=post action='?forum_id="&forumid&"&view_id="&viewid&"&'><td width=5><td>转到：<input type=text name=Page size=2 maxlength=10  value='"&viewpage&"'> 页 <input type=submit  value='GO' name=submit></td></form><td width=*></td>" & _
              vbcrlf&"  </tr>" & _
              vbcrlf&"  </table>" & _
              vbcrlf&"<td align=right>"&forum_go&"</td></tr></table></td></tr>" & _
                vbcrlf&"  <table border=0>" & _
                vbcrlf&"  <tr>" & _
                vbcrlf&"  <td width=8></td>" & _
                vbcrlf&"  </tr>" & _
                vbcrlf&"  </table>" & _
                vbcrlf&"  <table border=0 cellspacing=0 cellpadding=0 class=bbs_table>" & _
                vbcrlf&"  <tr class=bbs_trb>" & _
                vbcrlf&"  <td><DIV align=center><SCRIPT language=Javascript src='../common/bookmark/bookmark.js'></SCRIPT></DIV><td>" & _
                vbcrlf&"  </tr>" & _
                vbcrlf&"  </table>"
     if forum_power_true(forumpower) then
    temp1=temp1&vbcrlf&"<tr class=bbs_tr><td height=30 align=center colspan=2>" & _
                vbcrlf&"  <table border=0 cellspacing=0 cellpadding=2>" & _
                vbcrlf&"  <form name=del_frm action='isaction.asp' method=get onsubmit=""javascript:frm_submitonce(this);"">" & _
                vbcrlf&"  <input type=hidden name=forum_id value='"&forumid&"'>" & _
                vbcrlf&"  <input type=hidden name=sel_id value='"&viewid&"'>" & _
                vbcrlf&"  <table border=0>" & _
                vbcrlf&"  <tr>" & _
                vbcrlf&"  <td width=8></td>" & _
                vbcrlf&"  </tr>" & _
                vbcrlf&"  </table>" & _
                vbcrlf&"  <table border=0 cellspacing=0 cellpadding=0 class=bbs_table>" & _
                vbcrlf&"  <tr class=bbs_trb align=center>" & _
                vbcrlf&"  <td>帖子状态：</td>" & _
                vbcrlf&"  <td>"&base_forum_isview(fir_isvote,fir_islock,re_counter,fir_istop,fir_isgood)&"</td>" & _
                vbcrlf&"  <td>帖子管理：</td>" & _
                vbcrlf&"  <td><input type=radio name=action value='revert' checked>还原</td>" & _
                vbcrlf&"  <td><input type=radio name=action value='restore'>修复</td>" & _
                vbcrlf&"  <td><input type=radio name=action value='rap'>奖惩</td>" & _
                vbcrlf&"  <td><input type=radio name=action value='move'>转移</td>" & _
                vbcrlf&"  <td><input type=radio name=action value='istop'>固顶</td>" & _
                vbcrlf&"  <td><input type=radio name=action value='istops'>总固顶</td>" & _
                vbcrlf&"  <td><input type=radio name=action value='isgood'>精华</td>" & _
                vbcrlf&"  <td><input type=radio name=action value='islock'>锁定</td>" & _
                vbcrlf&"  <td><input type=radio name=action value='delete'>删除</td>"
    if isarray(dimforumtip) then
      temp1=temp1&vbcrlf&"  <td><input type=radio name=action value='tipid'>专题</td>"    
 end if
      temp1=temp1&vbcrlf&"  <td width=5></td>" & _
                vbcrlf&"  <td><input type=submit class=btn value='执行操作'></td>" & _
                vbcrlf&"  </tr>" & _
                vbcrlf&"  </form>" & _
                vbcrlf&"  </table>" & _
                vbcrlf&"  </td></tr>"
  end if
 forum_view_end=temp1
  'call web_branch(0)
end function

function forum_view_reply(vtext)
  dim temp1
  if login_mode="" then
    temp1=temp1&vbcrlf&"<tr><td class=bg_td colspan=2 >&nbsp;&nbsp;"&web_nologin&"</td></tr>"
  elseif fir_islock=1 then
    temp1=temp1&vbcrlf&"<tr><td class=bg_td colspan=2>&nbsp;&nbsp;主题已被锁定，不能再对其进行回复。</td></tr>"
  else
    temp1=temp1&vbcrlf&"<tr><td class=bbs_td colspan=2>回复主题: "&fir_topic&"</td></tr>"&_
	            vbcrlf&"<form name=write_frm action='reply.asp?forum_id="&forumid&"&view_id="&viewid&"&reply_id="&replyid&"' method=post onsubmit=""javascript:frm_submitonce(this);"">" & _
                vbcrlf&"<input type=hidden name=chk value='yes'>" & _
                vbcrlf&"<input type=hidden name=upid value=''>" & _
                vbcrlf&vtext & _
                vbcrlf&"<tr class=tr>" & _
                vbcrlf&"<td width='20%'>当前心情：</td>" & _
                vbcrlf&"<td width='80%'>"&jk_icon(0)&"</td>" & _
                vbcrlf&"</td>" & _
                vbcrlf&"</tr>" & _
                vbcrlf&"<tr class=tr>" & _
                vbcrlf&"<td class=htd>贴子内容：<br>"&web_frm_word&"<br>长度<="&max_word_size&"KB</td>" & _
                vbcrlf&"<td>字限：<INPUT disabled maxLength=5 name=total size=5 value='35000'>&nbsp;已写：<INPUT disabled maxLength=5 name=used size=5 value=0>&nbsp;剩余：<INPUT disabled maxLength=5 name=remain size=5 value='35000'><BR><textarea name=jk_word id=jk_word rows=8 cols=90 maxlength=1000 title='按 Ctrl+Enter 可直接发送' onkeydown='javascript:frm_quicksubmit();'onkeydown=presskey(); onkeyup=gbcount(this.form.jk_word,this.form.total,this.form.used,this.form.remain); onbeforepaste='if(document.getElementById('x_paste').checked){window.clipboardData.setData('jk_word',trans());this.focus();}'></textarea></td></tr>" & _
                vbcrlf&"<tr class=tr>" & _
                vbcrlf&"<td>E M 贴图：</td>" & _
                vbcrlf&"<td>"&jk_em("write_frm","jk_word")&"</td>" & _
                vbcrlf&"</tr>" & _
                vbcrlf&"<tr class=tr>" & _
                vbcrlf&"<td>巧嘴娃娃：</td>" & _
                vbcrlf&"<td>&nbsp;"&jk_wawa("write_frm","jk_word")&"</td>" & _
                vbcrlf&"</tr>" & _
                vbcrlf&"<tr class=trb>" & _
                vbcrlf&"<td>快速回复：</td>" & _
                vbcrlf&"<td><input type=submit class=btn value='快速发表我的回贴'>　&nbsp;"&preview_b("write_frm","jk_word","预览回复")&"　&nbsp;<input type=reset class=btn value='清除重写'>　&nbsp;（按 Ctrl + Enter 可快速回复）</td>" & _
                vbcrlf&"</tr>" & _
                vbcrlf&"</form>"
  end if
  call forum_bar_top("&nbsp;→ 快速回复："&fir_topic&"",temp1,1) 
  end function
  
  
sub special_view()
'判断是否特殊贴
if var_null(special)="" or not IsNumeric(special) then exit sub
if special<=0 then exit sub
'以下用户可直接查看 
if forum_power_true(forumpower)=true  or vdim(7,i)=login_username then exit sub '版主
if var_null(special_data)<>"" then  
if instr(special_data,"|"&login_username&"|")>0 then exit sub '指定用户
end if

dim s_word,spnum:s_word=""
select case(special)
case 1 '奖励贴
    exit sub  '（制作中...）
case 2  '购买贴
    sql="select id from notes where username='"&login_username&"' and nsort='bbs"&forumid&"' and iid="&viewid&""
    set rs=joekoe_cms.exec(sql,1)
    if not rs.eof then  rs.close :exit sub '已购买，退出
	rs.close
    dim iPostBuyUser
    sql="select username from notes where nsort='bbs"&forumid&"' and iid="&viewid&" order by id"
    set rs=joekoe_cms.exec(sql,1)
    if rs.eof and rs.bof then
    iPostBuyUser="<select name=buyuser size=1><option>还没有用户购买</option>"
    else
    iPostBuyUser="<select name=buyuser size=1><option>已购买用户</option>"
    end if
    do while not rs.eof
    iPostBuyUser=iPostBuyUser&"<option>"&rs("username")&"</option>"
    rs.movenext
    loop
    iPostBuyUser=iPostBuyUser&"</select>"
    rs.close
	spnum=split(special_num,",")
    s_word="本贴为 <font class=red><b>购买贴</b></font> ，购买本贴内容需：<br>"&_
	 vbcrlf&"货币 <font class=red>"&spnum(1)&"</font> "&joekoe_cms.web_unit&"<br>"&_
     vbcrlf&"积分 <font class=red>"&spnum(2)&"</font> 分<br>"&_
     vbcrlf&"体力 <font class=red>"&spnum(4)&"</font> 点<br>"&_
	 vbcrlf&"购买此贴的信息:"&iPostBuyUser&"<br>"&_
	 vbcrlf&"<form action=""buypost.asp"" mothod=post>"&_
	 vbcrlf&"<input type=hidden value="&vdim(7,i)&" name=username><input type=hidden value="&spnum(1)&" name=emoney><input type=hidden value="&spnum(2)&" name=integral><input type=hidden value="&spnum(4)&" name=strength><input type=hidden name=forum_id value="&forumid&"><input type=hidden value="&viewid&" name=view_id><input type=submit class=btn name=submit value='我…我买了！'>"&_
	 vbcrlf&"</from>"
	
case 3  '可见贴
	spnum=split(special_num,",")
	if int(login_emoney)>=cint(spnum(1)) and int(login_integral)>=cint(spnum(2)) and int(login_bbs_counter)>=cint(spnum(6)) and int(login_lentim)>=cint(spnum(7)) and int(login_strength)>=cint(spnum(4)) then exit sub
     s_word="本贴为 <font class=red><b>可见贴</b></font> ，浏览本贴内容需：&nbsp;<br> "&_
	 vbcrlf&"货币 <font class=red>"&spnum(1)&"</font> "&joekoe_cms.web_unit&"<br>"&_
     vbcrlf&"积分 <font class=red>"&spnum(2)&"</font> 分<br>"&_
     vbcrlf&"体力 <font class=red>"&spnum(4)&"</font> 点<br>"&_
     vbcrlf&"发贴 <font class=red>"&spnum(6)&"</font> 贴<br>"&_
     vbcrlf&"在线 <font class=red>"&spnum(7)&"</font> 分钟"
case 4  '回复帖
	sql="select id from bbs_data where forum_id="&forumid&" and reply_id="&viewid&" and username='"&login_username&"'"
    set rs=joekoe_cms.exec(sql,1)
	if rs.eof and rs.bof then
    s_word="本贴为 <font class=red><b>回复贴</b></font> ，只有回复本贴的用户才可浏览本贴的主要内容。 "
	else
	exit sub
	end if
case 5  '指定贴
     dim tuser,tlen
	 tuser=replace(special_data,"|",",")
	  tlen=len(tuser)
	  tuser=left(tuser,tlen-1)
	  tuser=right(tuser,tlen-2)
     s_word="本贴为 <font class=red><b>指定贴</b></font> ，只有指定的用户才可浏览本贴的主要内容。<br> "&_
	 vbcrlf&"指定用户:"&tuser
end select
'未通过上述验证，显示特殊贴信息（这里及上面可以使用模板来控制）
 word="--------------------------------------------------<br>" &_
 vbcrlf&s_word&"<br>"&_
 vbcrlf&"--------------------------------------------------<br> " &_
 vbcrlf&code_jk(subhead)
end sub

Function showPet(Str)
	Dim poppet,pet,User
	User=Str
	poppet="select * from [mypetdata] where username ='"& User &"'"
	set rspet = connpet.execute(poppet)
	if not rspet.eof then
	Dim t,today,pett,petlevel,petep,petshowlevel,level1,level2,petpic,pethp,petatk,petdef,petmaxhp,petsp,levelpic,mypet,mypetlevel,turn
	Dim hpf,spf,petdead,petsex,petpk,mypetsx,imgset
	t=now()
	today = date()
	pett= DateDiff("d", rspet("petregdate"), today)    
	petlevel = sqr((Log(rspet("mypetexp")) / Log(10)) * (Log(rspet("mypetexp")) / Log(10)) * (Log(rspet("mypetexp")) / Log(10)) * (Log(rspet("mypetexp")) / Log(10)) * (Log(rspet("mypetexp")) / Log(10)))
	petsex = rspet("mypetsex")
	turn=int(rspet("relive"))		'转生设置
	if turn<1 then 
	turn = "<font color=red>未</font>"
	else
	turn=turn &" 转"
	end if
	petep = int (100 * (petlevel - int (petlevel)))
	petshowlevel =  int (petlevel + 1)
	levelpic=int(petshowlevel/10)
	if (levelpic>10) then levelpic=11 end if
	level1=int(petshowlevel/2)
	level2=int(petshowlevel/2)
	petpic=rspet("mypetname")
	pethp=rspet("mypethp")
	petatk=rspet("mypetatk")+rspet("item1Num")+rspet("item2Num")+2+level1
	petdef=rspet("mypetdef")+rspet("item3Num")+rspet("item4Num")+rspet("item5Num")+3+level1
	if (petshowlevel<2) then 
	petmaxhp=DEF_PET_basichp 
	else 
	petmaxhp=DEF_PET_basichp+petshowlevel*5
	end if
	petsp=rspet("mypetsp")-pett*DEF_PET_basicsp2
	if(petsp>DEF_PET_basicsp) then petsp=DEF_PET_basicsp end if
	hpf= int (100 * (pethp / petmaxhp)) - 1
	spf= int (100 * (petsp / DEF_PET_basicsp)) - 1
	if (pethp<0) then pethp=0 end if
	if (petsp<0) then petsp=0 end if
	if (rspet("openpk") < 2) then
	petpk="来啊，PK，PK"
	else
	petpk="我不想打，不想不想……"
	end if
	if ( hpf >= 98 ) then hpf = hpf - 2 end if
	if ( spf >= 98 ) then spf = spf - 2 end if

	if pethp<1 or petsp<1 then 
	petdead= "死亡"
	else
	if petsp<1000 then
	petdead="<font color=red>我快饿死了,主人虐待我!</font>"
	else
	petdead= "生存"
	end if
	end if

	if petsex>1 then 
	petsex= "女生"
	else
	petsex= "男生"
	end if

	mypet=rspet("mypet")
	mypetsx = rspet("mypetsx")
	mypetlevel = rspet("mypetlevel")
	dim petkill,pic
	if (rspet("mypetdead") = 1) then
	petkill=""
	else
	petkill=""
	end if
	imgset = rspet("imgset")    
	if (imgset=-1)  then 
	pic=levelpic
	else
	pic=imgset
	end if
	showPet="<tr><td><font color=purple>宠物宝宝</font>：<a href=../pet/petview.asp?username="& User &" title=查看宠物信息 target=_blank><font color=red>"&rspet("mypet")&"</font></a></td></tr>" & _
          vbcrlf&"<tr><td><div align=center><a href=../pet/petview.asp?username="& User &" title=查看"&User&"的宠物属性 target=_blank><img src=../pet/images/pet/"&petpic&"/"&petkill&""&petpic&""&pic&".gif border=0></a></div></td></tr>" & _
          vbcrlf&"<tr><td><div align=center>====<a href=../pet/petrisk.asp target=_blank title=宠物大冒险>!我的宝宝要去冒险咯!</a>====" & _
          vbcrlf&"<BR>等级："&mypetlevel&"级&nbsp;&nbsp;属性："&mypetsx&"<BR>状态："&petdead&"&nbsp;&nbsp;转生："&turn&"</div></div></td></tr>" & _
          vbcrlf&"<tr><td><div align=center><a href=../pet/petbattle.asp?atkname="& User &"&action=atkpet title=和他的宠物pk："&petpk&" target=_blank><font color=purple>☆攻击他的宠物宝宝☆</font></a></div></td></tr>" & _
          vbcrlf&"</td></tr>"
     else
	 showPet = "<tr><td align=center><FONT COLOR=""#FF0000"">还没宠物，<br>快去买一个啊!</FONT><br>[<a href=../pet/petshop.asp><font color=navy>宠物商店</font></a>]</td></tr>"
	 end if
	rspet.close
End Function
%>
