In editpost.php:
Code:
if (trim($attachmentaction)=="new") {
// sort attachement
if (trim($attachment)!="none" and trim($attachment)!="" and trim($attachment_name)!="") {
$attachmentid=acceptupload($foruminfo[moderateattach]);
$attachmentsql=",attachmentid='$attachmentid'";
$downloadcount = $DB_site->query_first("SELECT counter FROM attachment WHERE attachmentid=$postinfo[attachmentid]");
$DB_site->query("UPDATE attachment SET counter=$downloadcount[counter] WHERE attachmentid=$attachmentid");
$DB_site->query("DELETE FROM attachment WHERE attachmentid=$postinfo[attachmentid]");
}
}
It might be easier to do this in another way but I was in a real hurry then.