Ignore my queries in this thread, they are unnecessary.
The w3t_Online table contains all the info we need already, we don't need to addy any fields to the database or do any update queries.
Everytime a page is loaded the Online-table get's updated with the latest stats for that user.
To get a list of all current online users (who was active in the last 10 minutes) you only need to do this:
$Outdated = $html -> get_date() - 600; <br /> $queryOnline = " <br /> SELECT t1.O_Username,t2.U_Visible,t2.U_Color,t2.U_Number <br /> FROM {$threadspre}Online AS t1, <br /> {$threadspre}Users AS t2 <br /> WHERE t1.O_Username = t2.U_Username <br /> AND O_Last > $Outdated <br /> ORDER BY t1.O_Last DESC <br /> ";
Actually, the join isn't necessary, you only need the user id:s to be able to check against it to know if the online image should be lit or not next to each user.
Also, I think it would be possible to change the query that reads how many are browsing the current forum so that it also reads info about all who are online. I'll get working on that.