Ok, I've worked out the problem now
sorry about all the problems.
Look for
PHP Code:
if (!$attachmentinfo=$DB_site->query_first("SELECT filename,hash,dateline,visible FROM attachment WHERE attachmentid='$attachmentid'")){
Please ensure that visible is there in that list, this is super super important as if it isn't then only moderators and admins will be able to view it as they have permission to moderate attachments.