Topic: Change to "Online Today" Mod

I use the online today mod, but would like to change it so it tracked people online the last 24 hours. I don't like how it clears the list of names at midnight and starts over.

Any help would be appreciated. Thanks!

Re: Change to "Online Today" Mod

Either my request is extremely challenging or I'm not making it very clear. Then again, maybe it's just a boring request.

Anyone? ....  Bueller?

Re: Change to "Online Today" Mod

I've never seen the mod, but I'm guessing it just reads the "user" table and looks for the lastonline value (or something along them lines... forget the real name of it). Well after finding that date it ignores anything that isn't from today. I think the time is stored as ticks since the Epoch, so alls you have to do is change that test to look for dates from or after CurrentTicksSinceEpoch - ((60 * 60) * 24). Course that's just a guess, give it a try and post if you get problems tongue

echo "deadram"; echo; fortune;

Re: Change to "Online Today" Mod

Thanks for the hint. The line below reads the current time. I did what you said and subracted 86400 seconds from this and got what I wanted.

$todaystamp = mktime(0,0,0, $date['mon'], $date['mday'], $date['year']);

5

Re: Change to "Online Today" Mod

Vandelay, why not keeping '$todaystamp' as it is for future need and creating '$last24' so it'l be:

$last24 = mktime(0,0,0, $date['mon'], $date['mday'], $date['year']);

    $result = $db->query('SELECT username, id, last_visit from '.$db->prefix.'users WHERE last_visit >= \''.$last24.'\' ORDER by last_visit DESC') or error('Impossible de retrouver la liste des utilisateurs en ligne aujourd\'hui', __FILE__, __LINE__, $db->error());
فهد

Re: Change to "Online Today" Mod

I'm not a programmer so I stumbled my way through it. It's probably not the proper way to do it, but this is what I came up with.

$now = mktime(0,0,0, $date['mon'], $date['mday'], $date['year']);
$todaystamp = $now - 86400;

The query that follows this code remains the same.