📄 cf.asp
字号:
<%
'乘风多用户计数器
'制作:乘 风
'QQ:178575
'E-Mail:yliangcf@163.com
'开发网站:http://www.qqcf.com
'详细简介:http://www.qqcf.com/?action=list&list=cfcount
'上面有程序在线演示,安装演示,使用疑难解答,最新版本下载等内容
'因为这些内容可能时常更新,就没有放在程序里,请自己上网站上查看
'有完整版本的演示
%>
<!--#include file="CF_MyFunction.asp"-->
<%
Action=Request.QueryString("Action")
Assort=CInt(Request.QueryString("Assort"))
Tmp=HttpPath(2)
If Action="" Then Action="countget"
If Action="countget" And Assort=0 Then%>
function WriteCookie (cookieName, cookieValue, expiry)
{
var expDate = new Date();
if(expiry)
{
expDate.setTime (expDate.getTime() + expiry);
document.cookie = cookieName + "=" + escape (cookieValue) + "; path=/ expires=" + expDate.toGMTString();
}
else
{
document.cookie = cookieName + "=" + escape (cookieValue);
}
}
function ReadCookie(name){
var cookieValue = "";
var search = name + "=";
if(document.cookie.length > 0) {
offset = document.cookie.indexOf(search);
if (offset != -1) {
offset += search.length;
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
cookieValue = unescape(document.cookie.substring(offset, end))
}
}
return cookieValue;
}
var cookieEnabled=(navigator.cookieEnabled)? true : false
if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled){
document.cookie = "testcookie"
cookieEnabled=(document.cookie=="testcookie")? true : false
document.cookie = ""
}
var firstshow;
var visittotal;
if(cookieEnabled==true)
{
var CFCountShowCookie=ReadCookie("CFCountShowCookie");
var CFCountVisitTotalCookie=ReadCookie("CFCountVisitTotalCookie");
var CFCountGGCookie=ReadCookie("CFCountGGCookie");
if(CFCountShowCookie=="")
{
a=new Date();
h=a.getHours();
m=a.getMinutes();
s=a.getSeconds();
sparetime=1000*60*60*24*1-(h*3600+m*60+s)*1000-1;
WriteCookie('CFCountShowCookie',"1",sparetime);
firstshow=1;
}
else
{
firstshow=0;
}
if(CFCountVisitTotalCookie=="")
{
sparetime=1000*60*60*24*3650;
WriteCookie('CFCountVisitTotalCookie',"1",sparetime);
visittotal=1;
}
else
{
if(firstshow==1)
{
visittotal=parseInt(CFCountVisitTotalCookie,10)+1;
sparetime=1000*60*60*24*3650;
WriteCookie('CFCountVisitTotalCookie',visittotal,sparetime);
}
else
{
visittotal=parseInt(CFCountVisitTotalCookie,10);
}
}
if(CFCountGGCookie=="")
{
sparetime=1000*60*60*24*3650;
WriteCookie('CFCountGGCookie',"1",sparetime);
gg=1;
}
else
{
gg=0;
}
}
else
{
firstshow=0;
visittotal=1;
gg=0;
}
var ly=escape(document.referrer);
var currweb=location.href;
ly=escape(ly);
currweb=escape(currweb);
document.write('<script src=<%=Tmp%>CF.asp?Action=countget_2&UserName=<%=Request.QueryString("UserName")%>&FirstShow='+firstshow+'&VisitTotal='+visittotal+'&GG='+gg+'&Ly='+ly+'&CurrWeb='+currweb+'></script>');
<%End If
If Action="countget_2" Or Assort=1 Then%>
<!--#include file="Conn.asp"-->
<!--#include file="CF_Md5.asp"-->
<%
UserName=ChkStr(Request.QueryString("UserName"),1)
If Assort=0 Then
Ly=ChkStr(Request.QueryString("Ly"),1)
Else
Ly=ChkStr(Request.ServerVariables("Http_Referer"),1)
End If
CurrWeb=ChkStr(Request.QueryString("CurrWeb"),1)
FirstShow=CInt(ChkStr(Request.QueryString("FirstShow"),2))
VisitTotal=CInt(ChkStr(Request.QueryString("VisitTotal"),2))
GG=CInt(ChkStr(Request.QueryString("GG"),2))
If Ly="" Then Ly="-"
If CurrWeb="" Then CurrWeb="-"
Ly=Left(UrlDecode(Ly),1000)
CurrWeb=Left(UrlDecode(CurrWeb),255)
Ip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If Ip= "" Then Ip= Request.ServerVariables("REMOTE_ADDR")
AgentStr=Lcase(Request.ServerVariables("HTTP_USER_AGENT"))
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())>1"
Conn.ExeCute Sql
Sql="Delete From CFCount_Web_Day Where DateDiff('d',AddDate,Now())>1"
Conn.ExeCute Sql
Sql="Delete From CFCount_Ly_Day Where DateDiff('d',AddDate,Now())>1"
Conn.ExeCute Sql
Sql="Delete From CFCount_Search_Day Where DateDiff('d',AddDate,Now())>6"
Conn.ExeCute Sql
Sql="Delete From CFCount_SearchKeywrod_Day Where DateDiff('d',LastTime,Now())>1"
Conn.ExeCute Sql
Sql="Delete From CFCount_Count_Day Where DateDiff('m',AddDate,Now())>1"
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 = 0 Then
If FirstShow = 1 Then
CFCount = 0
Else
CFCount = -1
End If
Else
If IsEmpty(Application("CFCountAllIp_" & UserName)) Then Application("CFCountAllIp_" & UserName) = ""
If InStr(Application("CFCountAllIp_" & UserName), IP) = 0 Then
CFCount = 0
Application.Lock()
Application("CFCountAllIp_" & UserName) = Application("CFCountAllIp_" & UserName) & IP & "|"
Application.UnLock()
Else
CFCount = -1
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 CFCount=0 Then
If Instr(Application("CFCountLy_"&UserName),Ip)=0 Then
Application("CFCountLy_"&UserName)=Application("CFCountLy_"&UserName)&Ip&"\"&VisitTotal&"\"&Now()&"\"&Ly&"\"&Now()&"\"&CurrWeb&"\1"&"|"
End If
Else
If Instr(Application("CFCountLy_"&UserName),Ip)>0 Then
Application("CFCountLy_"&UserName)=GetAppChange(UserName,IP,VisitTotal,Currweb)
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("State")=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 CFCount=0 Then
If Instr(Application("CFCountOnline_"&UserName),Ip)=0 Then
Application("CFCountOnline_"&UserName)=Application("CFCountOnline_"&UserName)&Ip&"\"&VisitTotal&"\"&Now()&"\"&Ly&"\"&Now()&"\"&CurrWeb&"\1"&"|"
End If
Else
If Instr(Application("CFCountOnline_"&UserName),Ip)>0 Then
Application("CFCountOnline_"&UserName)=GetAppChange_2(UserName,IP,VisitTotal,Currweb,RsUser("OnlineTime"))
End If
End If
End If
End If
Sql="Select Count(*) From CFCount_Back Where UserName='"&UserName&"'"
Set Rs=Conn.Execute(Sql)
IF Rs(0)=0 Then
Sql="Insert Into CFCount_Back (UserName,BackNum_1) values('"&UserName&"',1)"
Conn.ExeCute Sql
Else
If VisitTotal=1 And CFcount=0 Then
Sql="Update CFCount_Back Set BackNum_1=BackNum_1+1 Where UserName='"&UserName&"'"
Elseif VisitTotal>1 And VisitTotal<11 And CFCount=0 Then
Sql="Update CFCount_Back Set BackNum_"&VisitTotal&"=BackNum_"&VisitTotal&"+1,BackNum_"&VisitTotal-1&"=BackNum_"&VisitTotal-1&"-1 Where UserName='"&UserName&"'"
ElseIf VisitTotal=11 And CFcount=0 Then
Sql="Update CFCount_Back Set BackNum_Higher=BackNum_Higher+1,BackNum_10=BackNum_10-1 Where UserName='"&UserName&"'"
End if
Conn.ExeCute Sql
End if
SearchExist = 0
KeywordExist = 0
KeyWord = "-"
If RsSet("AllSearch") <> "" Then
I = 0
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
J = 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
I = 1000
J = 0
For J = 0 To UBound(KeyWordFlagArray)
If InStr(Ly, "?" & KeyWordFlagArray(J) & "=") > 0 Or InStr(Ly, "&" & KeyWordFlagArray(J) & "=") > 0 Then
SearchExist = -1
KeywordExist = -1
KeyWord = GetSearchKeyword(Ly, KeyWordFlagArray(J))
J = 1000
End If
Next
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -