<!-- #include file="../../include/jk_frm.asp" -->
<!-- #include file="../../include/jk_upload.asp" -->
<!-- #include file="../../include/jk_val_code.asp" -->
<%
function format_remark_var(byval strer,byval strt)
  if strer="" or isnull(strer) then exit function
  dim re
  Set re=new RegExp
  re.IgnoreCase=True
  re.Global=True
  'if strt>0 then
  '  re.Pattern="\[align=right\](.|\n)*\[\/align\]"
   ' strer=re.Replace(strer,"")
 ' end if
  if strt>1 then
    re.Pattern="\[quote\](.|\n)*\[\/quote\]"
    strer=re.Replace(strer,"")
  end if
  set re=nothing
  strer=trim(strer)
  'strer=cls.code_health(strer)
  'strer=cls.code_word(strer)
  strer=replace(strer,"<","&lt;")
  strer=replace(strer,">","&gt;")
  strer=replace(strer,"\","\\")
  strer=replace(strer,"'","\'")
  strer=replace(strer,vbcrlf,"\n")
  strer=replace(strer,chr(10),"\n")
  strer=replace(strer,chr(13),"")
  format_remark_var=strer
end function

function form_icon()
  dim temp1
  temp1=trim(request.form("icon"))
  if not isnumeric(temp1) then
    temp1="0"
  end if
  form_icon=temp1
end function

sub val_chk_end_forum(vals)
  dim is_vals
  select case int(forum_config(16))
  case 1
    is_vals=false
  case 2
    is_vals=true
  case 0
    if int(format_mid_num(43))=0 then
      is_vals=true
    else
      is_vals=false
    end if
  end select
  if is_vals=true then  
    call val_chk_end(vals)
  end if
end sub

sub forum_readonly()
  if int(forumpro)<>1 then
    exit sub
  end if
  if not forum_power_true(forumpower) then
    call web_error("readonly")
  end if
end sub

function word_size_true(wst_var)
  word_size_true=false
  if wst_var="" then exit function
  dim tmp_wnum
  tmp_wnum=len(wst_var)
  if tmp_wnum<int(min_word_size) then exit function
  if tmp_wnum>(max_word_size*1024) then exit function
  word_size_true=true
end function

function chinese(types)
  dim ctypes,i,tt
  ctypes=types:chinese="no"
  for i=1 to len(ctypes)
    tt=mid(ctypes,i,1)
    if int(asc(tt))<0 then chinese="yes":exit for
  next
end function

sub forum_write_frm_check()
    response.write joekoe_cms.js_put("../style/post.js",0)
	response.write joekoe_cms.js_put("../style/post_ubb.js",0)
%>
<script language=javascript>

post_load('frm_post','topic','jk_word',10,12,1,1);

function check_post(strer)
{
  var tmptopic=post_value("_topic");
  var tmpremark=post_value("_remark");
  switch (strer)
  {
    case "edit":
      if (tmpremark=="") {alert("请先填写贴子的内容！"); post_focus("_remark"); return false; }
      break;
    case "reply":
      if (tmpremark=="") { alert("请先填写贴子的内容！"); post_focus("_remark"); return false; }
      break;
    default :
      if (tmptopic=="" || tmpremark=="")
      {
        alert("请先填写贴子的主题及内容！");
        if (tmpremark=="") post_focus("_topic");
        else post_focus("_remark");
        return false;
      }
      var tmpspecial=check_special();
      if (tmpspecial!="")
      {
        var tmperr="";
        switch (tmpspecial)
        {
          case "num":
            tmperr="请先填写特殊贴的相关分值信息！"; break;
          case "data":
            tmperr="请先填写特殊贴的相关用户信息！"; break;
          case "remark":
            tmperr="请先填写特殊贴的相关说明信息！"; break;
          default :
            tmperr="请先填写特殊贴的相关("+tmpspecial+")信息！"; break;
        }
        alert(tmperr); return false;
      }
      break;
  }
  return true;
}
</script>
<%
end sub

sub forum_tip_select(strid,n)
  dim d
 if n=1 then 
  n="disabled" 
 else 
  n="enabled" 
 end if 
%>
  <select name=tip_id size=1 class=sel <%=n%>>
  <option value="0" selected>请选择所属专题</option>
<%for d=0 to ubound(dimforumtip,2)%>
  <option value="<%=dimforumtip(2,d)%>" <%if int(strid)=int(dimforumtip(2,d)) then response.write "selected"%>><%=dimforumtip(3,d)%></option>
<%next%>
  </select>
<%
end sub
%>