<%

sub checkip()
	dim rs
	set rs=conn.execute("select lockip from lockip where lockip='"&Request.ServerVariables("REMOTE_ADDR")&"'")
	if not (rs.bof or rs.eof) then
	Response.Write"<script language=JavaScript>"
	Response.Write"alert(""对不起！你的IP已被锁定，不能进行当前操作！"");"
	Response.Write"window.history.go(-1);"
	Response.Write"</script>"
	end if
	set rs=nothing	
end sub

sub checkuserlock()
	dim rs
	set rs=conn.execute("select lockuser from [user] where username='"&username&"'")
	if rs(0)=true then
	Response.Write"<script language=JavaScript>"
	Response.Write"alert(""对不起！你的ID已被锁定，不能进行当前操作！"");"
	Response.Write"window.history.go(-1);"
	Response.Write"</script>"
	end if
	set rs=nothing	
end sub

function blognow()
dim rstime
set rstime=conn.execute("select timediff from bloginfo")
	blognow=dateadd("h",rstime(0),now())
	set rstime=nothing
end function

function findbadstr(str)
	dim rs,badstr,i
	Dim a,n
	n=0
	set rs=conn.execute("select blogFiltrate from filtrate")
	badstr=split(rs(0),"|")
	for i=0 to ubound(badstr)		
		a = InStr(1,str,badstr(i))
		Do While a > 0
			n = n + 1
			a = InStr(a + 1, str, badstr(i))
		Loop
	next
	set rs=conn.execute("select maxbadstr_num from bloginfo")
	if rs(0)>n then
		findbadstr=false
	else
		findbadstr=true
	end if
	set rs=nothing
end function

function debadstr(str)
	dim rs,badstr,i
	debadstr=str
	set rs=conn.execute("select blogFiltrate from filtrate")
	badstr=split(rs(0),"|")
	for i=0 to ubound(badstr)
	debadstr=replace(debadstr,badstr(i),"***")
	next
	set rs=nothing
end function

%>