// ### POST HAS ERRORS ### $postpreview = construct_errors($errors); // this will take the preview's place construct_checkboxes($newpost); $_REQUEST['do'] = 'newreply'; $newpost['message'] = htmlspecialchars_uni($newpost['message']); } else if ($newpost['preview']) { if ($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostattachment'] AND $vbulletin->userinfo['userid']) { // Attachments added $attachs = $db->query_read(" SELECT dateline, thumbnail_dateline, filename, filesize, visible, attachmentid, counter, IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail, thumbnail_filesize, attachmenttype.thumbnail AS build_thumbnail, attachmenttype.newwindow FROM " . TABLE_PREFIX . "attachment AS attachment LEFT JOIN " . TABLE_PREFIX . "attachmenttype AS attachmenttype USING (extension) WHERE posthash = '" . $db->escape_string($posthash) . "' AND userid = " . $vbulletin->userinfo['userid'] . " ORDER BY attachmentid "); while ($attachment = $db->fetch_array($attachs)) { if (!$attachment['build_thumbnail']) { $attachment['hasthumbnail'] = false; } $postattach["$attachment[attachmentid]"] = $attachment; } }