Originally posted by arg0s12
View Post
Pls! Check this recode! If correct,
Collapse
X
-
because you are viewing your own profile, try to view others profile that are not active..
-
i thought it was idle time,, uhhm.. try this.. 5hrs status..Originally posted by arg0s12 View PostNot working bro? . . Only article's sql working to my script? Any idea?
Code:$totaltimeonline = mysql_fetch_array(mysql_query("SELECT onlinetime FROM [COLOR="Red"]tableprefix(ibwf)[/COLOR]_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 "5 hrs: "; if(($days==0) and ($hours==0) and ($mins==0)) { echo $secs."s.<br/>"; }else if(($days==0) and ($hours==0)) { echo $mins."m, "; echo $secs."s.<br/>"; }else if(($days==0)) { echo $hours."h, "; echo $mins."m, "; echo $secs."s.<br/>"; }else{ echo $days."d, "; echo $hours."h, "; echo $mins."m, "; echo $secs."s.<br/>"; }
Leave a comment:
-
Not working bro? . . Only article's sql working to my script? Any idea?
Leave a comment:
-
Thanks, bro, after a long time, your the only one who post this code, thanks, by the way, im visiting at zyclone, and thinking to use the script, a lot of stuff, ,
Leave a comment:
-
to index.php in $action=="viewuser"Originally posted by arg0s12 View PostO.K bro, i have code for 5 hours online stat, like pwap later, but my problem is what code that i put in users profile, e.g 5 hrs stat: 2 hrs, 39 mins, 50 sec.
check this function in core.phpCode:$noi = mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id='".$who."'")); $var1 = date("His",$noi[0]); $var2 = time(); $var21 = date("His",$var2); $var3 = $var21 - $var1; $var4 = date("s",$var3); echo "Idle: "; $remain = time() - $noi[0]; $idle = gettimemsg($remain); echo "$idle<br/>";
Code:function gettimemsg($sec) { $ds = floor($sec/60/60/24); if($ds > 0) { return "$ds days"; } $hs = floor($sec/60/60); if($hs > 0) { return "$hs hours"; } $ms = floor($sec/60); if($ms > 0) { return "$ms minutes"; } return "$sec Seconds"; }Last edited by huwad; 11.12.09, 14:17.
Leave a comment:
-
mysql_query("UPDATE ibwf_settings set name='".$tnow."', value='".$result[0]."' WHERE id='2'");
}
$maxtoday = mysql_fetch_array(mysql_query("SELECT ppl FROM ibwf_mpot WHERE ddt='".date("d m y")."'"));
if($maxtoday[0]==0||$maxtoday=="")
{
mysql_query("INSERT INTO ibwf_mpot SET ddt='".date("d m y")."', ppl='1', dtm='".date("H:i:s")."'");
$maxtoday[0]=1;
}
if($result[0]>=$maxtoday[0])
{
mysql_query("UPDATE ibwf_mpot SET ppl='".$result[0]."', dtm='".date("H:i:s")."' WHERE ddt='".date("d m y")."'");
}
}
what code that i put in profile? Thanks bro!
Leave a comment:
-
$res = mysql_query("UPDATE ibwf_users SET onlinetime='".$totaltimeonline."' WHERE id='".$uid."'");
$res = mysql_query("UPDATE ibwf_users SET lastact='".time()."' WHERE id='".$uid."'");
$res = mysql_query("UPDATE ibwf_users SET lastseen='".$place."' WHERE id='".$uid."'");
$res = mysql_query("INSERT INTO ibwf_online SET userid='".$uid."', actvtime='".$tm."', place='".$place."', placedet='".$plclink."'");
if(!$res)
{
//most probably userid already in the online list
//so just update the place and time
$res = mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$place."', placedet='".$plclink."' WHERE userid='".$uid."'");
}
}
$maxmem=mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE id='2'"));
$result = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online"));
if($result[0]>=$maxmem[0])
{
$tnow = date("D d M Y - H:i");
Leave a comment:
-
"Congratulations you have reach the 5 hours online. You received 100 Plusses. Note: This is an automatic pm";
mysql_query("INSERT INTO ibwf_private SET text='".$text."', byuid='332', touid='".$uid."', timesent='".time()."'");
$res = mysql_query("UPDATE ibwf_users SET plusses=plusses+100 WHERE id='".$uid."'");
$res = mysql_query("UPDATE ibwf_users SET onlinedone='1' WHERE id='".$uid."'");
$res = mysql_query("UPDATE ibwf_users SET onlinetime='0' WHERE id='".$uid."'");
$res = mysql_query("UPDATE ibwf_users SET onlinedone='0' WHERE id='".$uid."'");
}
}
$ttime = time();
$res = mysql_query("UPDATE ibwf_users SET resetime='".$ttime."' WHERE id='".$uid."'");
$lastactive = mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id='".$uid."'"));
$tolsla = time() - $lastactive[0];
$totaltimeonline = mysql_fetch_array(mysql_query("SELECT onlinetime FROM ibwf_users WHERE id='".$uid."'"));
$totaltimeonline = $totaltimeonline[0] + $tolsla;
Leave a comment:
-
Here's the code:
//////////////////////Function add user to online list :P
function addonline($uid,$place,$plclink)
{
if($hidden[0]==0)
{
/////delete inactive users
$tm = time();
$timeout = $tm - 420; //time out = 5 minutes
$deloff = mysql_query("DELETE FROM ibwf_online WHERE actvtime <'".$timeout."'");
///now try to add user to online list
$lastactive2 = mysql_fetch_array(mysql_query("SELECT resetime FROM ibwf_users WHERE id='".$uid."'"));
$tolsla2 = time() - $lastactive2[0];
$totaltimeonline2 = mysql_fetch_array(mysql_query("SELECT onlinetime FROM ibwf_users WHERE id='".$uid."'"));
$totaltimeonline2 = $totaltimeonline2[0] + $tolsla2;
$onlinetime = mysql_fetch_array(mysql_query("SELECT onlinetime FROM ibwf_users WHERE id='".$uid."'"));
$num = $onlinetime[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);
if(!onlinetime($uid))
{
if($hours==5)
{
$text =
Leave a comment:
-
O.K bro, i have code for 5 hours online stat, like pwap later, but my problem is what code that i put in users profile, e.g 5 hrs stat: 2 hrs, 39 mins, 50 sec.
Leave a comment:
-
what do you mean?? please clarify??Originally posted by arg0s12 View Postecho "<a href=\"index.php?action=main&sid=$sid&brow se?\">";
echo "main menu</a>";
echo "</p>";
echo "</body>";
}
here's all the code,
thanks, huwad, i'll try this, by the way, have your code for online stat, i have a code in core, but in profile, nothing, ,
Leave a comment:
-
echo "<a href=\"index.php?action=main&sid=$sid&brow se?\">";
echo "main menu</a>";
echo "</p>";
echo "</body>";
}
here's all the code,
thanks, huwad, i'll try this, by the way, have your code for online stat, i have a code in core, but in profile, nothing, ,
Leave a comment:
-
usage:
Code:echo "<a href=\"c2p.php?action=c2p&sid=$sid\">Link Name</a><br/>";
Attached Files
Leave a comment:
Leave a comment: