Total Online !

Started on the old forum in December 2008 · view the original in the archive · old links redirect here

6 replies · 580 views · started 17 years ago · 1 min read

5 participants
tkrocks Junior · 39 posts #1

CODE $idle = time() + $data['ltime']; $d = intval($idle / (246060)); $tmpd = $idle % (246060); $h = intval($tmpd / (6060)); $tmph = $tmpd % (6060); $m = intval($tmph / 60); $s = $tmph % 60; if($data['hidden'] != "Y") { print "Idle For: "; if($d > 0) print " $d days "; if($h > 0) print "$h hours "; if($m > 0) print "$m mins "; if($s > 0) print "$s secs"; }

I WANT TO SHOW TOTAL TIME ONLINE IN THE USERS PROFILE BUT IT SHOWS 28436 DAYS GUYZ PLZ HELP ME I TRIED TO FIND HERE BUT I COULDNT FIND PLZZZ THANKS

I WAS BORNED INTELLIGENT BUT EDUCATION RUINED ME...!!!

marwin29 Junior · 35 posts #2

$totaltimeonline = mysql_fetch_array(mysql_query("SELECT tottimeonl FROM ibwf_users WHERE id='".$who."'"));
$num = $totaltimeonline[0]/86400; $days = intval($num); $num2 = ($num - $days)*24; $hours = intval($num2); $num3 = ($num2 - $hours)*60; $mins = intval($num3); $num4 = ($num3 - $mins)*60; $secs = intval($num4);

echo "Time Online: "; if(($days==0) and ($hours==0) and ($mins==0)){ echo "$secs seconds "; }else if(($days==0) and ($hours==0)){ echo "$mins mins, "; echo "$secs seconds "; }else if(($days==0)){ echo "$hours hours, "; echo "$mins mins, "; echo "$secs seconds "; }else{ echo "$days days, "; echo "$hours hours, "; echo "$mins mins, "; echo "$secs seconds "; } try this mate from methos it work great check if u have table for this.. -yay-

Anshul Senior · 296 posts #3
$time = $data['ltime'];
$ltime = time() - $time;
if($ltime < 60 && $ltime >= 0)
{
$var = "sec.";
}
elseif($ltime < 3600 && $ltime > 60)
{
$new = $ltime;
$ltime = $new/60;
$var = "min.";
}
elseif($ltime < 86400 && $ltime > 3600)
{
$new = $ltime;
$ltime = $new/3600;
$var = "hours";
}
elseif($ltime > 86400)
{
$new = $ltime;
$ltime = $new/86400;
$var = "days";
}
$ltime = round($ltime, 2);
if($ltime)echo "Idle Time: $ltime $var
\n";
tkrocks Junior · 39 posts #4

ANSH BRO THATS THE CODE FOR IDLE TIME I WANT ...TOTAL TIME SPENT ON SITE

I WAS BORNED INTELLIGENT BUT EDUCATION RUINED ME...!!!

Anshul Senior · 296 posts #5

u can make tat frm dis change time() to registered time

$time = $data['ltime'];
$rtime = $data['rtime'];
$ltime = $rtime - $time;
if($ltime < 60 && $ltime >= 0)
{
$var = "sec.";
}
elseif($ltime < 3600 && $ltime > 60)
{
$new = $ltime;
$ltime = $new/60;
$var = "min.";
}
elseif($ltime < 86400 && $ltime > 3600)
{
$new = $ltime;
$ltime = $new/3600;
$var = "hours";
}
elseif($ltime > 86400)
{
$new = $ltime;
$ltime = $new/86400;
$var = "days";
}
$ltime = round($ltime, 2);
if($ltime)echo "Total Time: $ltime $var
\n";
friend Developer · 112 posts #6

which script for total online time.. i mean actual total online time from past days.

If users member from 3 months but he online at site everyday 1 hour so total online time 90 hours. I need that total online script. Thanks

aasim Newbie · 4 posts #7

QUOTE (tkrocks @ Dec 5 2008, 12:15 PM) <{POST_SNAPBACK}>

CODE

$idle = time() + $data['ltime']; $d = intval($idle / (246060)); $tmpd = $idle % (246060); $h = intval($tmpd / (6060)); $tmph = $tmpd % (6060); $m = intval($tmph / 60); $s = $tmph % 60; if($data['hidden'] != "Y") { print "Idle For: "; if($d > 0) print " $d days "; if($h > 0) print "$h hours "; if($m > 0) print "$m mins "; if($s > 0) print "$s secs"; }

I WANT TO SHOW TOTAL TIME ONLINE IN THE USERS PROFILE BUT IT SHOWS 28436 DAYS GUYZ PLZ HELP ME I TRIED TO FIND HERE BUT I COULDNT FIND PLZZZ THANKS

wat is total time online lol how much time user styd at ur site ??????

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close