Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Active Users: Resets itself every hour on the hou
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

Jeepaholic
Average Member

USA
697 Posts

Posted - 17 May 2001 :  12:54:51  Show Profile  Visit Jeepaholic's Homepage
I've implemented the Active Users MOD (love it, btw!), and it manages to reset (and remove) all users every hour on the hour. Any insight as to why this is the case?

Al Bsharah
Jeepaholics Anonymous

big9erfan
Average Member

540 Posts

Posted - 17 May 2001 :  14:02:28  Show Profile
WOW.

I just witnessed this.

Crazy is all I can say.

I'll check it on my site the next hour and see if the same happens.


Update:
I did NOT experience the same problem on my site as I did on yours at the hour.

I did see 1 name drop off and though the problem was present ( there were only 2 people total on the site at the moment me and another member ) so I asked him if he was still on the forum at that moment, but he had closed the window. hee hee

On your site, at the hour, I couldn't even access the page ( gave an error, but as I didn't have my Friendly HTTP errors turned off I didn't see it ).

I don't know what to tell you except to check and make sure that something didn't get added to your pages what wipes the active users table clean.

Double Update:

I did experience this.

I'll test it on my home machine where I can manipulate the time and test out where and why it's happening. I'll let you know.




http://www.ugfl.net/forums

Edited by - big9erfan on 17 May 2001 15:10:16

Edited by - big9erfan on 17 May 2001 18:03:26
Go to Top of Page

big9erfan
Average Member

540 Posts

Posted - 17 May 2001 :  18:40:48  Show Profile
Ok I haven't been able to work on this much but I've come to the decision that the problem has to come from somewhere in here.


' SET WHEN TO TIMEOUT THE USER
' DO THIS IN SECONDS
strOnlineDate = DateToStr(Date)
strOnlineCheckInTime = DateToStr(Now())

strOnlineTimedOut = strOnlineCheckInTime - 660 'time out the user after 11 minutes ( 660 seconds )

' LETS DELETE ALL INACTIVE USERS
SQL = "DELETE FROM " & strTablePrefix & "ONLINE WHERE LastChecked < '" & strOnlineTimedOut & "'"
objConn.Execute SQL


I haven't been able to test the values that this comes up with, but this is the only place where people are removed from the table, so there must be and error in calcing the timeout when moving to a new hour.

that's my theory, I'll test it later...hee hee



http://www.ugfl.net/forums
Go to Top of Page

big9erfan
Average Member

540 Posts

Posted - 17 May 2001 :  20:56:28  Show Profile
Seems I'm having a convo with myself but here goes with my analysis of the problem.

First problem, the item in the database LastChecked is a normal text field.

The variable strOnlineTimedOut is stored as a string as well.

Unless I'm wrong ( anyone care to point that out please?!? ) you cannot do a < comparison on a string and have it come out properly.

Now if these both were of the DATE type then I think it would work properly, but I THINK this is where the problem is.

Please someone back me up on this.



http://www.ugfl.net/forums
Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 20 May 2001 :  15:10:36  Show Profile  Visit Jeepaholic's Homepage
Anyone able to look at or resolve this? Thanks much!

Al Bsharah
Jeepaholics Anonymous
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 20 May 2001 :  15:19:19  Show Profile  Visit HuwR's Homepage
string comparison like this is perfectly valid, your problem is the use of the Now() function to get the date and time, it should be replaced with the variable strForumTimeAdjust

Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 20 May 2001 :  16:04:49  Show Profile  Visit Jeepaholic's Homepage
Thanks for the response HuwR... Made the code suggestion you requested but users are still getting reset on the hour. I'm gonna see if I can't start tracking some values to see what's really going on... Any other thoughts?

Al Bsharah
Jeepaholics Anonymous
Go to Top of Page

big9erfan
Average Member

540 Posts

Posted - 21 May 2001 :  00:18:10  Show Profile
Ok, well I was KIND of right when I said the problem was with calcing the value here

strOnlineCheckInTime = DateToStr(Now())
strOnlineTimedOut = strOnlineCheckInTime - 660

I decided to track the value of strOnlineTimedOut when the hour changed, and BOY was I surprised.

Here is the value of last checked at ~ 10:00:05 pm on my personal PC.
20010521095955 which comes to about 2001 05 21 09:59:55
and here's the value of
strOnlineTimedOut
20010521099350 which comes to about 2001 05 21 09:93:50

Now, I know I've been out of school a while, but last I check there were not 93 min in an hour...All in fun.

I'm working on a Fix for this as I type here. If someone sees this and wants to post PLEASE feel free. I'm not sure what I'm going to do about this at the moment.



http://www.ugfl.net/forums
Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 21 May 2001 :  01:08:18  Show Profile  Visit Jeepaholic's Homepage
Ahhh ha. So it's subtracting numbers as opposed to minutes when it subtracts the 660. <laugh> So...here's what I've learned, and here's how I ended up fixing it:

LEARNED:
The 660 value isn't actually 11 minutes. It only comes out to 6.6 minutes because of the fact that we're subtracting a simple number from the strOnlineCheckInTime value, not actual time. So, if you want 11 minutes, you have to subtract 1100 (11 minutes, 00 seconds).

FIXED:
Here is the code I used to make it all work with comments...

' SET WHEN TO TIMEOUT THE USER
' DO THIS IN SECONDS
strOnlineDate = DateToStr(Date)
strOnlineCheckInTime = DateToStr(strForumTimeAdjust)

OnlineResetTime = 1100 'number of minutes and seconds before reset (format: mmss)

if minute(now) < (OnlineResetTime/100) then OnlineResetTime=OnlineResetTime+(40*100) 'adjust time to be a real value, as opposed to a potentially invalid one

strOnlineTimedOut = strOnlineCheckInTime - OnlineResetTime 'time out the user after OnlineResetTime value above


The if statement will check to see if subtracting the reset time minutes from the check in time will result in an invalid value. If so, it will subtract an additional 40 minutes to create a real time. The 40 minute value is the difference between 60 (number of minutes in an hour) and 100.

Ya!

Al Bsharah
Jeepaholics Anonymous
Go to Top of Page

big9erfan
Average Member

540 Posts

Posted - 21 May 2001 :  01:31:31  Show Profile
****, you beat me to it

Hee hee...

thanks

http://www.ugfl.net/forums
Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 21 May 2001 :  02:02:55  Show Profile  Visit Jeepaholic's Homepage
Ahhhh, but you were the catalyst! Plus, I had nothing better to do while watching the X-Files tonight.

Al Bsharah
Jeepaholics Anonymous
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 19 June 2001 :  00:09:22  Show Profile  Visit dayve's Homepage
could my problem be related to this??

Intermittent Reply Errors

Dayve
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 19 June 2001 :  01:26:39  Show Profile  Visit dayve's Homepage
Richard pointed me to my problem. had to change a field type to memo from char 250...

Dayve
Go to Top of Page

Aznknight
Senior Member

USA
1373 Posts

Posted - 19 June 2001 :  02:03:45  Show Profile  Send Aznknight an AOL message  Send Aznknight an ICQ Message
cool, i just noticed this behavior recently too. Thanks for the quick fix guys :)

- Alan
www.iamviet.com
www.calvsa.net
Snitz Resource
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 19 June 2001 :  02:14:40  Show Profile
I believe this would do the same thing:

' SET WHEN TO TIMEOUT THE USER
' DO THIS IN MINUTES
strOnlineDate = DateToStr(strForumTimeAdjust)
strOnlineCheckInTime = DateToStr(strForumTimeAdjust)
strOnlineTimedOut = DateToStr(DateAdd("n",-11,StrToDate(strOnlineCheckInTime))) 'time out the user after 11 minutes
Go to Top of Page

RobX
Starting Member

USA
27 Posts

Posted - 21 June 2001 :  03:20:52  Show Profile
quote:

I believe this would do the same thing:

' SET WHEN TO TIMEOUT THE USER
' DO THIS IN MINUTES
strOnlineDate = DateToStr(strForumTimeAdjust)
strOnlineCheckInTime = DateToStr(strForumTimeAdjust)
strOnlineTimedOut = DateToStr(DateAdd("n",-11,StrToDate(strOnlineCheckInTime))) 'time out the user after 11 minutes




which file are you talking about? And where in the file? :-)
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.4 seconds. Powered By: Snitz Forums 2000 Version 3.4.07