I don't know if it can be done in one query, but if you look at subscription.php, the section where $_REQUEST['do'] == 'viewsubscription', it does it there. It looks like for each thread it gets the lastread time for the forum that contains the thread, then (in process_thread_array() which is in ncludes/functions_forumdisplay.php) if the thread lastpost time is greater than the forum last read time, it checks either $thread['threadread'] or the cookie value, depending on how thead views are being recorded.
|