⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 counter.asp

📁 网页酷吧全站系统在此之前提供了一个新闻系统V1.0,反应十分热烈,并有不少网友提供了不少意见例如在线编辑器等问题,并强烈要求本部提供全部程序,顺应广大网友的强烈要求,并希望本人的QQ能够闲下来(因为实
💻 ASP
字号:
<!--#Include FILE="conn.asp"-->
<% 
'    About Script And CopyRight
'###################################
'* 本程序由“资源搜罗站”制作和提供
'* 您可以任意修改以供美化之用,但请
'* 保留这里的信息。
'###################################
'* Name   : ASP Cool Counter v1.0
'* Date   : 2000.10.23
'* Author : Harpoon
'* Email  : Harpoon@21cn.com
'* URL1   : http://harpoon.on.net.cn
'* URL2   : http://www.wzdown.com
'* OICQ   : 388861
'###################################
'* 如果您觉的本程序对你有帮助或有用
'* 请为本站做个链接,这也是对本站的
'* 最好支持,同时有发现错误的,还请
'* 你来信告诉我,在这先谢谢你了。
'###################################
'       The End CopyRight
'###################################

'===================================================================
DayDate = NewYear & NewMonth & NewDay                      '20001818
MonDate = NewYear & NewMonth                               '200018
YeaDate = NewYear                                          '2000
'===================================================================
Set MyCount=Server.CreateObject("ADODB.recordset")
'===================================================================
If Not (Session("ASPCounter") And CountType) Then
'if true then
'如果session 和 countype ,然后修改数据库=
'修改月份表==================================================================
        Dayn=int(Day(Now()))
       StrSQL="Select * FROM MonthCount Where ID = " & MonDate
        MyCount.Open StrSQL,Conn,1,2
        If MyCount.Eof Or MyCount.Bof then
                MyCount.addnew
                MyCount("ID") = MonDate
                MyCount(Dayn) = 1
        Else
                MyCount(Dayn) = MyCount(Dayn)+1
        End If
        MyCount.Update
        MyCountDay = MyCount(Dayn)
        MyCount.Close
'修改总数表===================================================================
        MyCount.Open "Select * FROM Count",Conn,1,2
        If MyCount.Eof Or MyCount.Bof then
                MyCount.addnew
                MyCount("AllCount")   = 1
                MyCount("ToDayCount") = 1
                MyCount("DayMax")     = 1
                MyCount("StartDate")  = Date()
        Else
                If MyCount("DayMax") < MyCountDay Then
                        MyCount("DayMax") = MyCountDay
                End If
                MyCount("AllCount")   = MyCount("AllCount")+1
                MyCount("ToDayCount") = MyCountDay
        End If
        MyCount("LogDate") = Now()
        MyCount.Update
        MyCount.Close
'修改日子表===================================================================
        Hourn=int(Hour(Now()))+1
        StrSQL="Select * FROM DayCount Where ID = " & DayDate
        MyCount.Open StrSQL,Conn,1,2
        If MyCount.Eof Or MyCount.Bof then
                MyCount.addnew
                MyCount("ID")  = DayDate
                MyCount(Hourn) = 1
                ToDaysCount    = False
        Else
                MyCount(Hourn) = MyCount(Hourn)+1
                ToDaysCount    = True
        End If
        MyCount.Update
        MyCount.close
'修改年表===================================================================
        Monn=int(Month(Now()))
        StrSQL="Select * FROM YearCount where ID = " & YeaDate
        MyCount.open StrSQL,conn,1,2
        If MyCount.Eof or MyCount.Bof then
                MyCount.addnew
                MyCount("ID") = YeaDate
                MyCount(Monn) = 1
        Else
                MyCount(Monn) = MyCount(Monn)+1
        End If
        MyCount.Update
        MyCount.Close
'==浏览器和系统=================================================================
        aAgt=Request.ServerVariables("HTTP_USER_AGENT")
        
'===================================================================
        If Instr(aAgt,"Mozilla") Then
                   If InStr(aAgt,"MSIE") Then
                         If InStr(aAgt,"4.90") Then
                             aAgt = Replace(aAgt,"98","Me")
                         End If
                         Agt = Split(aAgt,";")
                         BC  = trim(Agt(1))
                         OS  = trim(Agt(2))
                   Else
                         If InStr(aAgt,"Opera") Then
                               BC = "Opera" & Mid(aAgt,InStr(aAgt,")")+1)
                               OS = Mid(aAgt,InStr(aAgt,";")+2)
                               OS = Mid(OS,InStr(OS,";")+2)
                               OS = Mid(OS,1,InStr(OS,")"))
                         Else
                               If instr(aAgt,"[en]") or instr(aAgt,"Gold") Then
                                     BC = Mid(aAgt,InStr(aAgt,"/")+1)
                                     BC = "Netscape" & " " & Mid(bc,1,InStr(bc," "))
                                     OS = Mid(aAgt,InStr(aAgt,"(")+1)
                                     OS = Mid(OS,1,InStr(OS,";")-1)
                                     OS = Replace(OS,"Win","Windows ")
                               Else
                                     BC = "Unknown"
                                     OS = "Unknown"
                               End If
                         End If
                  End If
        Else
                 BC = "Unknown"
                 OS = "Unknown"
        End If
        BC = Replace(BC,"MSIE","Internet Explorer")
        OS = Replace(OS,")","")
        OS = Replace(OS,"NT 5.0","2000")
        OS = Replace(OS,"4.10","98")
        OS = Replace(OS,"4.90","Me")
'========================================================= 
        Call addinfo("bc",BC,ToDaysCount)
        Call addinfo("os",OS,ToDaysCount)
'========================================================= 
        IPaddress = Request.servervariables("REMOTE_ADDR")
'==保留30个纪录======================================================= 
        MyCount.open "Select * FROM lastly",conn,1,2
        
        do while  MyCount.Recordcount>30 
                MyCount.MoveFirst
                MyCount.Delete
        loop

        MyCount.addnew
        MyCount("bc")   = BC
        MyCount("OS")   = OS
        MyCount("Date") = Now()
        MyCount("IP")   = IPaddress
        MyCount.Update
        MyCount.Close
'========================================================= 
End If
Session("ASPCounter") = True

Function addinfo(Name,Info,NewDays)
        MyCount.Open "Select * FROM " & Name,Conn,1,2
        If Not (MyCount.Eof OR MyCount.Bof) then
                  Do until MyCount.Eof
                  If NewDays = True Then
                          If MyCount(Name) = Info Then
                                 MyCount("count")  = MyCount("count")+1
                                 MyCount("todays") = MyCount("todays")+1
                                 Found = True
                          End If
                  Else
                          If MyCount(Name) = Info Then
                                 MyCount("count")  = MyCount("count")+1
                                 MyCount("todays") = 1
                                 Found = True
                          Else
                                 MyCount("todays") = 0
                          End If
                  End If
                  MyCount.UpDate
                  MyCount.MoveNext
                  Loop
        End If
        If Not Found = True Then
                  MyCount.addnew
                  MyCount(Name)     = Info
                  MyCount("count")  = 1
                  MyCount("todays") = 1
                  MyCount.UpDate
        End IF              
        MyCount.Close
End Function
'=========================================================
MyCount.open "Select * FROM Count",conn,1,2
MyCount("PageCount") = MyCount("PageCount")+1
MyCount.Update

If CountView Then
        If Not CountMode Then
            Counter = MyCount("PageCount")
        Else
            Counter = MyCount("AllCount")
        End If
'=========================================================
        CountLength=Len(Counter)
        Style = Trim(Request("Style"))
'=========================================================
        If CountLength < CountSize Then
            CountToAdd = CountSize - CountLength
            for i = 1 to CountToAdd
                  if Style <> "" then
                       PicView = PicView & "<IMG SRC=" & ImageLink & "/" & Style & "/0.gif border=0>"
                  else
                       PicView = PicView & "0"
                  end if 
            Next
        end if

        for i = 1 to CountLength
             if Style <> "" then
                  PicView = PicView & "<IMG SRC=" & ImageLink & "/" & Style & "/" & Mid(Counter,i,1) & ".gif border=0>"
             else
                  PicView = PicView & "" & Mid(counter,i,1) & ""
             end if
        Next
        Response.write "document.write('<NOBR>" & PicView & "</NOBR>');"
'========================================================= 
End If
MyCount.Close
Set MyCount=nothing  
conn.close  
Set conn=nothing
'========================================================= 
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -