phpbb/phpbb3 — pull request #523 by imkingdavid (2012-01-01 03:36:11+00:00)
Title: [ticket/10553] Display latest unapproved post information for moderators

Currently, phpBB displays only the last post that is marked as approved. This information is stored on the *_forum table to keep from having to pull from the posts table each time. However, moderators should be able to view the latest post information, whether for approved or unapproved posts. So what I did was added a new query (yes, I know, a query in a loop == bad, but I couldn't figure out a decent alternative), ONLY when the current user has moderator permissions for the forum in question, that fetches the information about the latest post directly from the posts table.

I have tested this and it works perfectly fine on my own installation. The only issue I can see is the potential for adding a lot of queries when a user is a global moderator. However, unless someone has a better way (using the current parent query (that creates the loop in which this query is placed), this is how it will have to work.

http://tracker.phpbb.com/browse/PHPBB3-10553