<!--#Include File="Conn.asp"-->
<!--#Include File="Include/MyFunction.asp"-->
<%
Action=ChkStr(Request.QueryString("Action"),1)
Assort=CInt(Request.QueryString("Assort"))
UserName=ChkStr(Request.QueryString("UserName"),1)
C=ChkStr(Request.QueryString("C"),1)
AsyncID=ChkStr(Request.QueryString("AsyncID"),2)
If Action="" Then Action="countget"
If Assort=0 Then
If C<>"" Then
UserName=C
Assort=1
End If
End If
If (RsSet("CodeHeadType") = 1) Then
Tmp = "//" & Mid(HttpPath(2), InStr(HttpPath(2), "//") + 2)
ElseIf (RsSet("CodeHeadType") = 2) Then
Tmp = "https://" & Mid(HttpPath(2), InStr(HttpPath(2), "//") + 2)
ElseIf (RsSet("CodeHeadType") = 3) Then
Tmp = RsSet("CodeHeadSelf")
End If
If Action="countget" And Assort=0 Then
MyStr=("function getCookie(name){ 	" & Chr(13) & Chr(10))
MyStr=MyStr&("var arg = name + ""=""; 	" & Chr(13) & Chr(10))
MyStr=MyStr&("var alen = arg.length; 	" & Chr(13) & Chr(10))
MyStr=MyStr&("var clen = document.cookie.length; 	" & Chr(13) & Chr(10))
MyStr=MyStr&("var i = 0; 	" & Chr(13) & Chr(10))
MyStr=MyStr&("while (i < clen){ 	" & Chr(13) & Chr(10))
MyStr=MyStr&("var j = i + alen; 	" & Chr(13) & Chr(10))
MyStr=MyStr&("if(document.cookie.substring(i, j) == arg) 	" & Chr(13) & Chr(10))
MyStr=MyStr&("return getCookieVal(j); 	" & Chr(13) & Chr(10))
MyStr=MyStr&("i = document.cookie.indexOf("" "", i) + 1; 	" & Chr(13) & Chr(10))
MyStr=MyStr&("if(i == 0) break; 	" & Chr(13) & Chr(10))
MyStr=MyStr&("} 	" & Chr(13) & Chr(10))
MyStr=MyStr&("return null; 	" & Chr(13) & Chr(10))
MyStr=MyStr&("} 	" & Chr(13) & Chr(10))
MyStr=MyStr&("function setCookie(name,value){ 	" & Chr(13) & Chr(10))
MyStr=MyStr&("var expDate = new Date(); 	" & Chr(13) & Chr(10))
MyStr=MyStr&("var argv = setCookie.arguments; 	" & Chr(13) & Chr(10))
MyStr=MyStr&("var argc = setCookie.arguments.length; 	" & Chr(13) & Chr(10))
MyStr=MyStr&("var expires = (argc > 2) ? argv[2] : null; 	" & Chr(13) & Chr(10))
MyStr=MyStr&("var path = (argc > 3) ? argv[3] : null; 	" & Chr(13) & Chr(10))
MyStr=MyStr&("var domain = (argc > 4) ? argv[4] : null; 	" & Chr(13) & Chr(10))
MyStr=MyStr&("var secure = (argc > 5) ? argv[5] : false; 	" & Chr(13) & Chr(10))
MyStr=MyStr&("if(expires != null){expDate.setTime (expDate.getTime() + expires);} 	" & Chr(13) & Chr(10))
MyStr=MyStr&("document.cookie = name + ""="" + escape (value) + 	" & Chr(13) & Chr(10))
MyStr=MyStr&("((expires == null) ? """" : (""; expires="" + expDate.toUTCString())) + 	" & Chr(13) & Chr(10))
MyStr=MyStr&("((path == null) ? """" : (""; path="" + path)) + 	" & Chr(13) & Chr(10))
MyStr=MyStr&("((domain == null) ? """" : (""; domain="" + domain)) + 	" & Chr(13) & Chr(10))
MyStr=MyStr&("((secure == true) ? ""; secure"" : """"); 	" & Chr(13) & Chr(10))
MyStr=MyStr&("} 	" & Chr(13) & Chr(10))
MyStr=MyStr&("function getCookieVal(offset){ 	" & Chr(13) & Chr(10))
MyStr=MyStr&("var endstr = document.cookie.indexOf ("";"", offset); 	" & Chr(13) & Chr(10))
MyStr=MyStr&("if (endstr == -1)  	" & Chr(13) & Chr(10))
MyStr=MyStr&("endstr = document.cookie.length; 	" & Chr(13) & Chr(10))
MyStr=MyStr&("return unescape(document.cookie.substring(offset, endstr)); 	" & Chr(13) & Chr(10))
MyStr=MyStr&("} 	" & Chr(13) & Chr(10))
MyStr=MyStr&("var firstshow;          " & Chr(13) & Chr(10))           
MyStr=MyStr&("var visittotal;          " & Chr(13) & Chr(10))                   
MyStr=MyStr&("if(navigator.cookieEnabled)            " & Chr(13) & Chr(10))         
MyStr=MyStr&("{                " & Chr(13) & Chr(10))     
MyStr=MyStr&(" var CFCountShowCookie=getCookie(""CFCountShowCookie"");            " & Chr(13) & Chr(10))                     
MyStr=MyStr&(" var CFCountVisitTotalCookie=getCookie(""CFCountVisitTotalCookie"");              " & Chr(13) & Chr(10))       
MyStr=MyStr&(" if(isNaN(CFCountVisitTotalCookie)||CFCountVisitTotalCookie==null){CFCountVisitTotalCookie=0;}       " & Chr(13) & Chr(10))              
MyStr=MyStr&(" if(CFCountShowCookie!="""&UserName&""")       " & Chr(13) & Chr(10))              
MyStr=MyStr&(" {                     " & Chr(13) & Chr(10))
MyStr=MyStr&("  a=new Date();           " & Chr(13) & Chr(10))          
MyStr=MyStr&("  h=a.getHours();           " & Chr(13) & Chr(10))          
MyStr=MyStr&("  m=a.getMinutes();          " & Chr(13) & Chr(10))           
MyStr=MyStr&("  s=a.getSeconds();            " & Chr(13) & Chr(10))         
MyStr=MyStr&("  sparetime=1000*60*60*24*1-(h*3600+m*60+s)*1000-1;       " & Chr(13) & Chr(10))              
MyStr=MyStr&("  setCookie('CFCountShowCookie','"&UserName&"',sparetime,'/');                  " & Chr(13) & Chr(10))   
MyStr=MyStr&("  firstshow=1;             " & Chr(13) & Chr(10))        
MyStr=MyStr&(" }                 " & Chr(13) & Chr(10))    
MyStr=MyStr&(" else               " & Chr(13) & Chr(10))      
MyStr=MyStr&(" {                  " & Chr(13) & Chr(10))       
MyStr=MyStr&("  firstshow=0;                " & Chr(13) & Chr(10))     
MyStr=MyStr&(" }                     " & Chr(13) & Chr(10))
MyStr=MyStr&(" if(CFCountVisitTotalCookie==0)         " & Chr(13) & Chr(10))            
MyStr=MyStr&(" {                   " & Chr(13) & Chr(10))    
MyStr=MyStr&("  sparetime=1000*60*60*24*3650;           " & Chr(13) & Chr(10))          
MyStr=MyStr&("  setCookie('CFCountVisitTotalCookie',1,sparetime,'/');        " & Chr(13) & Chr(10))           
MyStr=MyStr&("  visittotal=1;                 " & Chr(13) & Chr(10))   
MyStr=MyStr&(" }               " & Chr(13) & Chr(10))      
MyStr=MyStr&(" else             " & Chr(13) & Chr(10))     
MyStr=MyStr&(" {                   " & Chr(13) & Chr(10)) 
MyStr=MyStr&("  if(firstshow==1)     " & Chr(13) & Chr(10))
MyStr=MyStr&("  {                    " & Chr(13) & Chr(10))
MyStr=MyStr&("     visittotal=parseInt(CFCountVisitTotalCookie,10)+1;     " & Chr(13) & Chr(10))
MyStr=MyStr&("     sparetime=1000*60*60*24*3650;                     " & Chr(13) & Chr(10))
MyStr=MyStr&("     setCookie('CFCountVisitTotalCookie',visittotal,sparetime,'/');     " & Chr(13) & Chr(10))     
MyStr=MyStr&("   }                   " & Chr(13) & Chr(10))
MyStr=MyStr&("   else                   " & Chr(13) & Chr(10))
MyStr=MyStr&("   {                   " & Chr(13) & Chr(10))
MyStr=MyStr&("     visittotal=parseInt(CFCountVisitTotalCookie,10);     " & Chr(13) & Chr(10))
MyStr=MyStr&("   }                   " & Chr(13) & Chr(10))
MyStr=MyStr&(" }                     " & Chr(13) & Chr(10))
MyStr=MyStr&("}                " & Chr(13) & Chr(10))     
MyStr=MyStr&("else          " & Chr(13) & Chr(10))           
MyStr=MyStr&("{                    " & Chr(13) & Chr(10)) 
MyStr=MyStr&(" firstshow=0;          " & Chr(13) & Chr(10))           
MyStr=MyStr&(" visittotal=1;         " & Chr(13) & Chr(10))           
MyStr=MyStr&("}             " & Chr(13) & Chr(10))    
MyStr=MyStr&("var ly=escape(document.referrer);          		" & Chr(13) & Chr(10))   
MyStr=MyStr&("var currweb=escape(location.href);				" & Chr(13) & Chr(10)) 
MyStr=MyStr&("var screenwidth=screen.width;					" &chr(13) & chr(10))   
MyStr=MyStr&("var screenheight=screen.height;					" &chr(13) & chr(10))   
MyStr=MyStr&("var screencolordepth=screen.colorDepth; 		" &chr(13) & chr(10))   
MyStr=MyStr&("var webtitle=escape(document.title).replace(/%/g,'Z'); 			" &chr(13) & chr(10))
MyStr=MyStr&("(function() {									" &chr(13) & chr(10))
MyStr=MyStr&("var obf=document.createElement('script');		" &chr(13) & chr(10))
MyStr=MyStr&("obf.id='" & AsyncID & "B" & "';					" &chr(13) & chr(10))
MyStr=MyStr&("obf.src='" & Tmp&"CF.asp?Action=countget_2&UserName="&UserName&"&AsyncID="&AsyncID&"&Assort=0&FirstShow='+firstshow+'&VisitTotal='+visittotal+'&Ly='+ly+'&currweb='+currweb+'&screenwidth='+screenwidth+'&screenheight='+screenheight+'&screencolordepth='+screencolordepth+'&webtitle='+webtitle+'&ranstr='+Math.random();		" &chr(13) & chr(10))
MyStr=MyStr&("var obb=document.getElementById('" & AsyncID & "');		" &chr(13) & chr(10))
MyStr=MyStr&("obb.parentNode.insertBefore(obf,obb);					" &chr(13) & chr(10))
MyStr=MyStr&("})();")
Response.write MyStr
Response.End
End if
%>
<%If Action="countget_2" Or Assort=1 Then%>
<!--#include file="Include/Md5.asp"-->
<%
If Assort=0 Then
Ly=ChkStr(Request.QueryString("Ly"),1)
CurrWeb=ChkStr(Request.QueryString("CurrWeb"),1)'img调用时CurrWeb为空
Else
Ly=ChkStr(Request.ServerVariables("Http_Referer"),1)
CurrWeb=Ly
End If
FirstShow=CInt(ChkStr(Request.QueryString("FirstShow"),2))
VisitTotal=CInt(ChkStr(Request.QueryString("VisitTotal"),2))
GG=CInt(ChkStr(Request.QueryString("GG"),2))
Ly=Left(Server.HtmlEncode(Ly),1000)
CurrWeb=Left(Server.HtmlEncode(CurrWeb),1000)
If Request.ServerVariables("HTTP_X_FORWARDED_FOR") = "" Then
Ip = ChkStr(Request.ServerVariables("REMOTE_ADDR"),1)
Else
Ip = ChkStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),1)
If InStr(Ip, ",") > 0 Then Ip = ChkStr(Left(Ip, InStr(Ip, ",") - 1),1)
End If
AgentStr=ChkStr(Request.ServerVariables("HTTP_USER_AGENT"),1)
If InStr(LCase(AgentStr), "alexa") = 0 Then Alexa = 0 Else Alexa = 1
screenwidth=CLng(ChkStr(Request.QueryString("screenwidth"),2))
screenheight=CLng(ChkStr(Request.QueryString("screenheight"),2))
screencolordepth=CLng(ChkStr(Request.QueryString("screencolordepth"),2))
WebTitle = ChkStr(Replace(Request.QueryString("WebTitle"), "Z", "%"), 1)
OsType=getostype()
BrowserType=getbrowsertype()
If IsEmpty(Application("CFCountStartTime")) Then Application("CFCountStartTime")=Date()
If Application("CFCountStartTime")<>Date() Then
Application("CFCountStartTime")=Date()
Sql="Delete From CFCount_Count_Hour Where DateDiff('d',AddDate,Now())>=" & RsSet("HourCountKeepDay")
Conn.ExeCute Sql
Sql="Delete From CFCount_Web_Day Where DateDiff('d',AddDate,Now())>=" & RsSet("WebKeepDay")
Conn.ExeCute Sql
Sql="Delete From CFCount_Ly_Day Where DateDiff('d',AddDate,Now())>=" & RsSet("LyKeepDay")
Conn.ExeCute Sql
Sql="Delete From CFCount_Search_Day Where DateDiff('d',AddDate,Now())>=" & RsSet("SearchKeepDay")
Conn.ExeCute Sql
Sql="Delete From CFCount_SearchKeywrod_Day Where DateDiff('d',LastTime,Now())>=" & RsSet("KeywordKeepDay")
Conn.ExeCute Sql
Sql="Delete From CFCount_Count_Day Where DateDiff('d',AddDate,Now())>=" & RsSet("CountKeepDay")
Conn.ExeCute Sql
End If
If IsEmpty(Application("CFCountStartTime_"&UserName)) Then Application("CFCountStartTime_"&UserName)=Date()
If Application("CFCountStartTime_"&UserName)<>Date() Then
Application("CFCountStartTime_"&UserName)=Date()
Application.Lock
Application("CFCountLy_"&UserName) = Empty
Application("CFCountOnline_"&UserName) = Empty
Application.UnLock
End If
If Assort = 1 Then
If IsEmpty(Application("CFCountAllIp_" & UserName)) Then Application("CFCountAllIp_" & UserName) = ""
If InStr(Application("CFCountAllIp_" & UserName), IP) = 0 Then
FirstShow=1
Application.Lock()
Application("CFCountAllIp_" & UserName) = IP & "|" & Application("CFCountAllIp_" & UserName)
Application.UnLock()
Else
FirstShow=0
End If
TempNum = Len(Application("CFCountAllIp_" & UserName))
If TempNum > 15000 Then
Application.Lock()
Application("CFCountAllIp_" & UserName) = Mid(Application("CFCountAllIp_" & UserName), 7500)
Application.UnLock()
End If
End If
If FirstShow=1 Then
If Instr(Application("CFCountLy_"&UserName),Ip)=0 Then
Application("CFCountLy_"&UserName)=Application("CFCountLy_"&UserName)&Ip&"\"&VisitTotal&"\"&Now()&"\"&Ly&"\"&Now()&"\"&CurrWeb&"\"&AgentStr&"\1\"&screenwidth&"\"&screenheight&"\"&screencolordepth&"\"&ostype&"\"&browsertype&"\"&WebTitle&"|"
End If
Else
If Instr(Application("CFCountLy_"&UserName),Ip)>0 Then
Application("CFCountLy_"&UserName)=GetAppChange(UserName,IP,VisitTotal,Currweb,AgentStr,WebTitle)
End If
End If
Myarray=Split(Application("CFCountLy_"&UserName),"|")
If Ubound(Myarray)>100 Then
Application.Lock
Application("CFCountLy_"&UserName) = Mid(Application("CFCountLy_"&UserName),Instr(Application("CFCountLy_"&UserName),"|")+1,Len(Application("CFCountLy_"&UserName)))
Application.UnLock
End if
Set RsUser=Server.CreateObject("Adodb.RecordSet")
Sql="Select * From CFCount_User Where UserName='"&UserName&"'"
RsUser.Open sql,conn,1,1
If RsUser.Eof Then
ShowText="<a href="&Tmp&" target=_blank>"&GetUnicode("计数器系统中没有此用户，请先注册！")&"</a>"
Response.Write("document.write("& chr(34) & ShowText & chr(34) &");")
Response.End
End if
If RsUser("UserState")=0 Then
ShowText="<a href="&Tmp&" target=_blank><font color=#ff0000>"&GetUnicode("你的计数器账号已被禁用！")&"</font></a>"
Response.Write("document.write("& chr(34) & ShowText & chr(34) &");")
Response.End
End if
If RsSet("OnlineKeep")=-1 Then
If RsUser("online")=-1 Then
If FirstShow=1 Then
If Instr(Application("CFCountOnline_"&UserName),Ip)=0 Then	 
Application("CFCountOnline_"&UserName)=Application("CFCountOnline_"&UserName)&Ip&"\"&VisitTotal&"\"&Now()&"\"&Ly&"\"&Now()&"\"&CurrWeb&"\"&AgentStr&"\1\"&screenwidth&"\"&screenheight&"\"&screencolordepth&"\"&ostype&"\"&browsertype&"\"&WebTitle&"|"
End If
Else
If Instr(Application("CFCountOnline_"&UserName),Ip)>0 Then
Application("CFCountOnline_"&UserName)=GetAppChange_2(UserName,IP,VisitTotal,Currweb,AgentStr,WebTitle,RsUser("OnlineTime"))
End If
End If
End If
End If
Set Rs=Server.CreateObject("Adodb.RecordSet")
Sql="Select * From CFCount_Back Where UserName='"&UserName&"'"
Rs.Open Sql,Conn,3,2
If Rs.Eof Then
Rs.AddNew
Rs("UserName")=UserName
Rs("BackNum_1")=1
Rs.Update
Else
If VisitTotal=1 And FirstShow=1 Then
Rs("BackNum_1")=Rs("BackNum_1")+1
Rs.Update
Elseif VisitTotal>1 And VisitTotal<11 And FirstShow=1 Then
Rs("BackNum_"&VisitTotal)=Rs("BackNum_"&VisitTotal)+1
Rs("BackNum_"&VisitTotal-1)=Rs("BackNum_"&VisitTotal-1)-1
Rs.Update
ElseIf VisitTotal=11 And FirstShow=1 Then
Rs("BackNum_Higher")=Rs("BackNum_Higher")+1
Rs("BackNum_10")=Rs("BackNum_10")-1
Rs.Update
End If
End If
Rs.Close
SearchExist = 0
KeywordExist = 0
KeyWord = ""
If RsSet("AllSearch") <> "" Then
MyArray = Split(RsSet("AllSearch"), "|")
For I = 0 To UBound(MyArray)
SiteFlag = Left(MyArray(I), InStr(MyArray(I), ",") - 1)
KeyWordFlag = Mid(MyArray(I), InStr(MyArray(I), ",") + 1, 1000)
SiteFlagArray = Split(SiteFlag, ";")
KeyWordFlagArray = Split(KeyWordFlag, ";")
K = 0
For J = 0 To UBound(SiteFlagArray)
If Len(BreakUrl(Ly, 1)) > Len(SiteFlagArray(J)) Then
If Mid(BreakUrl(Ly, 1), (Len(BreakUrl(Ly, 1)) - Len(SiteFlagArray(J)) + 1)) = SiteFlagArray(J) Then K = 1
ElseIf Len(BreakUrl(Ly, 1)) = Len(SiteFlagArray(J)) Then
If BreakUrl(Ly, 1) = SiteFlagArray(J) Then K = 1
End If
Next
If K = 1 Then
SearchExist = -1
I = 1000
For J = 0 To UBound(KeyWordFlagArray)
If (InStr(Ly, "?" & KeyWordFlagArray(J) & "=")>0 And InStr(Ly, "?" & KeyWordFlagArray(J) & "=&")=0) Or (InStr(Ly, "&" & KeyWordFlagArray(J) & "=") > 0 And InStr(Ly, "&" & KeyWordFlagArray(J) & "=&") = 0 And StrReverse(Mid(StrReverse(Ly), 1,Len(KeyWordFlagArray(J))+1))<>KeyWordFlagArray(J)&"=") Then
KeywordExist = -1
KeyWord = ChkStr(GetSearchKeyword(Ly, KeyWordFlagArray(J)),1)
J = 1000
End If
Next
End If
Next
End If
If SearchExist=-1 Then
Sql="Select * From CFCount_Search_Day Where UserName='"&UserName&"' And SiteFlag = '"& SiteFlag &"' And AddDate=#"&Date()&"#"
Rs.Open Sql,Conn,3,2
If Rs.Eof Then
Rs.AddNew
Rs("UserName")=UserName
Rs("SiteFlag")=SiteFlag
Rs.Update   
Else
If FirstShow=1 Then Rs("IpCounter")=Rs("IpCounter")+1
Rs("MyCounter")=Rs("MyCounter")+1
Rs.Update
End If
Rs.Close
End If
If KeywordExist=-1 Then
IndexCode=Md5(UserName&SiteFlag&KeyWord&Date(),1)
Sql="Select * From CFCount_SearchKeywrod_Day Where IndexCode='"&IndexCode&"'"
Rs.Open Sql,Conn,3,2
If Rs.Eof Then
Rs.AddNew
Rs("UserName")=UserName
Rs("SiteFlag")=SiteFlag
Rs("KeyWord")=KeyWord
Rs("LastLy")=Ly
Rs("IndexCode")=IndexCode
Rs.Update
Else
If FirstShow=1 Then Rs("IpCounter")=Rs("IpCounter")+1
Rs("MyCounter")=Rs("MyCounter")+1
Rs("LastTime")=Now()
Rs("LastLy")=Ly
Rs.Update
End If
Rs.Close
End if
If FirstShow=1 Then
Sql="Select Count(ID) From CFCount_Client_Day Where UserName='"&UserName&"' And AddDate=#"&Date()&"#"
Set Rs1=Conn.Execute(Sql)
If Rs1(0)=0 Then
Sql="Insert Into CFCount_Client_Day (UserName) Values ('"&UserName&"')"
Else
Sql = "Update CFCount_Client_Day Set "
If Alexa=1 Then Sql = Sql & "alexacounter=alexacounter+1,"
If OsType = "Windows 10" Then Sql = Sql & "Os1 = Os1+1,"
If OsType = "Windows 7" Then Sql = Sql & "Os2 = Os2+1,"
If OsType = "Windows XP" Then Sql = Sql & "Os3 = Os3+1,"
If OsType = "安卓" Then Sql = Sql & "Os4 = Os4+1,"
If OsType = "iPhone" Then Sql = Sql & "Os5 = Os5+1,"
If OsType <> "Windows 10" And OsType <> "Windows 7" And OsType <> "Windows XP" And OsType <> "安卓" And OsType <> "iPhone" Then Sql = Sql & "OsOther = OsOther+1,"
If BrowserType = "IE 8.0" Then Sql = Sql & "Browser1 = Browser1+1,"
If BrowserType = "IE 9.0" Then Sql = Sql & "Browser2 = Browser2+1,"
If BrowserType = "IE 10.0" Then Sql = Sql & "Browser3 = Browser3+1,"
If BrowserType = "搜狗" Then Sql = Sql & "Browser4 = Browser4+1,"
If BrowserType = "360" Then Sql = Sql & "Browser5 = Browser5+1,"
If BrowserType = "Chrome" Then Sql = Sql & "Browser6 = Browser6+1,"
If BrowserType = "火狐" Then Sql = Sql & "Browser7 = Browser7+1,"
If BrowserType <> "IE 8.0" And BrowserType <> "IE 9.0" And BrowserType <> "IE 10.0" And BrowserType <> "搜狗" And BrowserType <> "360" And BrowserType <> "Chrome" And BrowserType <> "火狐" Then Sql = Sql & "BrowserOther = BrowserOther+1,"
If ScreenWidth = 1024 Then Sql = Sql & "ScreenWidth1 = ScreenWidth1+1,"
If ScreenWidth = 1280 Then Sql = Sql & "ScreenWidth2 = ScreenWidth2+1,"
If ScreenWidth = 1440 Then Sql = Sql & "ScreenWidth3 = ScreenWidth3+1,"
If ScreenWidth = 1152 Then Sql = Sql & "ScreenWidth4 = ScreenWidth4+1,"
If ScreenWidth = 1680 Then Sql = Sql & "ScreenWidth5 = ScreenWidth5+1,"
If ScreenWidth = 800 Then Sql = Sql & "ScreenWidth6 = ScreenWidth6+1,"
If ScreenWidth = 1600 Then Sql = Sql & "ScreenWidth7 = ScreenWidth7+1,"
If ScreenWidth = 1920 Then Sql = Sql & "ScreenWidth8 = ScreenWidth8+1,"
If ScreenWidth = 1360 Then Sql = Sql & "ScreenWidth9 = ScreenWidth9+1,"
If ScreenWidth <> 1024 And ScreenWidth <> 1280 And ScreenWidth <> 1440 And ScreenWidth <> 1152 And ScreenWidth <> 1680 And ScreenWidth <> 800 And ScreenWidth <> 1600 And ScreenWidth <> 1920 And ScreenWidth <> 1360 Then Sql = Sql & "ScreenWidthOther = ScreenWidthOther+1,"
If ScreenHeight = 768 Then Sql = Sql & "ScreenHeight1 = ScreenHeight1+1,"
If ScreenHeight = 800 Then Sql = Sql & "ScreenHeight2 = ScreenHeight2+1,"
If ScreenHeight = 900 Then Sql = Sql & "ScreenHeight3 = ScreenHeight3+1,"
If ScreenHeight = 1024 Then Sql = Sql & "ScreenHeight4 = ScreenHeight4+1,"
If ScreenHeight = 864 Then Sql = Sql & "ScreenHeight5 = ScreenHeight5+1,"
If ScreenHeight = 1050 Then Sql = Sql & "ScreenHeight6 = ScreenHeight6+1,"
If ScreenHeight = 960 Then Sql = Sql & "ScreenHeight7 = ScreenHeight7+1,"
If ScreenHeight = 720 Then Sql = Sql & "ScreenHeight8 = ScreenHeight8+1,"
If ScreenHeight = 600 Then Sql = Sql & "ScreenHeight9 = ScreenHeight9+1,"
If ScreenHeight <> 768 And ScreenHeight <> 800 And ScreenHeight <> 900 And ScreenHeight <> 1024 And ScreenHeight <> 864 And ScreenHeight <> 1050 And ScreenHeight <> 960 And ScreenHeight <> 720 And ScreenHeight <> 600 Then Sql = Sql & "ScreenHeightOther = ScreenHeightOther+1,"
If ScreenColorDepth = 32 Then Sql = Sql & "ScreenColorDepth1 = ScreenColorDepth1+1"
If ScreenColorDepth = 16 Then Sql = Sql & "ScreenColorDepth2 = ScreenColorDepth2+1"
If ScreenColorDepth = 24 Then Sql = Sql & "ScreenColorDepth3 = ScreenColorDepth3+1"
If ScreenColorDepth <> 32 And ScreenColorDepth <> 16 And ScreenColorDepth <> 24 Then Sql = Sql & "ScreenColorDepthOther = ScreenColorDepthOther+1"
Sql = Sql & " Where UserName = '" & UserName & "' And DateDiff('d',AddDate,Now())=0"
End If
Conn.Execute(Sql)
Rs1.Close
ENd If
If RsSet("WebKeep")=-1 And CurrWeb<>"" Then
IndexCode=Md5(UserName&CurrWeb&Date(),1)
Sql="Select * From CFCount_Web_Day Where IndexCode='"&IndexCode&"'"
Rs.Open Sql,Conn,3,2
If Rs.Eof Then
Rs.AddNew
Rs("UserName")=UserName
Rs("WebUrl")=CurrWeb
Rs("IndexCode")=IndexCode
Rs.Update
Else
Rs("MyCounter")=Rs("MyCounter")+1
Rs("LastTime")=Now()
Rs.Update
End If
Rs.Close
End if
Sql="Select * From CFCount_Count_Day Where UserName='"&UserName&"' And AddDate=#"&Date()&"#"
Rs.Open Sql,Conn,3,2
If Rs.Eof Then
Rs.AddNew
Rs("UserName")=UserName
Rs.Update
Else
If FirstShow=1 Then Rs("IpCounter")=Rs("IpCounter")+1
Rs("MyCounter")=Rs("MyCounter")+1
Rs.Update
End If
Rs.Close
Sql="Select * From CFCount_Count_Hour Where UserName='"&UserName&"' And AddDate=#"&Date()&"# And AddHour="&Hour(Now)
Rs.Open Sql,Conn,3,2
If Rs.Eof Then
Rs.AddNew
Rs("UserName")=UserName
Rs("AddHour")=Hour(Now)
Rs.Update
Else
If FirstShow=1 Then Rs("IpCounter")=Rs("IpCounter")+1
Rs("MyCounter")=Rs("MyCounter")+1
Rs.Update
End If
Rs.Close
If RsSet("LyKeep")=-1 Then
If Ly<>"" Then LyHead=BreakUrl(Ly,1) Else LyHead=""
Sql="Select * From CFCount_Ly_Day Where UserName='"&UserName&"' And LyHead='"&LyHead&"' And DateDiff('d',AddDate,Date())=0"
Rs.Open Sql,Conn,3,2
If Rs.Eof Then
Rs.AddNew
Rs("UserName")=UserName
Rs("Ip")=Ip
Rs("LyHead")=LyHead
Rs("Ly")=Ly
Rs.Update
Else
If FirstShow=1 Then Rs("IpCounter")=Rs("IpCounter")+1
Rs("MyCounter")=Rs("MyCounter")+1
Rs("Ly")=Ly
Rs("LastTime")=Now()
Rs.Update
End If
Rs.Close
If FirstShow=1 Then
Sql="Update CFCount_Admin Set Store_Ly=Store_Ly+1,Store_TotalLy=Store_TotalLy+1"
Conn.ExeCute Sql
End If
End If
If FirstShow=1 Then
Sql="Update CFCount_User Set ShowTotal=ShowTotal+1,RealShowTotal=RealShowTotal+1,RealIpTotal=RealIpTotal+1,LastTime=Now() Where UserName='"&UserName&"'"
Else
Sql="Update CFCount_User Set ShowTotal=ShowTotal+1,RealShowTotal=RealShowTotal+1,LastTime=Now() Where UserName='"&UserName&"'"
End if
Conn.ExeCute Sql
If RsSet("Store_Ly")>6000 Then
Sql="Select Min(id) As MyID From CFCount_Ly_Day Where ID In (Select Top 2000 Id From CFCount_Ly Order By Id Desc)"
Set Rs1=Conn.Execute(Sql)
Sql="Delete From CFCount_Ly_Day Where ID<"&Rs1("MyID")
Conn.ExeCute Sql
Rs1.Close
Sql="Update CFCount_Admin Set Store_Ly=0"
Conn.ExeCute Sql
End if
If RsUser("Tjopen")=-1 Or RsUser("OnlineShow")=-1 Then
If IsEmpty(Application("CFCountOnline_"&UserName)) Then
OnlineTotal=0
Else
Myarray=Split(Application("CFCountOnline_"&UserName),"|")
OnlineTotal=Ubound(Myarray)
End If
End if
If  RsUser("Tjopen")=-1 Or RsUser("TodayShow")=-1 Or RsUser("TodayIpShow")=-1 Then
Sql= "Select * From CFCount_Count_Day Where UserName='"&UserName&"' And AddDate=#"&Date()&"#"
Set Rs1=Conn.ExeCute(Sql)
TodayTotal=Rs1("MyCounter")
TodayIpTotal=Rs1("IpCounter")
Rs1.Close
End If
If RsUser("TjOpen")=-1 Then
GGTitle=GetUnicode("网站名称：")&GetUnicode(Rsuser("PageName"))&"&#13;"
GGTitle=GGTitle&GetUnicode("今天浏览：")&TodayTotal&"&#13;"
GGTitle=GGTitle&GetUnicode("今天IP：")&TodayIpTotal&"&#13;"
GGTitle=GGTitle&GetUnicode("在线人数：")&OnlineTotal&"&#13;&#13;"
GGTitle=GGTitle&GetUnicode("统计服务由[")&GetUnicode(RsSet("SysTitle"))&GetUnicode("]免费提供")
GGLink=Tmp&"CF.asp?Action=countgo&UserName="&UserName
ImgText = "网站名称："&Rsuser("PageName")&"|"
ImgText = ImgText&"今天浏览："&TodayTotal&"|"
ImgText = ImgText&"今天IP："&TodayIpTotal&"|"
ImgText = ImgText&"在线人数："&OnlineTotal&"|"
ImgText = ImgText&"你的IP："&IP&"|"
Else
GGTitle=GGTitle&GetUnicode("统计服务由[")&GetUnicode(RsSet("SysTitle"))&GetUnicode("]提供")
GGLink=Tmp&"CF.asp?Action=countgo&UserName="&UserName
End if
If RsUser("ShowType")=1 Then
Counter=RsUser("ShowTotal")
ElseIf RsUser("ShowType")=2 Then
Counter=RsUser("RealShowTotal")
ElseIf RsUser("ShowType")=3 Then
Counter=RsUser("RealIpTotal")
End if
CountLen=Len(Counter)
ZeroNum=RsUser("PicNum")-CountLen
For I=1 To ZeroNum
LinkUrl=Tmp&"CounterPic/"&RsUser("Style")&"/0"
CounterHtm=CounterHtm&"<img src="""&LinkUrl&".gif"" border=""0"">"
Next
If RsUser("CounterShow")=-1 Then  
For I=1 To CountLen
Pic=Mid(Counter,I,1)
LinkUrl=Tmp&"CounterPic/"&RsUser("Style")&"/"&pic
CounterHtm=CounterHtm&"<img src="""&LinkUrl&".gif"" border=""0"">"
Next
CounterHtm="<a href="""&GGLink&""" target=""_blank"" title="""&GGTitle&""">"&CounterHtm&"</a>"
Else
If RsUser("CounterHiddenPic")=0 Then
GbookHtm = "window.onresize = CFResizeDiv;   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "window.onerror = function(){}    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "var px = document.doctype?""px"":0;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "var scrollwidth = navigator.userAgent.indexOf(""Firefox"")>0?16:0;   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "var iframeheight = navigator.userAgent.indexOf(""MSIE"")>0?260-2:260-2;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "String.prototype.Trim  = function(){return this.replace(/^\s+|\s+$/g,"""");}    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "function CF_collapse(obj){   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     ct = document.getElementById('tab_c_iframe');   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     if(ct.style.display==""none""){    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         ct.style.display="""";     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         obj.src=obj.src.replace(""max.gif"",""min.gif"");   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     } else {    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         ct.style.display=""none"";     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         obj.src=obj.src.replace(""min.gif"",""max.gif"");   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     }   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     CFResizeDiv();     "&chr(13)&chr(10)
GbookHtm = GbookHtm & " }   "&chr(13)&chr(10)
GbookHtm = GbookHtm & " function CFMsg()    "&chr(13)&chr(10)
GbookHtm = GbookHtm & " {   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     try{    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         divTop = parseInt(document.getElementById(""eMeng"").style.top,10);    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         divLeft = parseInt(document.getElementById(""eMeng"").style.left,10);   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         divHeight = parseInt(document.getElementById(""eMeng"").offsetHeight+6,10);   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         divWidth = parseInt(document.getElementById(""eMeng"").offsetWidth+18,10);    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         var scrollPosTop,scrollPosLeft,docWidth,docHeight;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         if (typeof window.pageYOffset != 'undefined') {     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             scrollPosTop = window.pageYOffset;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             scrollPosLeft = window.pageXOffset;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             docWidth = window.innerWidth;   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             docHeight = window.innerHeight;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         } else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             scrollPosTop = document.documentElement.scrollTop;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             scrollPosLeft = document.documentElement.scrollLeft;    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             docWidth = document.documentElement.clientWidth;    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             docHeight = document.documentElement.clientHeight;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         } else if (typeof document.body != 'undefined') {   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             scrollPosTop = document.body.scrollTop;    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             scrollPosLeft = document.body.scrollLeft;   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             docWidth = document.body.clientWidth;   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             docHeight = document.body.clientHeight;    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         }   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         document.getElementById(""eMeng"").style.top = parseInt(scrollPosTop,10) + docHeight + 10 + px;// divHeight    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         document.getElementById(""eMeng"").style.left = parseInt(scrollPosLeft,10) + docWidth - divWidth - scrollwidth + px;    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         document.getElementById(""eMeng"").style.visibility=""visible"";    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         objTimer = window.setInterval(""CF_move_div()"",10);    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     }catch(e){}    "&chr(13)&chr(10)
GbookHtm = GbookHtm & " }   "&chr(13)&chr(10)
GbookHtm = GbookHtm & " function CFResizeDiv()     "&chr(13)&chr(10)
GbookHtm = GbookHtm & " {   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     i+=1;   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     try{    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         divHeight = parseInt(document.getElementById(""eMeng"").offsetHeight+6,10);   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         divWidth = parseInt(document.getElementById(""eMeng"").offsetWidth+18,10);    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         var scrollPosTop,scrollPosLeft,docWidth,docHeight;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         if (typeof window.pageYOffset != 'undefined') {     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             scrollPosTop = window.pageYOffset;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             scrollPosLeft = window.pageXOffset;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             docWidth = window.innerWidth;   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             docHeight = window.innerHeight;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         } else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             scrollPosTop = document.documentElement.scrollTop;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             scrollPosLeft = document.documentElement.scrollLeft;    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             docWidth = document.documentElement.clientWidth;    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             docHeight = document.documentElement.clientHeight;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         } else if (typeof document.body != 'undefined') {   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             scrollPosTop = document.body.scrollTop;    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             scrollPosLeft = document.body.scrollLeft;   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             docWidth = document.body.clientWidth;   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             docHeight = document.body.clientHeight;    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         }   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         document.getElementById(""eMeng"").style.top = docHeight - divHeight + parseInt(scrollPosTop,10) + px;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         document.getElementById(""eMeng"").style.left = docWidth - divWidth + parseInt(scrollPosLeft,10) - scrollwidth + px;    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     }catch(e){}    "&chr(13)&chr(10)
GbookHtm = GbookHtm & " }   "&chr(13)&chr(10)
GbookHtm = GbookHtm & " function CF_move_div()     "&chr(13)&chr(10)
GbookHtm = GbookHtm & " {   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     var scrollPosTop,scrollPosLeft,docWidth,docHeight;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     if (typeof window.pageYOffset != 'undefined') {     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         scrollPosTop = window.pageYOffset;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         scrollPosLeft = window.pageXOffset;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         docWidth = window.innerWidth;   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         docHeight = window.innerHeight;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     } else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         scrollPosTop = document.documentElement.scrollTop;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         scrollPosLeft = document.documentElement.scrollLeft;    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         docWidth = document.documentElement.clientWidth;    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         docHeight = document.documentElement.clientHeight;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     } else if (typeof document.body != 'undefined') {   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         scrollPosTop = document.body.scrollTop;    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         scrollPosLeft = document.body.scrollLeft;   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         docWidth = document.body.clientWidth;   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         docHeight = document.body.clientHeight;    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     }   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     try{    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         if(parseInt(document.getElementById(""eMeng"").style.top,10) <= (docHeight - divHeight + parseInt(scrollPosTop,10)))    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         {   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             window.clearInterval(objTimer);objTimer = window.setInterval(""CFResizeDiv()"",1);     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         }   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         divTop = parseInt(document.getElementById(""eMeng"").style.top,10);    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         document.getElementById(""eMeng"").style.top = divTop - 1 + px;    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     }catch(e){}    "&chr(13)&chr(10)
GbookHtm = GbookHtm & " }   "&chr(13)&chr(10)
GbookHtm = GbookHtm & " function CFMessbox(shape,color){    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     var styles='position:absolute;top:0px;left:0px;z-index:99999;visibility:hidden;';   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     var copic='<img src="""&Tmp&"images/gbook_min.gif"" align=""absmiddle"" class=""ioc'+color+'"" onClick=""CF_collapse(this)"">';    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     if(shape>1) window.onload = CFMsg;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     else {styles='';copic=''}   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     var s;     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     if(shape==2) {     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         s='<div id=eMeng style=""width:208px;Z-INDEX:99999;LEFT:0px;POSITION:absolute;TOP:0px;VISIBILITY:hidden;"">'    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'<table style=""width:100%;border:1px solid #AED1F7; border-collapse:collapse;"">'    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'        <tr>'    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'          <td align=left style=""background:url("&Tmp&"images/gbook_bg.gif) repeat-x;list-style-type:none; padding: 0; border: 0;font-size:12px;""><img src="""&Tmp&"images/gbook_zxly.gif""><img src="""&Tmp&"images/space.gif"" width=116 height=1><img src="""&Tmp&"images/gbook_min.gif"" align=""absmiddle"" class=""ioc'+color+'"" onClick=""CF_collapse(this)"">'     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'        </td>'    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'        </tr>'    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'        <tr>'    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'        <td style=""background-color:#ffffff"">'     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'         <iframe src=""" & Tmp & "cf.asp?action=gbookcodeget&username=" & UserName & "&ly=" & Server.URLEncode(Ly) & "&currweb=" & Server.URLEncode(CurrWeb) & """ width=""194"" height=""' + iframeheight + '"" frameborder=""0"" marginheight=0 marginwidth=0 scrolling=no id=""tab_c_iframe""></iframe>'   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'        </td>'    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'        </tr>'    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'      </table>'   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'</div>';     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     } else if(shape==3) {   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "         s='<div id=eMeng style=""width:210px;background:#FFFFFF;'+styles+'"">'     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'  <table width=""100%""  border=""0"" cellpadding=""0"" cellspacing=""0"" style=""border:1px solid #808080;"" id=""tab_'+color+'"">'     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'    <tr>'    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'      <td colspan=""3"" align=right style=""font-size:12px; line-height:19px;height:19px;padding-right:6px;color:#FFFFFF;"" onDblClick=""CF_collapse(this.firstChild.nextSibling)"">留言板'+copic    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'</tr>'    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'    </tr>'    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             + '</table>'    "&chr(13)&chr(10)
GbookHtm = GbookHtm & "             +'</div>';     "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     }   "&chr(13)&chr(10)
GbookHtm = GbookHtm & "     var obDiv = document.createElement('cfcount')" &chr(13)&chr(10)
GbookHtm = GbookHtm & "     obDiv.innerHTML = s;" &chr(13)&chr(10)
GbookHtm = GbookHtm & "     var obS = document.getElementById('"&asyncid&"B"&"');" &chr(13)&chr(10)
GbookHtm = GbookHtm & "     obS.parentNode.insertBefore(obDiv, obS);" &chr(13)&chr(10)
GbookHtm = GbookHtm & " }   "&chr(13)&chr(10)
GbookHtm = GbookHtm & " CFMessbox(2,1);    "&chr(13)&chr(10)
ElseIf RsUser("CounterHiddenPic")=1 Then
CounterHtm="<a href="""&GGLink&""" target=""_blank"" title="""&GGTitle&"""><span style=""font-size:12px;text-decoration:none;font-weight:normal;color:#000000;line-height:20px;"">"&GetUnicode(RsSet("TjTextName"))&"</span></a>"
ElseIf RsUser("CounterHiddenPic")=2 Then
CounterHtm="<a href="""&GGLink&""" target=""_blank"" title="""&GGTitle&"""><img src="""&Tmp&"images/counter_2.gif"" border=""0""></a>"
ElseIf RsUser("CounterHiddenPic")=3 Then
CounterHtm="<a href="""&GGLink&""" target=""_blank"" title="""&GGTitle&"""><img src="""&Tmp&"images/counter_3.gif"" border=""0""></a>"
End If
End If
If Action="countget_2" Then
If RsUser("OnlineShow")=-1 Then
OnlineHtm="<span style=""font-size:12px;text-decoration:none;font-weight:normal;color:#000000;line-height:20px;"">"&GetUnicode("同时在线")&"[<font color=""#FF0000"">"&OnlineTotal&"</font>]"&GetUnicode("人")&"</span>"
End If
If RsUser("TodayShow")=-1 Then
TodayHtm="<span style=""font-size:12px;text-decoration:none;font-weight:normal;color:#000000;line-height:20px;"">"&GetUnicode("今天浏览")&"[<font color=""#FF0000"">"&TodayTotal&"</font>]</span>"
End If
If RsUser("TodayIpShow")=-1 Then
TodayIpHtm="<span style=""font-size:12px;text-decoration:none;font-weight:normal;color:#000000;line-height:20px;"">"&GetUnicode("今天IP")&"[<font color=""#FF0000"">"&TodayIpTotal&"</font>]</span>"
End If
If RsUser("IpShow")=-1 Then
IPHtm="<span style=""font-size:12px;text-decoration:none;font-weight:normal;color:#000000;line-height:20px;"">"&GetUnicode("你的IP")&"[<font color=""#FF0000"">"&IP&"</font>]</span>"
End If
If RsUser("VisitShow")=-1 Then
VisitHtm="<span style=""font-size:12px;text-decoration:none;font-weight:normal;color:#000000;line-height:20px;"">"&GetUnicode("欢迎你第")&"[<font color=""#FF0000"">"&VisitTotal&"</font>]"&GetUnicode("次访问本站")&"</span>"
End If
If RsUser("CounterSite")=1 Or RsUser("CounterSite")=2 Then
If RsUser("OnlineShow")=-1 Then AllHtm=AllHtm&OnlineHtm&"<br>"
If RsUser("TodayShow")=-1 Then AllHtm=AllHtm&TodayHtm&"<br>"
If RsUser("TodayIpShow")=-1 Then AllHtm=AllHtm&TodayIpHtm&"<br>"
If RsUser("IpShow")=-1 Then AllHtm=AllHtm&IpHtm&"<br>"
If RsUser("VisitShow")=-1 Then AllHtm=AllHtm&VisitHtm
ElseIf RsUser("CounterSite")=3 Or RsUser("CounterSite")=4 Then
If RsUser("OnlineShow")=-1 Then AllHtm=AllHtm&"&nbsp;"&OnlineHtm
If RsUser("TodayShow")=-1 Then AllHtm=AllHtm&"&nbsp;"&TodayHtm
If RsUser("TodayIpShow")=-1 Then AllHtm=AllHtm&"&nbsp;"&TodayIpHtm
If RsUser("IpShow")=-1 Then AllHtm=AllHtm&"&nbsp;"&IpHtm
If RsUser("VisitShow")=-1 Then AllHtm=AllHtm&"&nbsp;"&VisitHtm
End if
If RsUser("CounterSite")=1 Then
TableCode="<table border=""0"" cellpadding=""2"" cellspacing=""1""><tr><td><div align=""center"">"&CounterHtm&"</div></td></tr><tr><td><div align=""center""><a href="""&GGLink&""" target=""_blank"" title="""&GGTitle&""" style=""font-size:12px;text-decoration:none;font-weight:normal;color:#000000;line-height:20px;"">"&AllHtm&"</a></div></td></tr></table>"
ElseIf RsUser("CounterSite")=2 Then
TableCode="<table border=""0"" cellpadding=""2"" cellspacing=""1""><tr><td><div align=""center""><a href="""&GGLink&""" target=""_blank"" title="""&GGTitle&""">"&AllHtm&"</a></div></td></tr><tr><td><div align=""center"">"&CounterHtm&"</div></td></tr></table>"
ElseIf RsUser("CounterSite")=3 Then
TableCode=CounterHtm&"<a href="""&GGLink&""" target=""_blank"" title="""&GGTitle&""">"&AllHtm&"</a>"
ElseIf RsUser("CounterSite")=4 Then
TableCode="<a href="""&GGLink&""" target=""_blank"" title="""&GGTitle&""">"&AllHtm&"</a>"&CounterHtm
End If
If RsUser("OnlineShow")=0 And RsUser("TodayShow")=0 And RsUser("TodayIpShow")=0 And RsUser("IpShow")=0 And RsUser("VisitShow")=0 Then
TableCode=CounterHtm
End If
If RsUser("CounterHiddenPic")=0 Then
Response.Write(GbookHtm)
Else
Response.Write("var obDiv = document.createElement('cfcount');"	 			&chr(13)&chr(10))
Response.Write("obDiv.innerHTML = '"&TableCode&"';"	 						&chr(13)&chr(10))
Response.Write("var obS = document.getElementById('"&asyncid&"B"&"');"	 	&chr(13)&chr(10))
Response.Write("obS.parentNode.insertBefore(obDiv, obS);"	 				&chr(13)&chr(10))
End If
End If
If Assort=1 Then
If RsUser("ImgShowType")=1 Then
ImgCounter=RsUser("ShowTotal")
ElseIf RsUser("ImgShowType")=2 Then
ImgCounter=RsUser("RealShowTotal")
ElseIf RsUser("ImgShowType")=3 Then
ImgCounter=RsUser("RealIpTotal")
End if
ImgCountLen=Len(ImgCounter)
ImgZeroNum=RsUser("PicNum")-ImgCountLen
For I=1 To ImgZeroNum
PicText=PicText&"0"
Next
PicText=PicText&Cstr(ImgCounter)
Else
RsUser.Close
End If
End If
if Assort=1 Then
ImgText="总访问："&ImgCounter&"|"
If RsUser("OnlineShow")=-1 Then ImgText=ImgText&"在线人数："&OnlineTotal&"|"
If RsUser("TodayShow")=-1 Then ImgText=ImgText&"今天浏览："&TodayTotal&"|"
If RsUser("TodayIpShow")=-1 Then ImgText=ImgText&"今天IP："&TodayIpTotal&"|"
If RsUser("IpShow")=-1 Then ImgText=ImgText&"你的IP："&Ip&"|"
If RsUser("ImgCounterShow")=0 Then ImgText="我的统计"
Set Jpeg = Server.CreateObject("Persits.Jpeg")
FileName="Upload/"&RsUser("ImgFileName")
If InStr(FileName,".jpg")>0 Then
Jpeg.Open Server.MapPath(FileName)
Jpeg.Canvas.Font.ShadowColor = &Hffffff
Jpeg.Canvas.Font.ShadowXoffset = 1
Jpeg.Canvas.Font.ShadowYoffset = 1
Jpeg.Canvas.Font.Color = &H000000
Jpeg.Canvas.Font.Family = "宋体"
Jpeg.Canvas.Font.Bold = False
Jpeg.Canvas.Font.Quality = 4
Jpeg.Canvas.Font.Size = 12
Jpeg.Canvas.Pen.Color = &Hff0000'
MyArray=Split(ImgText,"|")
For I=0 To Ubound(MyArray)
MyHeight=(I+1)*15
Jpeg.Canvas.Print 10, MyHeight, MyArray(I)
Next
Jpeg.SendBinary
ElseIf InStr(FileName,".gif")>0 Then
Set Gif = Jpeg.Gif  
Gif.Open Server.MapPath(FileName)  
Gif.PenColor = 255
Gif.FontSize = 13  
Gif.FontFamily = "宋体" 
MyArray=Split(ImgText,"|")
For I=0 To Ubound(MyArray)
MyHeight=(I+1)*15
Gif.PrintText 10,MyHeight, MyArray(I)
Next
Gif.SendBinary  
Set Gif=Nothing  
End If
Set Jpeg = Nothing
RsUser.Close
End If
If Action="countgo" Then
ReUrl = "View.asp?UserName=" & UserName
If Request.Cookies("CFCountCraCookie")<>"" Then
Response.Redirect(ReUrl)
Response.End
End If
MyStr=("<!DOCTYPE>   " & Chr(13) & Chr(10))
MyStr=MyStr&("<html>   " & Chr(13) & Chr(10))
MyStr=MyStr&("<head>   " & Chr(13) & Chr(10))
MyStr=MyStr&("<title>网站统计</title>   " & Chr(13) & Chr(10))
MyStr=MyStr&("<meta http-equiv='Content-Type' content='text/html; charset=gbk'>   " & Chr(13) & Chr(10))
MyStr=MyStr&("<style type='text/css'>   " & Chr(13) & Chr(10))
MyStr=MyStr&("TABLE {   " & Chr(13) & Chr(10))
MyStr=MyStr&(" FONT-SIZE: 14px; COLOR: #000000; LINE-HEIGHT: 120%; FONT-FAMILY: 'Arial'               " & Chr(13) & Chr(10))
MyStr=MyStr&("}   " & Chr(13) & Chr(10))
MyStr=MyStr&("</style>   " & Chr(13) & Chr(10))
MyStr=MyStr&("<script>   " & Chr(13) & Chr(10))
MyStr=MyStr&("function getCookie(name){ 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("var arg = name + ""=""; 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("var alen = arg.length; 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("var clen = document.cookie.length; 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("var i = 0; 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("while (i < clen){ 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("var j = i + alen; 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("if(document.cookie.substring(i, j) == arg) 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("return getCookieVal(j); 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("i = document.cookie.indexOf("" "", i) + 1; 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("if(i == 0) break; 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("} 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("return null; 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("} 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("function setCookie(name,value){ 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("var expDate = new Date(); 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("var argv = setCookie.arguments; 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("var argc = setCookie.arguments.length; 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("var expires = (argc > 2) ? argv[2] : null; 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("var path = (argc > 3) ? argv[3] : null; 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("var domain = (argc > 4) ? argv[4] : null; 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("var secure = (argc > 5) ? argv[5] : false; 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("if(expires != null){expDate.setTime (expDate.getTime() + expires);} 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("document.cookie = name + ""="" + escape (value) + 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("((expires == null) ? """" : (""; expires="" + expDate.toUTCString())) + 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("((path == null) ? """" : (""; path="" + path)) + 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("((domain == null) ? """" : (""; domain="" + domain)) + 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("((secure == true) ? ""; secure"" : """"); 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("} 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("function getCookieVal(offset){ 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("var endstr = document.cookie.indexOf ("";"", offset); 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("if (endstr == -1)  	   " & Chr(13) & Chr(10))
MyStr=MyStr&("endstr = document.cookie.length; 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("return unescape(document.cookie.substring(offset, endstr)); 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("} 	   " & Chr(13) & Chr(10))
MyStr=MyStr&("    " & Chr(13) & Chr(10))
MyStr=MyStr&(" var reurl='View.asp?UserName="&UserName&"';                      " & Chr(13) & Chr(10))
MyStr=MyStr&(" var CFCountCrbCookie=getCookie('CFCountCrbCookie');                      " & Chr(13) & Chr(10))
MyStr=MyStr&(" if(isNaN(CFCountCrbCookie)||CFCountCrbCookie==null){                 " & Chr(13) & Chr(10))
MyStr=MyStr&("  sparetime=1000*60*60*24*3650;                      " & Chr(13) & Chr(10))
MyStr=MyStr&("  setCookie('CFCountCrbCookie',1,sparetime,'/');                      " & Chr(13) & Chr(10))
MyStr=MyStr&("  crstate=0;                      " & Chr(13) & Chr(10))
MyStr=MyStr&(" }else{                      " & Chr(13) & Chr(10))
MyStr=MyStr&("  crstate=parseInt(CFCountCrbCookie);                      " & Chr(13) & Chr(10))
MyStr=MyStr&(" }                      " & Chr(13) & Chr(10))
MyStr=MyStr&(" if(crstate==1){                     " & Chr(13) & Chr(10))
MyStr=MyStr&("  location.replace(reurl);   " & Chr(13) & Chr(10))
MyStr=MyStr&(" }                    " & Chr(13) & Chr(10))
MyStr=MyStr&("function crstatesel(num) {      " & Chr(13) & Chr(10))
MyStr=MyStr&(" sparetime=1000*60*60*24*3650;                      " & Chr(13) & Chr(10))
MyStr=MyStr&(" setCookie('CFCountCrbCookie',num,sparetime,'/');                      " & Chr(13) & Chr(10))
MyStr=MyStr&(" location.replace(reurl);   " & Chr(13) & Chr(10))
MyStr=MyStr&("}      " & Chr(13) & Chr(10))
MyStr=MyStr&("function myshow(){   " & Chr(13) & Chr(10))
MyStr=MyStr&("location.replace(reurl);   " & Chr(13) & Chr(10))
MyStr=MyStr&("clearInterval(myst);   " & Chr(13) & Chr(10))
MyStr=MyStr&("}   " & Chr(13) & Chr(10))
MyStr=MyStr&("myst=setInterval('myshow()',1000*60);   " & Chr(13) & Chr(10))
MyStr=MyStr&("</script>   " & Chr(13) & Chr(10))
MyStr=MyStr&("</head>   " & Chr(13) & Chr(10))
MyStr=MyStr&("<body>   " & Chr(13) & Chr(10))
MyStr=MyStr&("<table border='0' style='margin:10px auto;margin-top:100px'>   " & Chr(13) & Chr(10))
MyStr=MyStr&("<tr>               " & Chr(13) & Chr(10))
MyStr=MyStr&("<td height='60' align='center'><a href='http://www.qqcf.com' target='_blank' style='font-size:14px;color:#ff0000;text-decoration:underline;font-weight:bold;'>Powered By CF</a></td>  </tr>               " & Chr(13) & Chr(10))
MyStr=MyStr&("<tr>               " & Chr(13) & Chr(10))
MyStr=MyStr&("<td>60秒钟后自动进入统计或点击下面链接直接进入统计系统</td>   " & Chr(13) & Chr(10))
MyStr=MyStr&("</tr>               " & Chr(13) & Chr(10))
MyStr=MyStr&("<tr>   " & Chr(13) & Chr(10))
MyStr=MyStr&("<td align='center'>               " & Chr(13) & Chr(10))
MyStr=MyStr&("<a href='#' onclick='crstatesel(0)'>点击直接进入统计</a><br><br>               " & Chr(13) & Chr(10))
MyStr=MyStr&("<input type='checkbox' name='checkbox' value='checkbox' onclick='crstatesel(1)'>下次不再显示此页   " & Chr(13) & Chr(10))
MyStr=MyStr&("</td>   " & Chr(13) & Chr(10))
MyStr=MyStr&("</tr>               " & Chr(13) & Chr(10))
MyStr=MyStr&("</table>              " & Chr(13) & Chr(10))
MyStr=MyStr&("</body>               " & Chr(13) & Chr(10))
MyStr=MyStr&("</html>               " & Chr(13) & Chr(10))
Response.write MyStr
End If
If Action="gbookcodeget" Then
MyStr = "<body style='margin:0; padding:0;'>"
MyStr = MyStr & "<ul style='background-color:#ffffff;list-style-type:none;margin: 0; padding: 0; border: 0;font-size:12px;'><form name='gbook_form' method='post' target='_blank' action='"&Tmp&"Gbook.asp?Action=gbookaddsave&UserName="&UserName&"&Ly="&Server.URLEncode(Request("Ly"))&"&CurrWeb="&Server.URLEncode(Request("currweb"))&"' onsubmit='return gbookcheck()'>"
MyStr = MyStr & "<li style='padding:2px 12px;list-style-type:none; padding: 0; border: 0;font-size:12px;text-align:center;'><textarea name='content' id='content' cols='22' rows='8' style='color:#B6B3B3;overflow:auto;border: 1px solid #C9DDF0;width:180px;height:120px' onmouseover=""if(document.getElementById('content').value=='请输入留言内容')document.getElementById('content').value='';"" onmouseout=""if(document.getElementById('content').value=='')document.getElementById('content').value='请输入留言内容';"">请输入留言内容</textarea></li>"
MyStr = MyStr & "<li style='padding:2px 12px;list-style-type:none; padding: 0; border: 0;font-size:12px;text-align:center;'><textarea name='contact' id='contact' cols='22' rows='6' style='color:#B6B3B3;overflow:auto;border: 1px solid #C9DDF0;width:180px;height:100px' onmouseover=""if(document.getElementById('contact').value=='请输入联系方式')document.getElementById('contact').value='';"" onmouseout=""if(document.getElementById('contact').value=='')document.getElementById('contact').value='请输入联系方式';"">请输入联系方式</textarea></li>"
MyStr = MyStr & "<li style='padding:2px;list-style-type:none; padding: 0; border: 0;font-size:12px;'><a href='"&Tmp&"CF.asp?Action=countgo&UserName="&UserName&"' target='_blank' style='display:block;padding:6px 2px 0px 12px;float:left;'>查看统计</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='image' src='"&Tmp&"images/gbook_send.gif'></li>"
MyStr = MyStr & "</form></ul>"
MyStr = MyStr & "<script>"&chr(13)&chr(10)
MyStr = MyStr & "function gbookcheck(){"&chr(13)&chr(10)
MyStr = MyStr & " if(document.gbook_form.content.value==""""||document.gbook_form.content.value==""请输入留言内容""){"&chr(13)&chr(10)
MyStr = MyStr & "  alert(""请输入留言内容!"");"&chr(13)&chr(10)
MyStr = MyStr & "  document.gbook_form.content.focus();"&chr(13)&chr(10)
MyStr = MyStr & "  return false;"&chr(13)&chr(10)
MyStr = MyStr & " }"&chr(13)&chr(10)
MyStr = MyStr & " if(document.gbook_form.contact.value==""""||document.gbook_form.contact.value==""请输入联系方式""){"&chr(13)&chr(10)
MyStr = MyStr & "  alert(""请输入联系方式!"");"&chr(13)&chr(10)
MyStr = MyStr & "  document.gbook_form.contact.focus();"&chr(13)&chr(10)
MyStr = MyStr & "  return false;"&chr(13)&chr(10)
MyStr = MyStr & " }"&chr(13)&chr(10)
MyStr = MyStr & "return true;"&chr(13)&chr(10)
MyStr = MyStr & "}"&chr(13)&chr(10)
MyStr = MyStr & "</script>"&chr(13)&chr(10)
Response.Write MyStr
End If
%>