| Author |
Topic Search Topic Options
|
leo
Newbie
Joined: 06 January 2008
Location: Rijeka
Status: Offline
Points: 7
|
Post Options
Thanks(0)
Quote Reply
Topic: Total Time spent on the forum Posted: 22 January 2008 at 8:00am |
|
How can i add a total time spend on the forum (from the day the user joined ) on the member profile page or avator ?
|
 |
leo
Newbie
Joined: 06 January 2008
Location: Rijeka
Status: Offline
Points: 7
|
Post Options
Thanks(0)
Quote Reply
Posted: 20 February 2008 at 2:20pm |
|
like , a user A was totaly 100 hours on my forum , and he deserves a credit or something ?!
|
 |
StarDust
Senior Member
Joined: 14 May 2007
Location: Bangladesh
Status: Offline
Points: 310
|
Post Options
Thanks(0)
Quote Reply
Posted: 20 February 2008 at 5:07pm |
|
This sounds a nice idea.
Bruce, you should consider this.
|
|
|
 |
Scotty32
Moderator Group
Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
|
Post Options
Thanks(0)
Quote Reply
Posted: 20 February 2008 at 7:16pm |
|
This isnt exactly easy to do, when someone loads a page, thats it, they are disconnected from the server untill they go to another page.
Somebody could spend an hour on one page then go to another, or come back an hour later, and there would be no way of knowing which it was.
It is the same reason why Active Users displays people who was active within the last 20minutes, because it doesnt know if they're still on, or if they've left.
|
|
|
 |
StarDust
Senior Member
Joined: 14 May 2007
Location: Bangladesh
Status: Offline
Points: 310
|
Post Options
Thanks(0)
Quote Reply
Posted: 21 February 2008 at 7:54am |
|
I think the possibilities lies in session functions.
We can track a user for how many minutes/hours he is on the site. We can store his user ID in the session vars.
For each session, after a session ends when wwf removes the active users entry from array/db, we can also open the profile table and increase the total amount of time spent on the site assuming there is already a field like totaltime in the tblAuthor.
|
|
|
 |
StarDust
Senior Member
Joined: 14 May 2007
Location: Bangladesh
Status: Offline
Points: 310
|
Post Options
Thanks(0)
Quote Reply
Posted: 21 February 2008 at 7:55am |
|
And of course no one wants to track down who are not logged in. If you want to get the benefits, you must be a member and logged in.
|
|
|
 |
StarDust
Senior Member
Joined: 14 May 2007
Location: Bangladesh
Status: Offline
Points: 310
|
Post Options
Thanks(0)
Quote Reply
Posted: 22 February 2008 at 5:53am |
|
A little more to add, I think.
A tiny javascript may help to determine exactly how much time someone expends on a page.
Session variables stored in application scope with 20 minutes of inactivity limit.
So we can deploy a common javascript confirm script with a count down timer which will execute in each 19 minutes. It will ask for a confirmation from the user after 19 minutes of staying on the same page asking like "Your login session will expire after 1 minute because you have no server activity for the last 19 minutes. Do you want to stay logged in?" [Yes/No]
If the user chooses yes, it will sent HTTP request to a page like session.asp which will once again execute common.asp and the functions needed for active users.
This way we cat track down almost exact time.
|
|
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 22 February 2008 at 8:46am |
|
It's a good idea but would not be accurate as HTTP is a stateless
protocol so there is no way to know if the person is still on the web
site or not.
This means any active user is listed as active for
15 to 20 minutes after they last make an HTTP request, this would make
such a feature completely in accurate. If someone comes to the board 3
times aday for 2 minutes they would need listed as being active for 60
minutes!
Also if it is a quiet web site the code to remove the
inactive visitor would not be run until the next person came along. If
this was 24 hours then the user would be listed as being active for 24
hours even if they only visited for 2 minutes!
I'm sure it could be done using AJAX to make active visitors more accurate but would also increase bandwidth and servers calls which can course issues on busy forums.
You would also need to run some type of schedule task to remove inactive users, as ASP doesn't have such a feature this would be very difficult to do without the interaction of a user clicking a page to course the action to run.
If this was PHP or ASP.NET then could possibly find away to work around all the issues, but I doubt it possible with ASP, although someone may come up with a way to do this and do it accurately, but I very much doubt it.
Edited by WebWiz-Bruce - 22 February 2008 at 8:50am
|
|
|
 |