Version: 1.00, by rake
Developer Last Online: Oct 2012
Version: 2.3.x
Rating:
Released: 04-27-2003
Last Update: Never
Installs: 87
No support by the author.
Woo! Finally! I've been working on this for 10 straight hours now.
It's a replica of the vbulletin 3 attachment feature, which supports multiple uploads. We can't have vbulletin 3 yet, but at least we can copy it.
Files to edit: 5
Queries to run: 5
New Templates: 3
Just be sure to backup before trying anything.
You can see it live at my forums. Log in as test/test, if you want to see it in action.
And don't forget to click the Install button if you like the hack.
=-=-=-=-=-=-==-=-
UPDATE - Please re-download the file. Upgrading instructions are included in instructions.php. And sorry for the wait. I had to bribe my parents with 15 math exercises to let me use the computer. :knockedout:
=-=-=-=-=-=-=-==-
=-=-=-=-=-=-=-=-=-
SECOND UPDATE - Sorry for the previous non-functioning version, everyone. I did those modifications really late at night and some errors slipped in. This update fixes permission errors, allows you to specify a maximum number of attachments, fixes 65535 bytes error and includes repairing instructions for editpost.php
I have tested it on a clean 230 test board and it worked fine.
=-=-=-=-=-=-=-=-=-
=-=-=-=-=-=-=-=-=-=
THIRD REVISION - This update fixes the 3 largest errors reported so far:
1. The view image atachments option now works
2. Attaching more than one file with a new thread now works
3. Deleting a post with attachments now works
=-=-=-=-=-=-=-=-=-=
To everyone who used attachment.php from the old zip: Please replace it with your original one. attachment.php was added in the zip by mistake.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Today at 04:45 AM rake said this in Post #103 I'm glad to see it finally works.
Edit: Wow, great timing. :lick:
To fix the editing error:
Replace
if (trim($attachmentaction)=="delete") {
$attachmentsql=",attachmentid=0";
$DB_site->query("DELETE FROM attachment WHERE attachmentid=$postinfo[attachmentid]");
updatethreadcount($threadinfo[threadid]);
}
With
if (trim($attachmentaction)=="delete") {
$attachmentsql=",attachmentid=0";
$att = explode(",",$postinfo[attachmentid]);
foreach($att as $value) {
if(isset($qry)) {
$qry .= " OR attachmentid='$value'";
} else {
$qry = "attachmentid='$value'";
}
}this part
$DB_site->query("DELETE FROM attachment WHERE $qry");
updatethreadcount($threadinfo[threadid]);
}
thankz again rake...it finally works now......
but i use ur code above i got error when i take the red part than
it works.....if i find any problem i will report let u know.....thankz for the great hack....
Today at 06:48 PM iggy123 said this in Post #119 there is no need to get personal. I have followed your instructions to the T and it is happening. I will gladly send you the files - pre and post hack and you tell me where i am going wrong!!
Trust me, it is impossible to get that error with a clean, unhacked attachment.php. Furthermore, if you really followed my attachment.php edit earlier in this thread, that error would have disappeared.
Today at 09:06 PM Boofo said this in Post #124 Link, is the file from the first post allright to install now? All fixed and working even for old attachments?
Files are still getting cut off at 65535 bytes for me(I started over from scratch and reapplied the hack and also reuploaded the new newattachment.php and reuploaded my old attachment.php.)
Also when viewing multiple attachments it shows all the attachments as the first attachment... Example I upload 1.jpg 2.jpg 3.jpg and 4.jpg. When viewing the post it shows 1.jpg four times. When I edit the post it shows all four images listed in the manage list. Any ideas?
Today at 03:45 PM rake said this in Post #103 I'm glad to see it finally works.
Edit: Wow, great timing. :lick:
To fix the editing error:
Replace
if (trim($attachmentaction)=="delete") {
$attachmentsql=",attachmentid=0";
$DB_site->query("DELETE FROM attachment WHERE attachmentid=$postinfo[attachmentid]");
updatethreadcount($threadinfo[threadid]);
}
With
if (trim($attachmentaction)=="delete") {
$attachmentsql=",attachmentid=0";
Today at 02:22 AM 350Chevy said this in Post #128 Also when viewing multiple attachments it shows all the attachments as the first attachment... Example I upload 1.jpg 2.jpg 3.jpg and 4.jpg. When viewing the post it shows 1.jpg four times. When I edit the post it shows all four images listed in the manage list. Any ideas?
Ok.. I fixed that problem by going into the control panel and setting View Images -Do you wish to display attached images in the threads? Select no to just generate a link to download the image. to NO.
I'd rather have it set to YES but if this is all I can get for now then so be it..