public static function get_attachments(array $thread_data)
{
$attachments = array();
if (self::get_attachment_permissions("can_download_attach") == TRUE) {
$a_result = dbquery("SELECT * FROM " . DB_FORUM_ATTACHMENTS . " WHERE thread_id='" . intval($thread_data['thread_id']) . "' ORDER BY post_id ASC");
if (dbrows($a_result) > 0) {
while ($a_data = dbarray($a_result)) {
if (file_exists(INFUSIONS . "forum/attachments/" . $a_data['attach_name'])) {
//$this->thread_info['attachments'][$a_data['post_id']][] = $a_data;
$attachments[$a_data['post_id']][] = $a_data;
}
}
}
}
return (array) $attachments;
}