<%
function cod_type()
  dim a:a=trim(request.form("cod"))
  if a="" or isnull(a) then a=1
  if not(isnumeric(a)) then a=1
  if int(a)<>2 then a=1
  cod_type=a
end function

function cs_nd(csv)
  dim csnd:cs_nd="yes"
  csnd=trim(request.form("csnd"))
  if len(csv)<1 then cs_nd="no":exit function
  if csnd="yes" then
    if isnumeric(csv) then cs_nd="no":exit function
  end if
end function

sub html_edit(cods,fn,wn)
  dim cod:cod=cods
  if cod="" or isnull(cod) then cod=1
%>
  <tr id=ubb_help style="display:<%
  if cod=2 then
    response.write "none"
  else
    response.write "true"
  end if%>;" height=35 class=tdbg-dark><td align=center><%call frm_ubb_type()%></td><td><%call frm_ubb(fn,wn,"&nbsp;&nbsp;")%></td></tr>
  <tr class=tdbg-dark><td align=center>支持模式：</td><td>
    <table border=0 cellspacing=0 cellpadding=0>
    <tr>
    <td><input type=radio name=cod onclick="document.all.ubb_help.style.display='';document.all.html_help.style.display='none';" value='1'<%if cod<>2 then response.write " checked"%>>&nbsp;支持UBB</td>
    <td>&nbsp;<input type=radio name=cod onclick="document.all.ubb_help.style.display='none';document.all.html_help.style.display='';" value='2'<%if cod=2 then response.write " checked"%>>&nbsp;支持HTML</td>
    <td id=html_help style="display:<%
  if cod=2 then
    response.write "true"
  else
    response.write "none"
  end if%>;">&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" onclick="javascript:open_win('html_edit.htm?bodyID=<%response.write fn&"."&wn%>&htmlableID=<%response.write fn&"."&wn%>','html_edit',545,360,'no');">HTML 编辑器</a></td>
    </tr>
    </table>
  </td></tr>
<%
end sub

function code_admin(strers)
  dim strer:strer=trim(strers)
  if isnull(strer) or strer="" then code_admin="":exit function
  strer=replace(strer,"'","""")
  code_admin=strer
end function

function code_config(strers)
  dim strer:strer=trim(strers)
  if isnull(strer) or strer="" then code_config="":exit function
  strer=replace(strer,"'","")
  strer=replace(strer,":","")
  strer=replace(strer,"|","")
  strer=replace(strer,".","")
  code_config=strer
end function

function ender()
  ender=vbcrlf & "</td></tr><tr><td height=30 align=center>"&objv7.web_var(web_error,4)&"</td></tr>" & _
	vbcrlf & "</center></body></html>"
end function

sub sql_cid_sid()
  if cid<>0 then
    sqladd=" where c_id="&cid
    pageurl=pageurl&"c_id="&cid&"&"
    if sid<>0 then
      sqladd=sqladd&" and s_id="&sid
      pageurl=pageurl&"s_id="&sid&"&"
    end if
  end if
end sub

sub chk_cid_sid()
  if isnumeric(csid) then
    cid=csid:sid=0
  else
    cid=mid(csid,1,instr(csid,"&")-1)
    sid=mid(csid,instr(csid,"&")+1,len(csid))
  end if
end sub

sub admin_cid_sid()
  cid=trim(request.querystring("c_id"))
  sid=trim(request.querystring("s_id"))
  if not(isnumeric(cid)) then cid=0
  if not(isnumeric(sid)) then sid=0
  cid=int(cid):sid=int(sid)
end sub

sub chk_csid(n_sort,cid,sid)
  dim sql3,rs3,csnd:csnd="no"
  response.write "<select name=c_id size=1>"
  sql3="select c_id,c_name from jk_class where nsort='"&n_sort&"' order by c_order,c_id"
  set rs3=conn.execute(sql3)
  do while not rs3.eof
    nid=int(rs3(0))
    response.write vbcrlf&"<option value='"&nid&"' class=bg_2"
    if cid=nid then response.write " selected"
    response.write ">"&rs3(1)&"</option>"
    sql2="select s_id,s_name from jk_sort where c_id="&nid&" order by s_order,s_id"
    set rs2=conn.execute(sql2)
    do while not rs2.eof
      now_id=int(rs2(0))
      csnd="yes"
      response.write vbcrlf&"<option value='"&nid&"&"&now_id&"'"
      if sid=now_id then response.write " selected"
      response.write ">　"&rs2(1)&"</option>"
      rs2.movenext
    loop
    rs2.close:set rs2=nothing
    rs3.movenext
  loop
  rs3.close:set rs3=nothing
  response.write "</select><input type=hidden name=csnd value='"&csnd&"'>"&redx
end sub

sub left_sort(t1,t2)
  dim rs,sql
  sql="select c_id,c_name from jk_class where nsort='"&nsort&"' order by c_order,c_id"
  set rs=conn.execute(sql)
  do while not rs.eof
    nid=int(rs(0))
    if cid=nid then
      response.write vbcrlf&img_small("jt1")&"<a href='?"&t1&"c_id="&nid&"'><b><font class=red_3>"&rs(1)&"</b></font></a><br>"
    else
      response.write vbcrlf&img_small("jt0")&"<a href='?"&t1&"c_id="&nid&"'><font class=red_3>"&rs(1)&"</font></a><br>"
    end if
    sql2="select s_id,s_name from jk_sort where c_id="&nid&" order by s_order,s_id"
    set rs2=conn.execute(sql2)
    do while not rs2.eof
      now_id=int(rs2(0))
      if sid=now_id then
        response.write vbcrlf&"　<a href='?"&t1&"c_id="&nid&"&s_id="&now_id&"'><font class=blue>"&rs2(1)&"</a></a><br>"
      else
        response.write vbcrlf&"　<a href='?"&t1&"c_id="&nid&"&s_id="&now_id&"'>"&rs2(1)&"</a><br>"
      end if
      rs2.movenext
    loop
    rs2.close:set rs2=nothing
    rs.movenext
  loop
  rs.close
end sub

sub chk_power(power,pt)
  dim ddim:ddim=split(user_power,"|")
  for i=0 to ubound(ddim)
    response.write vbcrlf&"<input type=checkbox name=power value='"&i+1&"' class=bg_1"
    if instr(1,"."&power&".","."&i+1&".")>0 or pt=1 then response.write " checked"
    response.write ">"&right(ddim(i),len(ddim(i))-instr(ddim(i),":"))
  next
  erase ddim
%><input type=checkbox name=power value='0' class=bg_1<%if instr(1,"."&power&".",".0.")>0 then response.write " checked"%>>游客<%
end sub

sub chk_emoney(ee)
  response.write "&nbsp;货币：<input type=text name=emoney value='"&ee&"' size=6 maxlength=10>"
end sub

sub chk_h_u()
%>&nbsp;&nbsp;<input type=checkbox name=hidden<%if rs("hidden")=false then response.write " checked"%> value='yes'>&nbsp;隐藏
&nbsp;<input type=checkbox name=username_my value='yes'>&nbsp;<font alt='发布人：<%response.write rs("username")%>'>修改发布人为我</font><%
end sub
%>