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.
I also have a Moderator group that cannot see the picture she uploaded and when she clicks on the link, she gets a message saying she doesn't have permission to view this page.
Please, can someone work with me on this?
Oh, this was so simple, it's embarassing to even talk about.....I got it fixed. I knew it had to do with permissions somehow, but I thought it was more complicated than having the Profile set to YES to Show Images. Egads
rarg....i'm getting asn sql error when trying to delete a post with an attachment...
here is the lines....10 above and below in functions...
PHP Code:
// ###################### Start delete post #######################
function deletepost($postid,$countposts=1,$threadid=0) {
global $DB_site;
// decrement user post count
if ($postinfo=getpostinfo($postid)) {
if ($countposts) {
$storeadmin = $DB_site->query_first("SELECT newreply FROM storeadmin");
$storem=$storeadmin[newreply];
$DB_site->query("UPDATE user SET posts=posts-1,storep=storep-'$storem' WHERE userid='$postinfo[userid]'");
}
if ($postinfo['attachmentid']) {
// make sure you don't remove attachments still in use $att = explode(",",$postinfo[attachmentid]);
foreach($att as $value) {
if(isset($qry)) {
$qry .= " OR attachmentid='$value'";
} else {
$qry = "attachmentid='$value'";
}
}
$otherattachs=$DB_site->query("SELECT attachmentid FROM post WHERE $qry AND threadid<>'$postinfo[threadid]'");
if ($DB_site->num_rows($otherattachs)==0) {
$DB_site->query("DELETE FROM attachment WHERE $qry");
$DB_site->query("UPDATE thread SET attach = attach - 1 WHERE threadid = '$threadid'");
}
}
$DB_site->query("DELETE FROM post WHERE postid='$postid'");
}
}
The hack works fine, but when I try to "update counters", I get this error.
Quote:
Database error in vBulletin Control Panel 2.3.0:
Invalid SQL: UPDATE thread SET lastpost=1061935004,replycount=0,postusername='all star', postuserid='39', lastposter='allstar',attach= WHERE threadid=1563
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE threadid=1563' at line 1
mysql error number: 1064
I know it probably was my error, but the instructions were a little bit confusing considering the original hack and modification for "add attachment on edit post" were combined. Is there a way to fix this?
Alright I installed the vb3 Attachments hack a while back - the one that lets you post multiple attachments and such. Now I just installed this hack as well, and low and behold the two conflict with each other.
The thing is, old attachments work fine after I did that scan thing to them all, but when I try to post new attachments I get a bunch of errors:
Quote:
Warning: filesize(): Stat failed for /home/virtual/site4/fst/var/www/html/attachments/.file (errno=2 - No such file or directory) in /home/virtual/site4/fst/var/www/html/attachment.php on line 59
Warning: fopen(): Unable to access /home/virtual/site4/fst/var/www/html/attachments/.file in /home/virtual/site4/fst/var/www/html/attachment.php on line 60
Warning: fopen(/home/virtual/site4/fst/var/www/html/attachments/.file): failed to open stream: No such file or directory in /home/virtual/site4/fst/var/www/html/attachment.php on line 60
Warning: fread(): supplied argument is not a valid stream resource in /home/virtual/site4/fst/var/www/html/attachment.php on line 61
Warning: fclose(): supplied argument is not a valid stream resource in /home/virtual/site4/fst/var/www/html/attachment.php on line 62
Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site4/fst/var/www/html/attachment.php:59) in /home/virtual/site4/fst/var/www/html/attachment.php on line 68
Any thought as to getting the two hacks to integrate together? Or anyway to fix the problems im having?
The hack works fine, but when I try to "update counters", I get this error.
I know it probably was my error, but the instructions were a little bit confusing considering the original hack and modification for "add attachment on edit post" were combined. Is there a way to fix this?
i think u can sovled the problem here,take look the link