Version: 1.00, by Scott MacVicar
Developer Last Online: Mar 2016
Version: 2.2.x
Rating:
Released: 02-17-2002
Last Update: Never
Installs: 121
No support by the author.
Well after alot of time leaving it in the beta hacks forums without any problems, I'm now moving it to the Full Releases, I'm satisfied that there isn't any bugs that need to be addressed. Thanks to Jawelin he pointed out most of the mistakes through alot of his testing.
I've attached it as an installer file here, as it needs to make changes to the database. Two new rows to settings and a new column in the attachment table.
Scott
Updated some more
Note the > is missing off the bottom of the file after the ?, add it before trying to install
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
It would be nice if this functionality is included in the standard VB I mean put the attachment into an attachment directory (off the docroot), and perhaps some options as to whether it should use the real name (allowing / disallowing duplicates) or hashed version.
attachments into the DB is making the DB so big taking a long time to backup / restore it.
Looks like a great hack-i get all the way through to step one in functions php
then i crash when i add this
//we got this far, attachment passes the tests
//the file should now be in the directory lets simply insert the data into the database
$visible = iif($moderate,0,1);
$DB_site->query("INSERT INTO attachment (attachmentid,userid,dateline,filename,visible,has h) VALUES (NULL,$bbuserinfo[userid],".time().",'".addslashes($attachment_name)."','$v isible','$attachment_hash')");
$attachmentid=$DB_site->insert_id();
}
return $attachmentid;
}
// ###################### Start removeattachment #######################
function removeattachment ($attachmentid) {
global $DB_site,$attachpath;
$fileinfo = $DB_site->query_first("SELECT attachmentid, hash FROM attachment WHERE attachmentid='$attachmentid'");
$path = "$attachpath/$fileinfo[hash].file";
unlink($path);
}
Originally posted by mup_cow It would be nice if this functionality is included in the standard VB I mean put the attachment into an attachment directory (off the docroot), and perhaps some options as to whether it should use the real name (allowing / disallowing duplicates) or hashed version.
attachments into the DB is making the DB so big taking a long time to backup / restore it.
Sorry I hadn't got to the part where it imported the attachments from the table into the files.... hehehe it makes this hack sper duper cool
maverick your applying the patch wrongly, make sure that you are doing it correctly you should completely remove the accept_attachments function and then replace it with the ew one.
But I have a problem with the imported files, after installation every things work well. but when I checked the attachment folder I noticed there are a duplication in most of files, yes it has different name but there are 3 or 4 copy of each file, so is there any way to determine unused file and delete them to save the space
the files can't be the same, they wouldn't be able to exist as they would have been overwritten. The files may look the same as it uses a md5 hash to create it.