SELECT t.topic_id, t.topic_first_post_id, t.forum_id, t.topic_last_post_id, t.topic_title, t.topic_poster, t.topic_views,
t.topic_replies, t.topic_moved_id, p.poster_id, p.post_time, u.username, l.username, u.user_id, p.post_text, p.post_username, f.post_username, a.auth_role_id FROM
phpbb_topics AS t LEFT JOIN
phpbb_posts AS p ON (p.post_id = t.topic_last_post_id) LEFT JOIN
phpbb_posts AS f ON (f.post_id = t.topic_first_post_id) LEFT JOIN
phpbb_users AS u ON (u.user_id=p.poster_id) LEFT JOIN
phpbb_users AS l ON (l.user_id=t.topic_poster) LEFT JOIN
phpbb_acl_groups AS a ON (a.forum_id = t.forum_id) WHERE a.auth_role_id != 16 AND a.group_id = 5 ORDER BY t.topic_last_post_id DESC LIMIT 0, 5