I think Huwr mean where the subroutine is located it is in inc_func_common.asp
and it looks like
Sub ActiveUserTracker()
'Ls3k- Declare and assign variables.
Dim strUserIP, strScriptName, strQueryString, strUserAgent, strCurrentTime, strTimedOut
strUserIP = Request.ServerVariables("REMOTE_ADDR")
strScriptName = Mid(Request.ServerVariables("SCRIPT_NAME"), InstrRev(Request.ServerVariables("SCRIPT_NAME"), "/")+1)
strQueryString = Request.ServerVariables("QUERY_STRING")
strUserAgent = Request.ServerVariables("HTTP_USER_AGENT")
strCurrentTime = DateToStr(strForumTimeAdjust)
'Ls3k- First Order of business, is this person new?
if MemberID="-1" then 'If this is a Guest, check by IP
strSql = "SELECT AU_LASTACTIVETIME FROM " & strTablePrefix & "ACTIVE_USERS WHERE AU_IP = '" & Chkstring(strUserIP, "SQLString") & "' AND MEMBER_ID = -1"
else 'If this is a Member, check by Member_ID
strSql = "SELECT AU_LASTACTIVETIME FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID = " & MemberID
end if
set rs = my_conn.execute (strSql)
if rs.EOF or rs.BOF then
strNewUser = 1
else
strNewUser = 0
strAUTimedOut = DateToStr(DateAdd("n",-strAUTimeout,strForumTimeAdjust))
if rs("AU_LASTACTIVETIME") < strAUTimedOut then 'Check to see if user has timed out since last active.
strSql = "DELETE FROM " & strTablePrefix & "ACTIVE_USERS WHERE (MEMBER_ID = " & MemberID & " AND MEMBER_ID <> -1) OR (AU_IP = '" & Chkstring(strUserIP, "SQLString") & "' AND MEMBER_ID = -1)"
my_conn.execute (strSql)
strNewUser = 1
end if
end if
rs.close
set rs = Nothing
'Ls3k- Second order of business, lets update those already-active users
if strNewUser = 0 then 'If already-active
strSql = "UPDATE " & strTablePrefix & "ACTIVE_USERS SET " & _
"AU_LASTACTIVETIME='" & Chkstring(strCurrentTime, "SQLString") & "'" & _
", AU_LASTPAGE='" & Chkstring(strScriptName, "SQLString") & "'" & _
", AU_QUERYSTRING='" & Chkstring(strQueryString, "SQLString") & "' "
if MemberID=-1 then 'If guest, update based on IP
strSql = strSql & "WHERE AU_IP = '" & Chkstring(strUserIP, "SQLString") & "' " & _
"AND MEMBER_ID = " & MemberID
else 'Update members based on MemberID
strSql = strSql & "WHERE MEMBER_ID = " & MemberID
end if
my_conn.execute (strSql)
else 'Is a new user, make new record
strSql = "INSERT INTO " & strTablePrefix & "ACTIVE_USERS (" & _
"MEMBER_ID, AU_IP, AU_LOGINTIME, AU_LASTACTIVETIME, " & _
"AU_LASTPAGE, AU_QUERYSTRING, AU_USER_AGENT) VALUES(" & _
MemberID & ", " & _
"'" & Chkstring(strUserIP, "SQLString") & "', " & _
"'" & Chkstring(strCurrentTime, "SQLString") & "', " & _
"'" & Chkstring(strCurrentTime, "SQLString") & "', " & _
"'" & Chkstring(strScriptName, "SQLString") & "', " & _
"'" & Chkstring(strQueryString, "SQLString") & "', " & _
"'" & Chkstring(strUserAgent, "SQLString") & "')"
my_conn.execute (strSql)
end if
end sub