false if isnumeric(left(sip,2)) then str1=left(sip,instr(sip,".")-1) sip=mid(sip,instr(sip,".")+1) str2=left(sip,instr(sip,".")-1) sip=mid(sip,instr(sip,".")+1) str3=left(sip,instr(sip,".")-1) str4=mid(sip,instr(sip,".")+1) if isNumeric(str1)=0 or isNumeric(str2)=0 or isNumeric(str3)=0 or isNumeric(str4)=0 then else num=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1 sql="select count(*) from LockIP where ip1 <="&;num&;" and ip2 >="&;num&;"" set rs=conn.execute(sql) if rs(0)>0 then LockIP=true end if set rs=nothing end if end if end function Rem 判断发言是否来自外部 function ChkPost() dim server_v1,server_v2 chkpost=false server_v1=Cstr(Request.ServerVariables("HTTP_REFERER")) server_v2=Cstr(Request.ServerVariables("SERVER_NAME")) if mid(server_v1,8,len(server_v2))<>server_v2 then chkpost=false else chkpost=true end if end function Rem 判断用户来源 function address(sip) dim str1,str2,str3,str4 dim num
dim country,city dim irs if isnumeric(left(sip,2)) then if sip="127.0.0.1" then sip="192.168.0.1" str1=left(sip,instr(sip,".")-1) sip=mid(sip,instr(sip,".")+1) str2=left(sip,instr(sip,".")-1) sip=mid(sip,instr(sip,".")+1) str3=left(sip,instr(sip,".")-1) str4=mid(sip,instr(sip,".")+1) if isNumeric(str1)=0 or isNumeric(str2)=0 isNumeric(str4)=0 then else
or
isNumeric(str3)=0
or
num=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1 sql="select Top 1 country,city from address where ip1 <="&;num&;" and ip2 >="&;num&;"" set irs=server.createobject("adodb.recordset") irs.open sql,conn,1,1 if irs.eof and irs.bof then country="亚洲" city="" else country=irs(0) city=irs(1) end if irs.close set irs=nothing end if address=country&;city else address="未知" end if end function function iif(expression,returntrue,returnfalse) if expression=0 then iif=returnfalse else iif=returntrue end if end function
function iiif(express,expression,returntrue,returnfal
se) if express>expression then iiif=returnfalse else iiif=returntrue end if end function function iimg(expression,returnfalse,returntrue) if expression="" or isnull(expression) then iimg=returnfalse else iimg=returntrue end if end function Rem 过滤 SQL 非法字符 function checkStr(str) if isnull(str) then checkStr = "" exit function end if checkStr=replace(str,"'","''") end function Rem 用户在线 sub activeonline() dim ComeFrom,actCome,statuserid statuserid=replace(replace(Request.ServerVariables("REMOTE_HOST"),".",""),"'","" ) if not founduser then session("userid")=statuserid
sql="select id,boardid from online where id="&;cstr(session("userid")) set rs=conn.execute(sql) if rs.eof and rs.bof then ComeFrom="" actCome="" sql="insert into online(id,username,userclass,ip,startime,lastimebk,boardid,browser,stats,actforip,User GroupID,actCome,userhidden) values ("&;statuserid&;",' 客 人 ',' 客 人 ','"&;replace(Request.ServerVariables("REMOTE_HOST"),"'","")&;"',Now(),Now()," &;boardid&;",'"&;replace(Request.ServerVariables("HTTP_USER_AGENT"),"'","")&;"' ,'"&;replace(stats,"'","")&;"','"&;replace(Request.ServerVariables("HTTP_X_FORWAR DED_FOR"),"'","")&;"',7,'"&;actCome&;"',"&;userhidden&;")"
else sql="update on