corsasport.co.uk
 

Corsa Sport » Message Board » General Chat » Is there anyway on here of finding out...


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Is there anyway on here of finding out...
Martyn
USER UNDER INVESTIGATION - DO NOT TRADE

Registered: 17th Oct 03
Location: Luton
User status: Offline
28th Oct 03 at 13:15   View User's Profile U2U Member Reply With Quote

How many hours in total you've spend on CS. I think that would be pretty cool if ya could!

Martyn..
DanielJ
Member

Registered: 21st Nov 01
Location: gwent, south wales
User status: Offline
28th Oct 03 at 13:16   View User's Profile U2U Member Reply With Quote

na but iv been on here 2 yrs constant so alot of hours
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
28th Oct 03 at 13:33   View Garage View User's Profile U2U Member Reply With Quote

We couldn't do this accurately because of the inherent limitations in HTTP, sorry.
Martyn
USER UNDER INVESTIGATION - DO NOT TRADE

Registered: 17th Oct 03
Location: Luton
User status: Offline
28th Oct 03 at 14:05   View User's Profile U2U Member Reply With Quote

no problems Ian. I was just thinking, cause I think I've spent most of my year on hear
waynep
Member

Registered: 20th Apr 02
Location: london
User status: Offline
28th Oct 03 at 14:13   View User's Profile U2U Member Reply With Quote

i could probaly make sum in like this

maybe u start off with a query like this ( i duno how your tables are set up) but im guessing like this ? :

ALTER TABLE user ADD timeonline int(10) NOT NULL DEFAULT '0'
then the function would be sumhin like

function dotimeonline($timeonline) {

$days = floor($timeonline / 86400);
if($days == 0) {
$ftime = "";
} elseif($days == 1) {
$ftime = "$days Day, ";
} else {
$ftime = "$days Days, ";
}

$tothours = $days * 86400;
$newhours = $timeonline - $tothours;
$hours = floor($newhours / 3600);
$ftime.= "$hours Hours, ";

$totmin = (($hours * 3600) + ($days * 86400));
$newmin = $timeonline - $totmin;
$minutes = floor($newmin / 60);
$ftime.= "$minutes Minutes, ";

$totsec = (($hours * 3600) + ($minutes * 60) + ($days * 86400));
$seconds = $timeonline - $totsec;
$ftime.= "$seconds Seconds Online";

return $ftime;

}
Martyn
USER UNDER INVESTIGATION - DO NOT TRADE

Registered: 17th Oct 03
Location: Luton
User status: Offline
28th Oct 03 at 14:14   View User's Profile U2U Member Reply With Quote

yer good idea m8 up 2 you and Ian though m8
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
28th Oct 03 at 14:15   View Garage View User's Profile U2U Member Reply With Quote

corsa-crazy, thats a wild approximation.
waynep
Member

Registered: 20th Apr 02
Location: london
User status: Offline
28th Oct 03 at 14:17   View User's Profile U2U Member Reply With Quote

thanks of course i could output these functions and intergrate to users info etc etc
Trotty
Member

Registered: 22nd Feb 01
Location: Bristol
User status: Offline
28th Oct 03 at 14:18   View User's Profile U2U Member Reply With Quote

Yup. If someone comes online for 1 minute, and then closes the PC down or whatever, surely that'll still log the user as here for the full 20mins yes?
waynep
Member

Registered: 20th Apr 02
Location: london
User status: Offline
28th Oct 03 at 14:21   View User's Profile U2U Member Reply With Quote

no ! u could set this

$inactivetime = 5; // Configure Time Out Time Here in Minutes!
$factivetime = $inactivetime * 60;
$newtime = time() - $csuserinfo[lastactivity];
if($newtime < $factivetime) {
$DB_site->query("UPDATE user SET timeonline=timeonline+$newtime WHERE userid=cs user id'");
}




[Edited on 28-10-2003 by corsa-crazy]
Martyn
USER UNDER INVESTIGATION - DO NOT TRADE

Registered: 17th Oct 03
Location: Luton
User status: Offline
28th Oct 03 at 14:25   View User's Profile U2U Member Reply With Quote

cool
broster
Premium Member

Avatar

Registered: 6th Dec 02
Location: Drives: E39
User status: Offline
28th Oct 03 at 14:33   View Garage View User's Profile U2U Member Reply With Quote

and i know exactly what that means! looks funky tho!
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
29th Oct 03 at 00:53   View Garage View User's Profile U2U Member Reply With Quote

No no no!

HTTP is inherently stateless. You will *never* accurately tell how long someone has been at a web site. Session tracking used in this message board, other web apps, indeed *any* client-server environment using that protocol is mere hack that *assumes* you're going to stick around for a set length of time.

The code you have pasted does nothing more than manipulate a few variables and write this approximation to the database.

If nothing else, thats an extra DB query when we're trying to make the site *more* efficient and responsive, not less!
Richie
Member

Registered: 3rd Dec 02
Location: Newport, Wales
User status: Offline
29th Oct 03 at 00:55   View User's Profile U2U Member Reply With Quote

stop whinging and fix up Ian

Martyn, invest in a stopwatch ffs
IntaCepta
Member

Registered: 25th Mar 02
Location: Mill Hill East, Greater London
User status: Offline
29th Oct 03 at 01:32   View User's Profile U2U Member Reply With Quote

HTTP isn't stateful like ftp.
Once u request and recieve a response from the server, thats it. The server will never know if the client is still viewing the page.

there is no way of knowing whether or not the client is still viewing the page.

and like ian said u don't wanna be having queries coming from left, right and center!

 
New Topic

New Poll

Corsa Sport » Message Board » General Chat » Is there anyway on here of finding out... 23 database queries in 0.0083990 seconds