SELECT attachmentid, filename, filesize, dateline, postid, IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail, counter, attachment.thumbnail, attachment.thumbnail_dateline, LENGTH(attachment.thumbnail) AS thumbnailsize, newwindow, visible
* *FROM " . TABLE_PREFIX . "attachment AS attachment
* *LEFT JOIN " . TABLE_PREFIX . "attachmenttype AS attachmenttype ON (attachment.extension = attachmenttype.extension)
* *WHERE postid IN(" . implode(',', $newspids) . ")
* * AND visible = 1
* *" . iif($mod_options['portal_news_showattachments'] != 2, 'GROUP BY attachment.postid') . "
* *ORDER BY attachmentid