Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Total time online ?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
pitstraight Posted - 23 June 2007 : 01:46:44
Is there a mod that will add the total users's online time onto their profile ?

I have Active Users installed, could I take the time from that ?<
15   L A T E S T    R E P L I E S    (Newest First)
PPSSWeb Posted - 26 July 2007 : 10:06:17
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.



<
pitstraight Posted - 25 July 2007 : 23:54:32
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 <
tribaliztic Posted - 25 July 2007 : 17:13:02
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?
<
PPSSWeb Posted - 25 July 2007 : 07:49:37
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.<
Shaggy Posted - 25 July 2007 : 04:07:06
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.

<
PPSSWeb Posted - 24 July 2007 : 15:46:04
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.<
tribaliztic Posted - 24 July 2007 : 15:29:19
But this will only show online time for THIS session? Not all sessions since registering? Or am I wrong?
<
PPSSWeb Posted - 24 July 2007 : 15:21:59
Where did you want this displayed in the profile?

I would think you should be able to use the same calcualtion used on the active users page for this.

abs(DateDiff("n",StrToDate(rsAM("AU_LOGINTIME")),strForumTimeAdjust))

In the profile page (page name depends on where you want it displayed), you would have to query the active users table for the AU_LOGINTIME value then put this value and the appropriate formatting.<
tribaliztic Posted - 24 July 2007 : 14:58:54
I did ask for this earlier, don't remember what replies I got but not anything that helped me enough to make the changes myself =)
Now I have more knowledge and it shouldn't be that hard to do I think. It's just the time issue... =)
<
ruirib Posted - 03 July 2007 : 04:12:57
I can't say that you should wait two or three days and you will get a reply. Maybe you won't get any. This is a voluntary support forum, people post about the issues they feel comfortable with, they like the most, whatever... I for one, do no post much about mods, cause I really don't like much to do it. On a voluntary system, likely with not much of free time, any help is welcome, but no one is forced to address all issues.

I understand your point of view, you have a need and you seem to get no replies... I guess this matter is not that popular among our regulars... I know this does not help much, but it's just to let you know that you're not ignored...<
pitstraight Posted - 03 July 2007 : 01:26:07
OK, how long should I wait then ? In 10 days I've had 2 people respond. HuwR couldn't really help, Shaggy seems to know how to do it but neither of us can find anything by searching. This place is pretty active, but there is still a few threads which get ignored, dropped, whatever.

I've said before that I don't know how to write all the html that I need to know to get it to work, or I would have already done it. I've added a few mods (I can follow instructions), and I can see that it is possible but I haven't hte foggiest clue where to start with the code.<
ruirib Posted - 01 July 2007 : 18:25:37
No one is ignored, I think. It may just be that people do not have that much time to think about this, among the members who do know enough about the way the current code works to help you with it. Not all mod requests get answered... many do, some don't.<
pitstraight Posted - 01 July 2007 : 18:07:03
Am I being ignored, or is this just too hard for anyone to help me with ?<
pitstraight Posted - 30 June 2007 : 00:52:06
Is there anyone else out there that can actually HELP with my problem ?<
Shaggy Posted - 26 June 2007 : 04:58:40
Can't find it know meself, either, but that's more than likely the insomnia & hayfever hampering my search powers.

<

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000 Version 3.4.07