Thanks to delux (someone who is involved with the WEForums server), he fixed the problem.
Instead of:
PHP Code:
$lastpostsecond = $DB_site->query_first("SELECT MAX(post.dateline) AS dateline
FROM post
LEFT JOIN thread ON thread.threadid=post.threadid
WHERE thread.forumid='$forumid'");
$lastpostseconds=time() - $lastpostsecond['dateline'];
Use:
PHP Code:
$lastpostsecond = $DB_site->query_first("SELECT lastpost
FROM forum
WHERE forumid='$forumid'");
$lastpostseconds=time() - $lastpostsecond['lastpost'];