Posted on Thursday 7th June 2007 at 08:41 PM | |
gbt91 Junior Member |
Try to make an online users based on time... plzzzzzzzzzzzzzzzzzzzzzzz |
Posted on Thursday 7th June 2007 at 09:15 PM | |
SkillMaster Senior Member |
argh. put this right up the top of config.php under the <?php tag. Code include ("online.php"); save this as online.php Code <? include("config.php"); $offline = 2; //seconds $current = time(); //gets the time on the server (unformatted) $offline = ($current-$offline); if ($user[username]) { $update = mysql_query("UPDATE `members` SET online = '$current' WHERE username = '$logged[username]'"); } ?> save this as whosonline.php Code <? include "config.php"; $offline = 2; // seconds $current = time(); //gets the current time $offline = ($current-$offline); //the cutoff time for being considered online $getusers = mysql_query("SELECT * from users where online >= '$offline'"); while ($users = mysql_fetch_array($getusers)) { $username = $users[username]; echo ("$username, "); } ?> I don't know what it does but it works. I never looked into it. |
Posted on Thursday 7th June 2007 at 10:03 PM | |
Diablosblizz Senior Member |
So if they're not active for 2 seconds they get logged off? |
Posted on Friday 8th June 2007 at 05:08 AM | |
SkillMaster Senior Member |
As I said in a previous topic its not my code, i havent looked into it. i dont know what it does. |