<!--#include file = "../inc/dbconn.asp"-->
<!--#include file = "../inc/cache.asp"-->
<!--#include file = "../inc/function.asp"-->

<% call dbconn %>
<%
if IS_Pop("IS09") then Response.end '判断是否开启统计 首页/分页全面点击监控

on error resume next
dim ComeWeb:ComeWeb= gqv("f")
if ComeWeb="" then ComeWeb=request.ServerVariables("HTTP_REFERER")
if ComeWeb="" then ComeWeb="http://xxx.itmop.com"                     '未知来路
if Instr(ComeWeb,"654.cn")>0 then  Response.end                    '如果是本站来源的，不计算！可以避免查找！


dim IsCheck
dim Come654CN:Come654CN="come654cn"
dim ComeIP:ComeIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
if ComeIP = "" then ComeIP = Request.ServerVariables("REMOTE_ADDR")'获取来访ip
if ComeIP = "" then ComeIP="126.127.128.129"   '未知IP


if request.servervariables("HTTP_REFERER")="" then
   Response.write "老兄，你想作弊了吧！请您大人大量，如果您真的需要的后，请QQ，我给你直接加上1oooooo总可以了吧，最后，程序是无罪了，你就饶了它吧！<BR>"
   Response.end
end if
Call PreventRefresh(5)
Conn.Execute "insert into TJ654_COUNT (TJ_Come,TJ_Ip,TJ_Day,TJ_Hour) values('"&ComeWeb&"','"&ComeIP&"',"&TJ_Day&","&TJ_Hour&")"  

if day(now)-TJ_day=0 then  '判断当前日期
   if datediff("n",TJ_now,now)<3 then		
      call UpIndexLinkNum(ComeWeb,3)
   else '生成首页,更新时间
      call createindex()
      call UpIndexLinkNum(ComeWeb,5)
   end if 
   Response.end
else
   call createindex()
   call UpIndexLinkNum(ComeWeb,1)
   Response.end
end if

function UpIndexLinkNum(TJ_Come,times)    
   dim rs
   set rs = conn.execute("select * from ZZ654_Link where ESite like '%"&split(Replace(Replace(TJ_Come,"http://www",""),"http://",""),"/")(0)&"%' order by id desc")      
   if not rs.eof then
	  Conn.Execute "Update ZZ654_Link Set Auditing=-1 , Hide=0 , In5 = In5+1 where id ="&rs("id") '通过审核，有报错也激活了！
   end if
   rs.close:set rs = nothing   
   If times=5 then '5分钟时   
      Conn.Execute "Update DH654_setup Set TJ_now ='"&now()&"',TJ_day ='"&day(now)&"',TJ_hour ='"&hour(now)&"' Where id =1"
      Conn.Execute "Update ZZ654_Link Set In0 =In0+In5,In5=0"   
  elseif times=1 then '隔天时
      Conn.Execute "Update DH654_setup Set TJ_now ='"&now()&"',TJ_day ='"&day(now)&"',TJ_hour ='"&hour(now)&"' Where id =1"
      Conn.Execute "Update ZZ654_Link Set HitIn=HitIn+In1,In1 = In0,In0 = In5,In5=0"
     'Conn.Execute "delete from TJ654_COUNT" 清除数据
   end if
end function	  
%>
