[ticket/11271] Separated attachment fetching query

Removed external query used to fetch related attachments.
Added attachments fetching method with database query to
post based feed.

PHPBB3-11271