'.(time()-(int)$max_age*86400).') AND '; $forum = new e107forum; $forumList = implode(',', $forum->getForumPermList('view')); //TODO: Use query from forum class to get thread list $qry = " SELECT p.post_user, p.post_id, p.post_datestamp, p.post_user_anon, p.post_entry, t.thread_id, t.thread_datestamp, t.thread_name, u.user_name FROM `#forum_post` as p LEFT JOIN `#forum_thread` AS t ON t.thread_id = p.post_thread LEFT JOIN `#user` AS u ON u.user_id = p.post_user WHERE {$maxage} p.post_forum IN ({$forumList}) ORDER BY p.post_datestamp DESC LIMIT 0, ".$menu_pref['newforumposts_display']; if($results = $sql->gen($qry)) { $text = ""; } else { $text = LAN_FORUM_MENU_002; } e107::getRender()->tablerender($menu_pref['newforumposts_caption'], $text, 'nfp_menu');