The forum has such a feature (as you can see in the footer. How this works is not 'online' as such but people who have logged in in the last 15min. If you're logged in it updates the LastVisited time on every page visit so you can do something like.
Thanks, Will, yes for logged in visitors this is an easy solution.
I assume I have to create a table to keep track of the IPs of all visitors (not forum, not logged in), that'll give me something similar, and to avoid that table getting too big to delete old entries from time to time.