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

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Total time online ?
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 24 July 2007 :  15:29:19  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message  Reply with Quote
But this will only show online time for THIS session? Not all sessions since registering? Or am I wrong?
<

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

PPSSWeb
Junior Member

312 Posts

Posted - 24 July 2007 :  15:46:04  Show Profile  Reply with Quote
quote:
Originally posted by tribaliztic

But this will only show online time for THIS session? Not all sessions since registering? Or am I wrong?




Very true., I guess that is what I get for answering without fully understanding the question. Sorry for the hasty reply.

In that case, it looks like Shaggy hit it right on the head in the post above.

I think you will also have to add the calculation to the deleteInactiveUsers() function to capture all cases where the user is removed from the active users.

If I am looking at this right though, I am not sure this will be accurate. I think both of these functions operate on timeouts, so this will not cover the function where they log out directly. In this case their time will keep increasing until the next timeout. Is this right? Even still, this will only execute when someone else loads these functions. So if I am thinking right, this could keep counting users time until someone else logs in, even if the other user left a and timed out a long time ago.<

Edited by - PPSSWeb on 24 July 2007 16:15:14
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 25 July 2007 :  04:07:06  Show Profile  Reply with Quote
I'd be careful of making this information publicly available in profiles; personally, I wouldn't hang around a forum for too long if anyone could register and see this information, best to keep it for admins only.

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

PPSSWeb
Junior Member

312 Posts

Posted - 25 July 2007 :  07:49:37  Show Profile  Reply with Quote
quote:
Originally posted by Shaggy

I'd be careful of making this information publicly available in profiles; personally, I wouldn't hang around a forum for too long if anyone could register and see this information, best to keep it for admins only.





Good point Shaggy. I agree completely.<
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 25 July 2007 :  17:13:02  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message  Reply with Quote
quote:
Originally posted by Shaggy

I'd be careful of making this information publicly available in profiles; personally, I wouldn't hang around a forum for too long if anyone could register and see this information, best to keep it for admins only.





I'm registered at two other forums that do show this in the profiles, only the user can se his/her own time. I don't really see the problem with showing this for everyone though?
<

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

pitstraight
New Member

Australia
82 Posts

Posted - 25 July 2007 :  23:54:32  Show Profile  Reply with Quote
I don't see the problem with everyone seeing it, but if someone can write the code Im sure I can make it show the way I want.

also VERY glad to see some life in this thread <
Go to Top of Page

PPSSWeb
Junior Member

312 Posts

Posted - 26 July 2007 :  10:06:17  Show Profile  Reply with Quote
I am not sure how this will work as I havn't had time to really test it, but maybe this will give you a start.

As stated you will need to add a field to the Members table. With a numeric value started at 0. Make sure you chose a data type that will have enough room so you will not be likely to over run the value if you forum stays up for a number of years.

To get the total time value from the database and current active time then add the two and update the total time, you will need something like this.
'##Total online time##
if MemberID="-1" then 'If this is a Guest, do nothing
else 'If this is a Member, get Login Time
strSql = "SELECT AU_LOGINTIME FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID = " & MemberID
set rsAM = my_conn.execute (strSql)
if rs.EOF or rs.BOF then 'do nothing
else 'get Total Time online
strSQL = "SELECT M_TIMEONLINE FROM " & strTablePrefix & "MEMBERS WHERE (MEMBER_ID = " & MemberID & " AND MEMBER_ID <> -1)"
set rs = my_conn.execute (strSql)
if rs.EOF or rs.BOF then 'do nothing
Else 'update total time online
onlineTime = rs("M_TIMEONLINE") + abs(DateDiff("n",StrToDate(rsAM("AU_LOGINTIME")),strForumTimeAdjust))
strSql = "UPDATE " & strTablePrefix & "MEMBERS SET M_TIMEONLINE='" & onlineTime & "'" & _
"WHERE MEMBER_ID = " & MemberID
my_conn.execute (strSql)
End IF
end if
rsAM.close
set rsAM = Nothing
rs.close
set rs = Nothing
end if
'######


It has been mentioned that this should go in inc_func_common. I am just not sure where it is best to put it at the moment. I added it to the ActiveUserTracker() function and it has not run when I expected it to. Or maybe I was just too impatient.

Where you want to display this information, you will need to put something like this:
      		strSQL = "SELECT M_TIMEONLINE FROM " & strTablePrefix & "MEMBERS WHERE (MEMBER_ID = " & MemberID & " AND MEMBER_ID <> -1)"
set rs = my_conn.execute (strSql)
if rs.EOF or rs.BOF then 'do nothing
Else 'output total time online
Response.Write " Total Time Online: " & rs("M_TIMEONLINE")
End if


I am pretty sure this code will need some tweaking and cleanup. But perhaps it will give you a start.



<
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.07 seconds. Powered By: Snitz Forums 2000 Version 3.4.07