%@LANGUAGE="VBSCRIPT" CODEPAGE="950"%> <% if(Request.ServerVariables("REMOTE_ADDR") <> "") then Command2__USER_IP = Request.ServerVariables("REMOTE_ADDR") %> <% Dim account Dim account_numRows Set account = Server.CreateObject("ADODB.Recordset") account.ActiveConnection = MM_counter_STRING account.Source = "SELECT * FROM webcount" account.CursorType = 0 account.CursorLocation = 2 account.LockType = 1 account.Open() account_numRows = 0 %> <% Dim pageview Dim pageview_numRows Set pageview = Server.CreateObject("ADODB.Recordset") pageview.ActiveConnection = MM_counter_STRING pageview.Source = "SELECT * FROM pageview" pageview.CursorType = 0 pageview.CursorLocation = 2 pageview.LockType = 1 pageview.Open() pageview_numRows = 0 %> <% set Command1 = Server.CreateObject("ADODB.Command") Command1.ActiveConnection = MM_counter_STRING Command1.CommandText = "UPDATE pageview SET counts = counts+1 " Command1.CommandType = 1 Command1.CommandTimeout = 0 Command1.Prepared = true Command1.Execute() %> <% Dim showcount Dim showcount_numRows Set showcount = Server.CreateObject("ADODB.Recordset") showcount.ActiveConnection = MM_counter_STRING showcount.Source = "SELECT * FROM showDayCount" showcount.CursorType = 0 showcount.CursorLocation = 2 showcount.LockType = 1 showcount.Open() showcount_numRows = 0 %> <% if Session("countOK") <> 1 then set Command2 = Server.CreateObject("ADODB.Command") Command2.ActiveConnection = MM_counter_STRING Command2.CommandText = "INSERT INTO webcount (count_ip) VALUES ( '" + Replace(Command2__USER_IP, "'", "''") + "') " Command2.CommandType = 1 Command2.CommandTimeout = 0 Command2.Prepared = true Command2.Execute() Session("countOK") = 1 end if %> <% Dim Distance Dim Distance_numRows Set Distance = Server.CreateObject("ADODB.Recordset") Distance.ActiveConnection = MM_NPOMember_STRING Distance.Source = "SELECT * FROM Distance" Distance.CursorType = 0 Distance.CursorLocation = 2 Distance.LockType = 1 Distance.Open() Distance_numRows = 0 %> <% Dim opporunity Dim opporunity_numRows Set opporunity = Server.CreateObject("ADODB.Recordset") opporunity.ActiveConnection = MM_NPOMember_STRING opporunity.Source = "SELECT * FROM Categories" opporunity.CursorType = 0 opporunity.CursorLocation = 2 opporunity.LockType = 1 opporunity.Open() opporunity_numRows = 0 %> <% ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables Dim account_total Dim account_first Dim account_last ' set the record count account_total = account.RecordCount ' set the number of rows displayed on this page If (account_numRows < 0) Then account_numRows = account_total Elseif (account_numRows = 0) Then account_numRows = 1 End If ' set the first and last displayed record account_first = 1 account_last = account_first + account_numRows - 1 ' if we have the correct record count, check the other stats If (account_total <> -1) Then If (account_first > account_total) Then account_first = account_total End If If (account_last > account_total) Then account_last = account_total End If If (account_numRows > account_total) Then account_numRows = account_total End If End If %> <% ' *** Recordset Stats: if we don't know the record count, manually count them If (account_total = -1) Then ' count the total records by iterating through the recordset account_total=0 While (Not account.EOF) account_total = account_total + 1 account.MoveNext Wend ' reset the cursor to the beginning If (account.CursorType > 0) Then account.MoveFirst Else account.Requery End If ' set the number of rows displayed on this page If (account_numRows < 0 Or account_numRows > account_total) Then account_numRows = account_total End If ' set the first and last displayed record account_first = 1 account_last = account_first + account_numRows - 1 If (account_first > account_total) Then account_first = account_total End If If (account_last > account_total) Then account_last = account_total End If End If %> <% Dim RefreshTime, IdleTime, TotalUsers, OnlineUser(), Tmp(), Num, I, ID RefreshTime = 10 IdleTime = RefreshTime * 3 Application.Lock If Application(Session.SessionID & "LastAccessTime") = Empty Then If Application("TotalUsers") = Empty Then Application("TotalUsers") = 0 ReDim Tmp(Application("TotalUsers") + 1) Num = 0 If Application("TotalUsers") > 0 Then For I = LBOUND(Application("OnlineUser")) To UBOUND(Application("OnlineUser")) ID = Application("OnlineUser")(I) If ID <> Session.SessionID Then Tmp(Num) = ID Num = Num + 1 End If Next End If Tmp(Num) = Session.SessionID Application("TotalUsers") = Num + 1 ReDim Preserve Tmp(Application("TotalUsers")) Application("OnlineUser") = Tmp End If Application(Session.SessionID & "LastAccessTime") = Timer ReDim Tmp(Application("TotalUsers")) Num = 0 For I = 0 To Application("TotalUsers") - 1 ID = Application("OnlineUser")(I) If (Timer - Application(ID & "LastAccessTime")) < IdleTime Then Tmp(Num) = ID Num = Num + 1 Else Application(ID & "LastAccessTime") = Empty End If Next If Num <> Application("TotalUsers") Then ReDim Preserve Tmp(Num) Application("OnlineUser") = Tmp Application("TotalUsers") = Num End If Application.UnLock %>
架設及管理單位:願景青年行動網協會 / 會址: 100 台北市中正區師大路 186 巷 9 號 3 樓
Address: No. 9, 3F, Shihda Road, Lane 186, Jhongjheng District, TaipeiCity 100, Taiwan
Tel: +886-2-23654907 / FAX:+886-2-23690547/ Email:vya@vya.org.tw / Website : http://www.vya.org.tw
Copyrights@2002-2010 Vision YouthAction. All rights reserved