For a forum I am lookng for a simple but accurate online/offline check functionality so users can see which user is online or offline. Are there some ready mad scripts or does anyone know of a good tutorial to accomplish this?

It's quite easy to realize, all you need is to create another two fields in table with users: online (tinyint) and last_online (timestamp).Each time (or each second time) user enters on the page you update the last_online to now() and set online to 1, like that:

UPDATE users SET last_online = NOW(), online = 1 WHERE id = $user_id

And execute another SQL statement to put offline users who are not online: