
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%

Option Explicit
response.buffer=true 	'开启缓冲页面功能
%>
<!-- #include file="common.asp" -->
<!-- #include file="common_other.asp" -->
<!-- #include file="common_skin.asp" -->
<!-- #include file="jk_encrypt.asp" -->
<!-- #include file="jk_class.asp" -->
<%
dim joekoe_cms,conn,rs,sql,page_power,i,tit,tit_fir,index_url,action,dim_user,dim_num
dim login_username,login_id,login_password,login_mode,login_popedom,login_emoney,login_integral,login_modep,login_faces,login_num,login_isper,login_cname,login_sex
dim ukong,redx

set joekoe_cms=new class_joekoe_cms
'---------------------------------数据库连接字符串----------------------------------
joekoe_cms.connstr="DBQ="&server.mappath("#yan163-date#/#yan163#date.asp")&";DRIVER={Microsoft Access Driver (*.mdb)};"
'----------------------------------网站Cookies名称----------------------------------
joekoe_cms.web_cookies="joekoe_online"
'-----------------------------------------------------------------------------------
joekoe_cms.web_name=web_dim(1)
joekoe_cms.web_url=web_dim(2)
joekoe_cms.web_email=web_dim(4)
joekoe_cms.web_tel=web_dim(23)
joekoe_cms.web_qq=web_dim(24)
joekoe_cms.web_beh=web_dim(25)
joekoe_cms.web_skin=web_dim(7)
joekoe_cms.web_upload=web_dim(13)
joekoe_cms.web_unit=web_dim(9)
joekoe_cms.web_health=web_dim(18)
joekoe_cms.web_dir_skin=web_dim(6)&"skin/"&web_dim(7)&"/"
if int(web_dim(0))<2 then joekoe_cms.js_tim=""
dim_user=split(web_dim(19),"|")
dim_num=split(web_dim(12),"|")
login_username=trim(request.cookies(joekoe_cms.web_cookies)("login_username"))
login_password=trim(request.cookies(joekoe_cms.web_cookies)("login_password"))
login_id=0
login_mode=""
login_modep=0
login_num=0
login_popedom=""
login_emoney=0
login_integral=0
login_cname=""
action=trim(request.querystring("action"))
action=replace(action,"'","")
action=replace(action,"""","")
ukong="<table border=0><tr><td height=6></td></tr></table>"
redx="&nbsp;<font class=red>*</font>&nbsp;"

sub web_clear(c_end)
  response.cookies(joekoe_cms.web_cookies).path=joekoe_cms.web_dir
  if request.cookies(joekoe_cms.web_cookies)("iscookies")="yes" then
    response.cookies(joekoe_cms.web_cookies).expires=date+3650
  else
 response.cookies(joekoe_cms.web_cookies).expires=DateAdd("n",dim_num(2),joekoe_cms.now_time)
  end if
  erase dim_num
  erase web_dim
  if isobject(rs) then set rs=nothing
  if joekoe_cms.isconn then
    conn.close
    set conn=nothing
  end if
  set joekoe_cms=nothing
  if c_end=1 then response.end
end sub

function var_null(ub)
  var_null=trim(ub)
  if var_null="" or isnull(var_null) then var_null=""
end function

function int_true(nvar)
  int_true=true
  if var_null(nvar)="" or not(isnumeric(nvar)) or instr(nvar,".")>0 then int_true=false
end function

function num_true(nvar)
  num_true=true
  if var_null(nvar)="" or not(isnumeric(nvar)) then num_true=false
end function

function format_mid_num(nnum)
  if nnum>len(web_dim(11)) then
    format_mid_num=0
    exit function
  end if
  format_mid_num=int(mid(web_dim(11),nnum,1))
end function

function first_id(ndata,id)
  dim rsf
  set rsf=joekoe_cms.exec("select top 1 "&id&" from "&ndata&" order by "&id&" desc",1)
  first_id=rsf(id)
  rsf.close
  set rsf=nothing
end function

function code_admin(strers,at,acut)
  dim strer
  strer=trim(strers)
  select case int(at)
  case 1
    strer=trim(request.form(strer))
  case 2
    strer=trim(request.querystring(strer))
  end select
  if isnull(strer) or strer="" then
    code_admin=""
    exit function
  end if
  strer=replace(strer,"'","""")
  if int(acut)>0 then strer=left(strer,acut)
  code_admin=strer
end function

'-------------------------------------用户等级--------------------------------------
function format_power(pvar,pt)		'format_power(login_mode,2)
  dim pi,pdim,temp1
  select case pt
  case 2
    temp1=1
  case 3
    temp1=0
  case else
    temp1=""
  end select
  if pvar="" then
    format_power=temp1
    exit function
  end if
  for pi=0 to ubound(dim_user)
    pdim=split(dim_user(pi),":")
    if pvar=pdim(0) then
      select case pt
      case 1
        temp1=pdim(1)
      case 2
        temp1=pi+1
      case 3
        temp1=pdim(2)
      case else
        temp1=pvar
      end select
    end if
    erase pdim
  next
  format_power=temp1
end function

function format_power2(pnn,pt)		'format_power2(1,3)
  dim pdim
  format_power2=""
  pdim=split(dim_user(pnn-1),":")
  format_power2=pdim(pt-1)
  erase pdim
end function


function format_emoney_power(n_emoney,n_usert,n_pt)
  dim temp1,ddim,nj,nk,upnum
  upnum=ubound(dim_user)         'joekoe_cms.cache_get("user_group_len")
  ddim=split(n_usert,".")
  for nj=0 to ubound(ddim)
    nk=ddim(nj)
    if int(upnum+1)>=int(nk) then
      if int(nk)=0 then
        temp1=temp1&img_skin("icon_other")
      else
        temp1=temp1&img_skin("icon_"&format_power2(nk,1))
      end if
    end if
  next
  if isarray(ddim) then erase ddim
  if n_pt=1 then temp1=temp1&"&nbsp;<font class=red2>"&n_emoney&"</font>&nbsp;"&joekoe_cms.web_unit
  format_emoney_power=temp1
end function

'-------------------------------------错误信息--------------------------------------
function found_error(error_type,error_len)
  dim temp1
  temp1=replace(error_type,"+","<img src='images/small/jt_err.gif' border=0 align=absmiddle>&nbsp;")
  temp1=vbcrlf&"<table border=0 width=" & error_len & ">" & _
	vbcrlf&"<tr><td align=center height=50><font class=red>系统发现你输入的数据有以下错误：</font></td></tr>" & _
	vbcrlf&"<tr><td class=htd>" & temp1& "</td></tr>" & _
	vbcrlf&"<tr><td align=center height=50><a href='javascript:history.back(1)'>返回上一页</a></td></tr>" & _
	vbcrlf&"</table>"
  found_error=temp1
end function

'--------------------------判断用户名、代号和密码的合法性--------------------------
function symbol_name(sn_var)
  symbol_name=false
  if sn_var="" or len(sn_var)>20 or instr(sn_var,"|")>0 or instr(sn_var,":")>0 or instr(sn_var,"'")>0 or instr(sn_var,"""")>0 or instr(sn_var,chr(9))>0 or instr(sn_var,chr(10))>0 or instr(sn_var,chr(13))>0 or instr(sn_var,chr(32))>0 then
    exit function
  end if
  for i=1 to len(sn_var)
    if instr(web_dim(15),mid(sn_var,i,1))>0 then exit function
  next
  symbol_name=true
end function

function symbol_ok(symbol_var)
  symbol_ok=false
  symbol_var=symbol_var
  if symbol_var="" or len(symbol_var)>20 then exit function
  for i=1 to len(symbol_var)
    if instr(web_dim(16),mid(symbol_var,i,1))=0 then exit function
  next
  symbol_ok=true
end function
  
'-------------------------------------字符处理--------------------------------------
function health_name(hnn)
  dim ti,tnum,tdim,hn
  health_name=false
  hn=hnn
  tdim=split(web_dim(17)&":"&web_dim(18),":")
  tnum=ubound(tdim)
  for ti=0 to tnum
    if instr(hn,tdim(ti))>0 then
      erase tdim
      exit function
    end if
  next
  erase tdim
  health_name=true
end function

function health_var(hnn,vt)
  if not joekoe_cms.ishealth then
    health_var=hnn
    exit function
  end if
  dim ti,tj,tdim,ht,hn
  hn=hnn
  if format_mid_num(5)=1 then
    tdim=split(web_dim(18),":")
    for ti=0 to ubound(tdim)
      ht=""
      for tj=1 to len(tdim(ti))
        ht=ht&"*"
      next
      hn=replace(hn,tdim(ti),ht)
    next
    erase tdim
  end if
  health_var=hn
end function
%><%
On Error Resume Next
Dim strTemp,hk
If Trim(Request.QueryString) <> "" Then strTemp =Trim(Request.QueryString)

strTemp = LCase(strTemp)
hk=0
If Instr(strTemp,"count(")<>0 then hk=1
If Instr(strTemp,"asc(")<>0 then hk=1
If Instr(strTemp,"mid(")<>0 then hk=1
If Instr(strTemp,"char(")<>0 then hk=1
If Instr(strTemp,"xp_cmdshell")<>0 then hk=1
If Instr(strTemp,"'")<>0 then hk=1
if hk=1 then
Response.Write "<script language='javascript'>"
Response.Write "alert('大虾,你搞什么啊？');"
Response.Write "location.href='javascript:history.back()';"
Response.Write "</script>"
response.end
hk=0
End If
%>