Here's the code I found it in in newreply. There are actually 2 places here that have that code. I should replace the first one?
Code:
case 'new':
if ($permissions['canpostattachment'] and trim($attachment) != 'none' and trim($attachment) != '' and trim($attachment_name) != '') {
$attachmentid = acceptupload(1);
$DB_site->query("
DELETE FROM attachment
WHERE attachmentid = $oldattachid
");
$postinfo = $DB_site->query_first("
SELECT attachmentid, filename FROM attachment
WHERE attachmentid = $attachmentid
");
}
break;
default:
$attachmentid = $oldattachid;
}
} elseif ($permissions['canpostattachment'] and trim($attachment) != 'none' and trim($attachment) != '' and trim($attachment_name) != '') {
$attachmentid = acceptupload(1);
$oldattachid = true;
$postinfo = $DB_site->query_first('
SELECT attachmentid, filename FROM attachment
WHERE attachmentid = '.intval($attachmentid).' AND visible = 0
');