Autu Logout?
Started on the old forum in April 2008 · view the original in the archive · old links redirect here
LOL WHY DO I THINK MATRIX 15 IS FLAREMOBILE
Guest
#24
ok here is sql to alter your online table use it in phpmyadmin
ALTER TABLE `online` ADD `lseen` INT( 255 ) NOT NULL DEFAULT '0';
Add this function
function update_timeout($user){
$currenttime = time();
mysql_query("UPDATE online SET lastseen='$currenttime' WHERE user='$user'");
$limit = 420; //timout in seconds (420 seconds is 7 mins)
$userlseen = time()-$limit;
mysql_query("DELETE FROM online WHERE lseen < $userlseen");
}
I havn't tested this for errors so any problems then post here
to use afer adding use
update_timeout($user);
$user is the var containg of the person that is logged in put it in main menu or a page that is updated frequently