Log in

View Full Version : attachment count fixed... good stuff


TECK
04-15-2002, 12:40 AM
i'm glad firefly fix it. can you share with us what you did? i'm curious. thanks.

Admin
04-15-2002, 11:39 AM
In editpost.php:
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.