Fixed sql call to get first post which didn't account for global topics.