Well, this one is turning into a doozy, and it's a little odd. So I turn to you for advice.
In FUNCTIONS_COMMON, I added the following to the REMOVE ACTIVE USERS section:
'Check the IP address and last active time less than 20 minutes
If CDate(saryActiveUsers(4, intArrayPass)) < DateAdd("n", -20, Now()) OR intActiveUsersDblArrayPos = intArrayPass Then
'Update database
strSQL = "UPDATE " & strDbTable & "Author " & strRowLock & " " & _
"SET " & strDbTable & "Author.TimeSpentOnline = " & DateDiff("s", saryActiveUsers(4, intArrayPass), Now()) + CInt(saryActiveUsers(10, intArrayPass)) & " " & _
"WHERE " & strDbTable & "Author.Author_ID=" & saryActiveUsers(1, intArrayPass) & ";"
'Write the updated no. of seconds to the database
adoCon.Execute(strSQL)
..... switch the selected item to the end of the array, then truncate the array by one element....
end if
(I had already set saryActiveUsers(10, intArrayPass) to be a new field from tblAuthor called intTimeSpentOnline. That's the doozy of a change, with a few instances of the saryActiveUsers array that needed to be tweaked, but we'll talk about that later after I get this working)
So after a little fussing around, I'm getting values stored in the database. But the numbers are all in the 1200+ range, indicating that these folks have been signed on for 20-30 minutes (1200/60 secs), when I barely even saw them logged in as active users. They do have "last logged in" times that fall into the right range... if they really were 'active users' for that long.
What I'm looking for is that once someone clicks "logoff" OR otherwise becomes inactive, that would remove them from the active users list and update the time correctly. Is it the IF statement in that REMOVE ACTIVE USERS area that's making this only trigger after 20+ minutes have passed? If so, then where should I put that update code?