This code was taken straight out of the 2.3.0 functions.php
PHP Code:
$lastposts=$DB_site->query_first("SELECT MAX(lastpost) AS lastpost FROM thread WHERE forumid=$forumid AND visible=1 AND open<>10");
if ($lastposts['lastpost']>$lastpost) {
$lastposts=$DB_site->query_first("
SELECT lastpost,lastposter
FROM thread
WHERE forumid = $forumid AND lastpost = '$lastposts[lastpost]'");
$lastpost=$lastposts['lastpost'];
$lastposter=$lastposts['lastposter'];
}
$lastpostquery=",lastpost='$lastpost',lastposter='".addslashes($lastposter)."'";