View Full Version : Attachments as files
Scott MacVicar
02-17-2002, 10:00 PM
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
NitroSimSev
02-18-2002, 02:27 PM
Parse error: parse error in /www/nitrosim/forum/admin/attachment_install.php on line 345
Scott MacVicar
02-18-2002, 02:42 PM
did you upload in ascii mode?
Cause line 345 in the end tag ?>
:)
NitroSimSev
02-18-2002, 03:09 PM
Yup......Will re-upload it and try it again.
NitroSimSev
02-18-2002, 03:12 PM
Same error....
COMMAND:> STOR attachment_install.php
STATUS:> Connecting data socket...
150 Opening ASCII mode data connection for attachment_install.php.
STATUS:> Send successful
STATUS:> Time: 0:00:01, Efficiency: 20.51 KBytes/s (21005 bytes/s)
226 Transfer complete.
NitroSimSev
02-18-2002, 03:12 PM
what is line 345 and I will look at it.
Jawelin
02-18-2002, 04:18 PM
:D Thanks for quoting. ;)
Just an 'old user' question: is the attached installer the same than in Beta section (where it's vanished) ?
Thnx
MrLister
02-18-2002, 05:21 PM
To fix the problem above try removing any spaces and extra lines after ?>. haven't tried it yet, i'm not at my comp but that might work.
JJR512
02-18-2002, 07:50 PM
Question: In the file modifications part of the installation, we are told to search for a particular bit in the file editpost.php. In my editpost.php file, the bit to search for occurs two times. The second is about eight lines below the first. Should I add the new code above BOTH instances, or just the first, or just the second?
JJR512
02-18-2002, 08:15 PM
For the record, I put it above the FIRST instance only. I haven't tested that specific functionality yet, though.
Everything else worked fine. I didn't have any problems at all.
And I'm happy to report that in my database, the attachment table was reduced from 61.9MB to 88kB! Woohoo! :up: :)
Wolf42
02-19-2002, 10:10 AM
I added (like the instruction told) the line twice ;)
Worked perfectly! Thanks PPN! :D
Scott MacVicar
02-19-2002, 11:05 AM
do it twice, its the addition of the function which removes the attachment file.
NitroSimSev
02-19-2002, 12:17 PM
Ok the issue was of all things the ? didnt have the > after it. Question regarding the functions.php editing portion. The first step says to "REPLACE from that point to the end of the function with". When I do this step it crashes the functions.php any ideas?
Scott MacVicar
02-19-2002, 01:25 PM
define crashes?
you get a parse error?
if you want send me your functions.php to software@pp-network.com and I'll add that of the hack to your file and mail it back.
pdaGuy
02-19-2002, 03:31 PM
I tried to test this on my local site, on a Windows PC and I get this error...
Fatal error: Call to undefined function: cpheader() in c:\appserv\www\vbulletin\attachment_install.php on line 112
I get the same error on my live site too! Any ideas?
I also want to ask something else.
If everything goes well and I install this hack, will it be possible to upgrade to a new version of vBulletin in the future?
I mean, this hack edits the database! What will happen when vBulletin v3.x comes out??
Scott MacVicar
02-19-2002, 03:54 PM
move the file into the admin folder, it needs to check authorisation to make sure your an admin.
Scott MacVicar
02-19-2002, 03:56 PM
It will make upgrading to vB3 a problem as your attachments will be files but they will expect it to be in database, but I'll be rewriting the hack for v3 so there won't be a problem about upgrading. You upgrade as normal then apply the new version of the hack to make it work with 3.0
JJR512
02-19-2002, 05:36 PM
The instructions do NOT say to add that line twice. I have "Attachments as Files v1.0". In the section for "Changes to
editpost.php (1)", it says,
editpost.php
Step 1 of 1 FIND:
$DB_site->query("DELETE FROM attachment WHERE attachmentid=$postinfo[attachmentid]");
ABOVE that add
removeattachment($postinfo[attachmentid]);
And that's it.
OK, so I edited my file to put the new bit in twice, once in each spot.
Now some people have told me that they cannot see some of the attachments. I am not having that problem, even after clearing my browser cache, I can still see all attachments fine. I tried posting a new attachment, and I could also see that fine, too. So far, one other person has said he can also see it, while several people have told me they cannot see it. I don't understand this problem at all. How come some people can see attachments (whether post-hack or pre-hack), while some people cannot see any attachments?
Scott MacVicar
02-19-2002, 06:24 PM
have you tried to view the same attachment?
It could be a problem with the type of attachment that it was, though I doubt this as the only part that has been changed is where the content is taken from for the attachment. If the place it takes it from is empty then they would experience a problem. If not does their usergroup have permissions to view attachments?
I posted my problem about not being able to download attachments..(only the admin could). Did you ever get that problem. Or was it fixed? I may just restore a backup, and re-install anyway..
Scott MacVicar
02-19-2002, 08:55 PM
There is no code which is changed which would stop people from downloading attachments, did you make sure the usergroup had permission to view attachments?
JJR512
02-19-2002, 09:07 PM
Prior to installing this hack, all usergroups were able to download/view attachments. There wasn't a problem before this hack, only after it.
As I mentioned, there is so far only one other person, besides me, that can view attachments. There is another person in the same usergroup as that guy that has said he cannot. I don't think it's a usergroup-based problem.
I can view all the attachments that other people are not able to.
Same thing here.
I have checked and rechecked the user groups. tried numerous things. I am going to revert to an old attachments database, and reload all changed databases and re-install. I'll let you know what happens.
JJR512
02-19-2002, 09:26 PM
Update: As an unlogged-in visitor, I cannot view attachments.
JJR512
02-20-2002, 12:04 AM
You can see my attachment test thread, and the replies from all the people that can't see it and the two people (now two instead of one, besides me) that can see it: http://forums.jjr512.com/showthread.php?s=&threadid=29545
FYI: Doesn't work for me either.. :D Really weird if ya ask me.. hmmm
Aaow AnD wHiTe
02-20-2002, 11:17 AM
Thanx PPN :)
We would like to know if it would be possible to make something like an... attachments backup hack.
With this hack, you could save all your attachments as binaries without removing them from the database. It would be really usefull for us ^^
Thanx again ^^
I'm re-installing now. Last time (and this time), I found this:
VISABLE was not included in the string you wanted us to find.
if (!$attachmentinfo=$DB_site->query_first("SELECT filename,filedata,dateline,visible
FROM attachment
WHERE attachmentid='$attachmentid'")){
Instead of:
if (!$attachmentinfo=$DB_site->query_first("SELECT filename,filedata,dateline FROM attachment WHERE attachmentid='$attachmentid'")){
Do I replace what I found? Because when I look for the above line, it is not found..
Scott MacVicar
02-20-2002, 03:31 PM
Sean, this is for vB 2.2.2, the visible part was added as it was missing in 2.2.1
I'll do some testing then, I'll do some testin on my own boards where I implemented this hack.
I know for a fact that the attachments are there as I can view them via shell and ftp. So there must be an error in the top 30 lines or so.
Is everyone running 2.2.2?
Scott MacVicar
02-20-2002, 03:41 PM
Ok, I've worked out the problem now :)
sorry about all the problems.
Look for
if (!$attachmentinfo=$DB_site->query_first("SELECT filename,hash,dateline,visible FROM attachment WHERE attachmentid='$attachmentid'")){
Please ensure that visible is there in that list, this is super super important as if it isn't then only moderators and admins will be able to view it as they have permission to moderate attachments.
NitroSimSev
02-20-2002, 03:43 PM
Im running 2.2.2 but have not tried it since you sent me the functions.php
Well, we have found the problem. Thanks PPN! This hack rocks! :D
Scott MacVicar
02-20-2002, 07:38 PM
i'll just apologise some more, it was an oversight as I done this hack on 2.2.1 but the visible thing was a bug and was fixed in 2.2.2 and when i upgraded from 2.2.1 to 2.2.2 i just added visible on the end of the list and added that code so thats how I never noticed it.
Anyway i'll look into making an attachment backer upper. The simpliest way I guess would be to simply zip them all and I have some code to do that but you would need to have zlib installed so I can use the gzip functions.
JJR512
02-20-2002, 08:57 PM
Yep, it seems to be working fine now. :up:
Scott MacVicar
02-20-2002, 09:22 PM
goood :D
it is a stable release then lol
Attachment backer upper was scary though, the zip was quite hefty. I've added an option to either save it or download it.
JJR512
02-21-2002, 01:08 AM
Prior to installing this hack, using phpMyAdmin, I had it do a dump of just the attachments table, doing structure and data. It's past the point where it matters now, but that was good enough for a backup, right? Or does your backup addition do something else...
Scott MacVicar
02-21-2002, 06:21 AM
Yeah thats a backup, all the data and the structure.
You'll need to do it with this along with the files, though the attachment table should only be a couple of kb instead of mb.
Jawelin
02-21-2002, 07:41 AM
Originally posted by JJR512
Prior to installing this hack, using phpMyAdmin, I had it do a dump of just the attachments table, doing structure and data. It's past the point where it matters now, but that was good enough for a backup, right? Or does your backup addition do something else... I dumped only the attachment table just before applying the hack, using mysqldump for instance.
After the export to files, as you'll see, that table will remain the same as before.
After having successfully applied and verified all the hack, you can empty the filedata column of that table with a simple UPDATE by phpMyAdmin, then reOPTIMIZE the table and freeup a lot lot of space... :up:
Bye
Scott MacVicar
02-21-2002, 03:06 PM
I'm glad this is workin now and thanks for all your help Jawelin :)
Jawelin
02-21-2002, 03:48 PM
Do you thank me ? :)
Great work, simply!
P.S.: now you have to modify your sig.... ;)
Scott MacVicar
02-21-2002, 07:51 PM
yeah you done alot of help when it was in beta :)
I'll go modify my evergrowing sig
Wayne2k1.com
02-22-2002, 06:36 AM
Great.
Works perfectly :D
mvigod
02-23-2002, 05:16 PM
does this still work "as is" in 2.2.1 or do I need to take away that visible code?
I have so many hacks it would take forever to upgrade to 2.2.2 so I'm stuck at 2.2.1 until 3.0 maybe where alot of these hacks might already be in that version hopefully.
Would love to shrink my database with this hack.
Scott MacVicar
02-23-2002, 08:54 PM
you can leave the visible in, it won't have any effect on the hack just selecting it from the table.
If you want to upgrade from 2.2.1 to 2.2.2, I have posted a changes in all the files so you can upgrade to 2.2.2 just by applying all the changes instead of apply all the hacks again.
Destee
02-24-2002, 02:00 AM
Hello PPN ... it's not working for me. I've loaded/unloaded 4 times and can't see what I'm doing wrong. Let me start at the beginning ...
1. This is on a test forum (http://www.prettyblackgirl.com/forums/forumdisplay.php?forumid=76), upgraded to 2.2.2 fine. Then I installed the hack. First error I encountered was when I tried to run step 8, importer. I rec'd the following error(s):
Warning: Supplied argument is not a valid File-Handle resource in
/usr/local/plesk/apache/vhosts/prettyblackgirl.com/httpdocs/forums/admin/att
achment_install.php on line 333
Imported common1.jpg
I moved on because it's not (absolutely) necessary that those files be imported.
2. Uploaded a few files (.wav) successfully. They are in the newly created attachments directory, but when I try to view them I receive the following errors:
Warning: open_basedir restriction in effect. File is in wrong directory in
/usr/local/plesk/apache/vhosts/prettyblackgirl.com/httpdocs/forums/attachment.php on line 61
Warning: fopen("/usr/local/plesk/apache/vhosts/prettyblackgirl.com/attachments/8f3f831e0564790a88584703c352883f.file","rb") - Operation not permitted in /usr/local/plesk/apache/vhosts/prettyblackgirl.com/httpdocs/forums/attachment.php on line 61
Warning: Supplied argument is not a valid File-Handle resource in /usr/local/plesk/apache/vhosts/prettyblackgirl.com/httpdocs/forums/attachment.php on line 62
Warning: Supplied argument is not a valid File-Handle resource in /usr/local/plesk/apache/vhosts/prettyblackgirl.com/httpdocs/forums/attachment.php on line 63
Warning: Cannot add header information - headers already sent by (output started at /usr/local/plesk/apache/vhosts/prettyblackgirl.com/httpdocs/forums/attachment.php:61) in /usr/local/plesk/apache/vhosts/prettyblackgirl.com/httpdocs/forums/attachment.php on line 64
Warning: Cannot add header information - headers already sent by (output started at /usr/local/plesk/apache/vhosts/prettyblackgirl.com/httpdocs/forums/attachment.php:61) in /usr/local/plesk/apache/vhosts/prettyblackgirl.com/httpdocs/forums/attachment.php on line 65
Warning: Cannot add header information - headers already sent by (output started at /usr/local/plesk/apache/vhosts/prettyblackgirl.com/httpdocs/forums/attachment.php:61) in /usr/local/plesk/apache/vhosts/prettyblackgirl.com/httpdocs/forums/attachment.php on line 66
Warning: Cannot add header information - headers already sent by (output started at /usr/local/plesk/apache/vhosts/prettyblackgirl.com/httpdocs/forums/attachment.php:61) in /usr/local/plesk/apache/vhosts/prettyblackgirl.com/httpdocs/forums/attachment.php on line 67
Warning: Cannot add header information - headers already sent by (output started at /usr/local/plesk/apache/vhosts/prettyblackgirl.com/httpdocs/forums/attachment.php:61) in /usr/local/plesk/apache/vhosts/prettyblackgirl.com/httpdocs/forums/attachment.php on line 68
Warning: Cannot add header information - headers already sent by (output started at /usr/local/plesk/apache/vhosts/prettyblackgirl.com/httpdocs/forums/attachment.php:61) in /usr/local/plesk/apache/vhosts/prettyblackgirl.com/httpdocs/forums/attachment.php on line 80
These errors are given even when trying to view attachments that were in the forum prior to installing the hack.
3. I am able to upload .wav files but not .gif or .jpg. I was able to upload/view all attachments prior to installing the hack. When I try to upload a .gif or .jpg I get the following error:
The uploaded file is not a valid GIF or JPG file. Please ensure that it is and try again.
Like I said above, I've went through the process a few times but the errors remain. I'm running Plesk and the errors above are similar to some seen in the past and corrected (http://forum.plesk.com/showthread.php?s=&threadid=447) back then too.
Any suggestions?
Thanks,
Destee
Vivi Ornitier
02-24-2002, 05:16 AM
ummm .. . can someone PLEASE upload like a text file with the SQL Queries in it cause the php file gets this parse error in line 344 and i'm not too good with php
Line 344:
echo "</table>\n";
echo "<br><br>\n";
echo gotostep(6,0,1);
}
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
It's the line between the } and the //@@@@@...
So yea, can somone please upload a text file of some sort? unless u can help me fix this error, i'm on 2.2.2
Scott MacVicar
02-24-2002, 07:57 AM
Your problem with being unable to view files it due to the way your php is configured, I'll look into a solution for it now. The problem is simply that the script doesn't have permissions to read a file from a different directory.
Did you go to the admin panel and set the folder where attachments are to be stored and give it 666 permissions?
Destee
02-24-2002, 04:06 PM
Hi PPN ... the answer above is for me, right? :) Thanks for responding. Yes the attachments path is in the CP. I had originally set the folder to chmod 777 but changed it to 666 after reading the above ... and am still receiving the errors.
Destee
Vivi Ornitier
02-24-2002, 04:54 PM
which folder is attachments suppose to be stored? I don't see any folder in the FTP.
Destee
02-24-2002, 06:14 PM
Vivi ... hope this helps ...create a directory below your document root, if you can, this means if you login to ftp and you see a httpdocs, wwwroot, www or public_html folder this is below document root. Create a directory here and give it 777 permisions if you are on a unix server. You can call the folder whatever you want, i simply called it attachments. If you have to place it above document root then give it an obscure name such as att4chm3nt5.
Vivi Ornitier
02-24-2002, 06:41 PM
okay, u've confused me even more now with the wwwroot and whatnot but thanx anyway. I just created a folder called attachments in my forums folder, like forums/attachments/ and chmoded to 777, is that wat ur suppose to do? I dont' see any httpdocs, wwwroot, www or public_html folders. I MUST have this hack!
Destee
02-24-2002, 08:45 PM
Vivi ... the quote above comes directly from PPN's install file, didn't mean to confuse you more. I suppose creating forums/attachments will work but notice in the quote above we're advised to give the directory a more obscure name (if going that way). I'm hardly an expert at this and am having a few problems getting this hack to work myself. Perhaps someone else may be able to give you more helpful support. Good Luck.
Destee
Vivi Ornitier
02-24-2002, 10:55 PM
the thing is it won't even run period, all i want is someone to write like a text file of the hack with like the mysql queries in it so it makes my life all the much easier! :D
Destee
02-26-2002, 06:54 PM
Hi PPN ... I don't mean to be a pest ... but any progress on how I can resolve my issues (https://vborg.vbsupport.ru/showthread.php?postid=222928#post222928) with this hack?
Thanks,
Destee
Scott MacVicar
02-26-2002, 07:13 PM
Destee, i've looked over the hack and the only thing which will return those problems are that the directory itself doesn't exist, ie you have the path wrong, or php doesn't have access to that folder, in other words that the users are different.
Destee
02-26-2002, 07:32 PM
Oh Boy! Oh Boy! Oh Boy! :D Thank You PPN for directing me in the right way! It's working now! The problem was exactly as you described, php didn't have access to that folder! I moved my "attachments" folder to the root directory and everything is working properly now!!!! Oh Boy! Thank You! :)
Destee
ps ... I just went back and did the import step included in this hack and it worked too ... with no errors! Thanks again! :)
Scott MacVicar
02-26-2002, 08:30 PM
no problem :P
Sorry it took so long, it was just a rather odd error :)
Scott MacVicar
02-26-2002, 08:31 PM
If you are having an error uploading the attachment_install.php file then please do the following, check that you uploaded the file in ASCII and that ?> is at the end of the file. Its been clipped for some people.
Vivi Ornitier
02-26-2002, 09:03 PM
YAYAYAYA it works!! that's all u needed to write actually! ?>
Scott MacVicar
02-26-2002, 09:32 PM
for some reason it shows on mine though, thats now 3 people that have had the end tag clipped from the file.
mup_cow
02-27-2002, 08:59 PM
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.
mup_cow
02-27-2002, 09:23 PM
Is there a hack to extract all the existing attachment from db into files ?
maverick1236
02-28-2002, 12:50 AM
test
maverick1236
02-28-2002, 12:54 AM
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)."','$visible','$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);
}
any ideas why this crashes my board?
tx! :D
mup_cow
02-28-2002, 06:35 AM
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
48MB -> 84KB :) Thanks for making this hack!!!
maverick1236
02-28-2002, 09:34 AM
BUMP
Scott MacVicar
02-28-2002, 01:59 PM
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.
maverick1236
03-01-2002, 09:36 PM
this hack wouldnt work for me
in fact it TOTALLY screwed my board up-and i am quite experienced at applying hacks
ive uninstalled the hack-and am using vb default php files
and guess what?-my attachments dont show---period.
nothing shows
now people think they are uploading an attachment-and no errors occur-but no file either-so they post 3 times trying to upload it-and NOTHING
i dont get it-how could such a simple hack do so much damage
:mad: :( :mad: :(
Linux
03-02-2002, 07:40 PM
Hi, thanks for this hack it is a rock
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
Scott MacVicar
03-02-2002, 09:06 PM
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.
mvigod
03-02-2002, 09:16 PM
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.
I second this idea....my database is growing like a beast. Just 35MB's w/out the attachment table and 200MB with it. It is now growing at 2MB-4MB per day! The option to break off attachments would be great. I am working on a backup that will save all tables minus attachments and uneccesary index tables that can be rebuilt if needed. Downside is if disaster strikes all attachments are gonzo.
HeadStAtE!
03-04-2002, 04:29 PM
Thanks for the hack.
It was fairly painless to install and works great!
Aaow AnD wHiTe
03-05-2002, 09:41 AM
We're a little bit confused :S So it finally can just do a backup of the attachments withour removing them from the database, just so we can have the binaries from the DB?
Thx for your hard work, PPN :)
Scott MacVicar
03-05-2002, 03:01 PM
once you have imported the attachments to files you can simply drop the filedata column and this will reduce your attachments table to kb instead of mb. Though you will have to remember to backup the attachments folder on your server every once and a while. I simply gzip it then download it to another server, cause then i get about 2mbps.
With database backups you still need to include the attachments table as this holds the file hashes and other stuff, just it won't be so large.
Aaow AnD wHiTe
03-05-2002, 03:23 PM
Uhm... that's not what we mean. We'll try again :)
At this moment, what we want to do is just to have our attachments as binaries in another folder, without changing anything to the way vB stores attachments and without removing them from the DB. Just like a big backup of all the attachments.
Hope you understand us now :__ )
Scott MacVicar
03-05-2002, 04:22 PM
hmm i guess i'll do this and release it as a hack, would be kinda useful will be back in about 15mins with this done :D
Gamingforce
03-05-2002, 07:35 PM
Hi, I am trying to import my files but I get the following error:
Warning: Supplied argument is not a valid File-Handle in ../attachment_install.php on line 333.
I am running vBulletin 2.2.0. Thanks!
Scott MacVicar
03-05-2002, 09:40 PM
did you set the attachment path in the settings part of the control panel, chmod the folder to 666 and check that the script user is the same as the folder, ie. same linux user.
Gamingforce
03-06-2002, 01:32 AM
Yes, I set all of those however I remember trying out this hack originally when it first came out in beta. For some reason I have two file path fields in the admin options section. Could that be causing the problem? When I tried it out today, I put both fields with the correct path just to be sure.
mojotim
03-06-2002, 09:46 AM
Nice one, thanks!
mojotim
03-07-2002, 09:43 AM
Hi, any updated instruction for the /admin/functions.php with vBulletin 2.2.3?
Scott MacVicar
03-07-2002, 02:52 PM
Is the hack not working with vBulletin 2.2.3?
I haven't had a chance to look at 2.2.3 in any detail yet, John released this at a wierd time for someone who lives in the UK.
Destee
03-12-2002, 10:38 PM
2.2.4 and all is well PPN! :)
thewiz
03-15-2002, 06:33 PM
Hi
I have 2.2.4 and I do the whole install fine but when I get to the importer this is the error.
Warning: Supplied argument is not a valid File-Handle resource in /home/virtual/site9/fst/var/www/html/forum/admin/attachment_install.php on line 333
Imported makoact11.zip
on all my files it does not import anything.
Armando
Scott MacVicar
03-15-2002, 08:34 PM
either your folder permissions are wrong, did you create the folder?
Did you set the path to this folder within the vBulletin options?
Check these and get back to me.
thewiz
03-15-2002, 10:05 PM
The way the server was setup the path to the folder was incorrect now I got it all working. I have another Question I saw today in another forum at www.dssarea51.com/forum this was a nice feature you know when you have alot of Mods in your board how it extends the forum display they had a drop down list for the mods to keep the forum display not so wide. do you know how they did that.
Thanks for the help on the other issue
Armando
Tim Wheatley
03-18-2002, 06:23 PM
Yes there's a hack for that, go to 'search' above and search for moderators drop down list.
waddy
03-19-2002, 01:32 PM
The Hack works Great on 2.2.4
Fantastic Hack , thanks PPN
Couple of Questions :
You say drop the filedata table - would it be ok just to "empty" the Attachments Table.
If I delete a thread with an attachment - does it remove the attachment from my Attachment Folder ?
Scott MacVicar
03-19-2002, 06:35 PM
Don't empty the attachments table, this is needed as it holds the attachment id and the file hash. You *MUST* drop the filedata column that is the only way.
If you delete a thread or delete an attachment while editing it will also remove it from the attachment folder.
waddy
03-19-2002, 10:09 PM
Ok thanks PPN
What the SQL query to drop that table please
kidney
03-19-2002, 11:34 PM
I seem llike I can't upload anything anymore, Can anyone help!!
I re-applied the hack, and still no result.....
I'm running a heavelly hacked 2.2.3.
I can send you my function.php files if required.
Freddie Bingham
03-20-2002, 02:57 AM
ALTER TABLE attachment DROP filedata
..if I was you I wouldn't do that though as that can only cause you problems when you upgrade to v3.0
This would be better:
UPDATE attachment SET filedata = ''
waddy
03-20-2002, 10:23 AM
Thanks Freddie,
I was concerned about dropping the filedata column = issues on future updates.
I hope v 3.0 has Attachments as files. My database has never run better since I did this hack.
Freddie Bingham
03-20-2002, 02:24 PM
It might give you the option to choose at your whim ;)
NitroSimSev
03-20-2002, 03:10 PM
PPN - I am currently running PHP portals and I am trying to get the attachment mod to work with a news program. Below is a block of code I would like to modify to get it to work. right now the images do not show up:
function centerblocks_topstories_block($row) {
include("config.php");
global $DB_site,$dateformat,$bburl;
$result=$DB_site->query("SELECT dateline,title,threadid FROM thread WHERE forumid=$topStoryForum ORDER BY dateline DESC LIMIT $topStoryNum");
$cc=1;
while ($topStory=$DB_site->fetch_array($result)) {
$postdate{$cc}=vbdate($dateformat,$topStory[dateline]);
$topStoryTitle{$cc}=$topStory[title];
$topStoryID{$cc}=$topStory[threadid];
$result1=$DB_site->query("SELECT pagetext,postid FROM post WHERE threadid=$topStory[threadid]");
$postinfo=$DB_site->fetch_array($result1);
$topStoryTeaser{$cc}=$postinfo[pagetext];
$topStoryImage{$cc}="$bburl/attachment.php?s=&postid=$postinfo[postid]";
The
$topStoryImage{$cc}="$bburl/attachment.php?s=&postid=$postinfo[postid]";
is the part of code I cant seem to get to work right. Any Ideas?
waddy
03-23-2002, 08:34 AM
BUG ? : When Editing or Delelting a thread with an attachment i am now getting this in the header of the page
Warning: Unlink failed (No such file or directory) in /users/waddy/www.xp-erience.org/forum/admin/functions.php on line 1696
ALSO :
One of my users is uploading an attachment, yet when we try to view the image we get this error
Warning: stat failed for /users/waddy/attchvb/958a09ca32b93cb743bf90ce001d58c0.file (errno=2 - No such file or directory) in /users/waddy/www.xp-erience.org/forum/attachment.php on line 60
HellRazor
03-23-2002, 07:46 PM
The only problem I am having is that once you select the file for uploading, the "Use Custom Avatar?" radio button turns off. People often miss that, and what happens is the avatar defaults to the first avatar in the normal list.
Is there any way to make this default to "use custom avatar" when a file is uploaded?
Wayne2k1.com
03-27-2002, 10:17 AM
Originally posted by HellRazor
The only problem I am having is that once you select the file for uploading, the "Use Custom Avatar?" radio button turns off. People often miss that, and what happens is the avatar defaults to the first avatar in the normal list.
Is there any way to make this default to "use custom avatar" when a file is uploaded?
Same problem 4 me...
Scott MacVicar
03-27-2002, 03:39 PM
I'll look into this now, I presume that the avatar upload uses the accept_upload function within the admin panel and it might require a bit of editing.
xware
03-27-2002, 06:04 PM
Originally posted by HellRazor
The only problem I am having is that once you select the file for uploading, the "Use Custom Avatar?" radio button turns off. People often miss that, and what happens is the avatar defaults to the first avatar in the normal list.
Is there any way to make this default to "use custom avatar" when a file is uploaded?
Same to me.
IS a bug? :eek:
Renegade
03-27-2002, 09:11 PM
I think I will wait until everything is resolved....
Scott MacVicar
03-27-2002, 10:52 PM
This has nothin to do with my hack, i've just checked and it looks like this before my hack is installed.
jardragon901
03-28-2002, 10:58 AM
hmm the instalation went fine, except whenever I try to upload anything it keeps giving me an invalid extension error. its a test board on XP, bb 2.2.4 anything i should check?
I also have it on a different disk than c: do I have to add the drive letter? also do I use "/" or "\" for the path?
Cocomiel
03-30-2002, 04:50 AM
Originally posted by xware
Same to me.
IS a bug? :eek:
Seems to be a bug in vb 2.2.4 : Edit modifyavatar_custom template and remove the following code:
<script language="Javascript">
<!--
function checkCustom(formname) {
formname.avatarid[1].checked=true;
}
//-->
</script>
waddy
03-31-2002, 10:20 AM
WTF !
why has this thread gone to "My avatar doesnt work" ?
whos moderating here ?
I have legit bugs with this HACK, that the thread is about, and they are going on about avatars - eh ?
MIKdoubleE
03-31-2002, 11:11 PM
I'm getting this parse error:
Parse error: parse error in /home/hiphopfu/public_html/forums/admin/attachment_install.php on line 345
Can i know exactly what to do??? I'm a newbie to MySQL and VB so i dont know much.
waddy
04-01-2002, 07:25 AM
This only happens with about 4 /10 - The attachment is in the thread - People go to view it
And you get this error :
Warning: stat failed for /users/waddy/attchvb/0c4913343c10e31b4157235047602ccf.file (errno=2 - No such file or directory) in /users/waddy/www.xp-erience.org/forum/attachment.php on line 60
Warning: fopen("/users/waddy/attchvb/0c4913343c10e31b4157235047602ccf.file", "rb") - No such file or directory in /users/waddy/www.xp-erience.org/forum/attachment.php on line 61
Warning: Supplied argument is not a valid File-Handle resource in /users/waddy/www.xp-erience.org/forum/attachment.php on line 62
Warning: Supplied argument is not a valid File-Handle resource in /users/waddy/www.xp-erience.org/forum/attachment.php on line 63
Warning: Cannot add header information - headers already sent by (output started at /users/waddy/www.xp-erience.org/forum/attachment.php:60) in /users/waddy/www.xp-erience.org/forum/attachment.php on line 64
Warning: Cannot add header information - headers already sent by (output started at /users/waddy/www.xp-erience.org/forum/attachment.php:60) in /users/waddy/www.xp-erience.org/forum/attachment.php on line 65
Warning: Cannot add header information - headers already sent by (output started at /users/waddy/www.xp-erience.org/forum/attachment.php:60) in /users/waddy/www.xp-erience.org/forum/attachment.php on line 66
Warning: Cannot add header information - headers already sent by (output started at /users/waddy/www.xp-erience.org/forum/attachment.php:60) in /users/waddy/www.xp-erience.org/forum/attachment.php on line 67
Warning: Cannot add header information - headers already sent by (output started at /users/waddy/www.xp-erience.org/forum/attachment.php:60) in /users/waddy/www.xp-erience.org/forum/attachment.php on line 68
Warning: Cannot add header information - headers already sent by (output started at /users/waddy/www.xp-erience.org/forum/attachment.php:60) in /users/waddy/www.xp-erience.org/forum/attachment.php on line 74
Scott MacVicar
04-01-2002, 07:53 AM
This only happens if the file doesn't exist, was it removed or is the disk space allotment for your account full?
MIKdoubleE
04-02-2002, 12:26 AM
Yeah, i figured it out......but heres a question, is there anyway, i can change the url on the attachment....i mean, like my board is hosted on my server, www.hiphopfuture.com and i was wondering if i can tweak the hack and point the attachment uploads to another server. To save space on mine.....any way?????
just upgraded to 224 and installed this hack. install went well and files were properly exported to the new dir. old attachments display properly. problem is, I can't upload any longer. :(
New uploads aren't saved in the dir, but at least the db info gets stored properly. Anyone else with this problem?
stored correctly
attachmentid userid dateline filename visible counter
stored incorrectly
filedata hash
hash is blank
filedata should be blank but instead says GIF89a? (note the one ")
sorry, my bad
forgot to upload admin/functions.php
opps
thanks!! works great
MIKdoubleE
04-03-2002, 02:58 AM
Originally posted by MIKdoubleE
Yeah, i figured it out......but heres a question, is there anyway, i can change the url on the attachment....i mean, like my board is hosted on my server, www.hiphopfuture.com and i was wondering if i can tweak the hack and point the attachment uploads to another server. To save space on mine.....any way?????
HELLO!! is there any support for this hack?????!!!!!!!
Freddie Bingham
04-03-2002, 03:05 PM
No.
Ninth Dimension
04-03-2002, 03:45 PM
I've just installed this hack, and so far I can't see any problems with it, apart from .png files, they either don't upload at all, or they don't display correctly. has anyone else seen this at all?
Scott MacVicar
04-03-2002, 06:49 PM
I've not noticed the problem with png files, though support for this was only added in 2.2.2 in attachment.php are you running 2.2.2 or later?
Mike if you don't have space for attachments on your server dont turn them on, simple as that!
Ninth Dimension
04-03-2002, 07:08 PM
I'm running vB 2.2.4, it could have just been the file I was using to test it with, but it should not be a huge problem or anything like that :)
Scott MacVicar
04-03-2002, 07:16 PM
at the bottom of attachment.php it should have
elseif ($extension=="png") {
header("Content-type: image/png");
}
as part of the check for image type.
Ninth Dimension
04-03-2002, 07:24 PM
Yup, it's got that, oh well
Oh, a quick word of warning, when I downloaded the file earlier today, you have not got the ?> at the end of the file, I added it myself and it worked fine, but you might wanna re-upload the file :)
waddy
04-03-2002, 10:05 PM
This only happens if the file doesn't exist, was it removed or is the disk space allotment for your account full?
Ive got tons of space and the files in question have not been deleted.
The forum says there is a file attached- when you click on the attachment to view it - you get this
http://www.xp-erience.org/forum/showthread.php?s=&threadid=7730
its driving me insane !
hypedave
04-12-2002, 01:01 AM
I just installed this hack, and now when upload attachments, I get the followig errors
Warning: Unable to create '/images/temp/89ce924a310f80c7e6a83893410f7ded.file': No such file or directory in C:\Inetpub\wwwroot\forums\admin\functions.php on line 1705
Warning: Unable to move 'C:\WINNT\TEMP\php6A9.tmp' to '/images/temp/89ce924a310f80c7e6a83893410f7ded.file' in C:\Inetpub\wwwroot\forums\admin\functions.php on line 1705
camikazi2k
04-12-2002, 02:07 AM
i didnt read through all the thread but there is problem with the FIRST THREAD the file
look at the end there is only ?
and u said it's the end of file so it should be
?>
thats why people getting error line 345 :)
take care
and thanks for the hack
kreftt
04-12-2002, 05:26 PM
EDIT: my bad
Scott MacVicar
04-13-2002, 11:03 PM
can you paste the error message and I'll have a little test tonight of the hack. I think this is possibly a problem with the coding in attachment.php
waddy
04-18-2002, 02:53 PM
Running on 2.2.5
It actually works better :)
I havent had any errors at all so far
jjj0923
04-18-2002, 06:48 PM
is there anything in hack this to stop someone from uploading a php file with <?php phpinfo(); ?> in it and then running it on your servers?
Jawelin
04-18-2002, 07:32 PM
How could an attachment be run ?
Scott MacVicar
04-18-2002, 07:47 PM
the file is stored, as a md5 hash so they wont even know the file name, if you place it below document root they can't run it in the browser and even if it was above root and they did know the name, it would be parsed by apache as the extension would be .file
All appropriate security measures that I could think of were used.
eoc_Jason
04-19-2002, 02:04 AM
Just installed it on my forum.... very easy to do, looks like it is working just fine....
:bunny:
Just wondering, is this hack compatible with the https://vborg.vbsupport.ru/showthread.php?s=&threadid=33676 ( Add Attachment on Edit Post? I haven't tried it out yet, but I'm guessing it should be okay.
Scott MacVicar
04-19-2002, 07:32 AM
yeah it should work with any hack though when it tries to remove the attachment on edit you will have to add the removeattachment function above it to remove the actual file.
Raptor
04-23-2002, 10:43 AM
i had to drop my filedata table as the user set attachment filedata=''; simply didnt do anything
what is the query to add the filedata table back to the DB (for future upgrades )
Scott MacVicar
04-23-2002, 03:26 PM
it should have been
UPDATE attachment SET filedata=''
Thanks Allot,
This was my first hack install, and it works great on 2.2.5.
I love it :bandit:
Reeve of shinra
05-07-2002, 11:17 PM
I am curious about having the attachments upload to another server... its not nessasarilly a space problem as a bandwidth one.
I have a problem :nervous:
The hack works great except for one thing, When I try to attach a file that is bigger than what I have the max file size set for. I get the vb error that the attachment is to large, but the file stays in my attachments directory. It is not added to the database or anything else.
All the other errors work fine like invalid extension. If I get one of the other vb errors the file is deleted.
Thanks,
Scott MacVicar
05-08-2002, 03:32 PM
open up /admin/functions.php
check that under
eval("standarderror(\"".gettemplate("error_attachtoobig")."\");");
you have
unlink($attachment);
Yep its there
$filesize=filesize($attachment);
if ($maxattachsize!=0 and $filesize>$maxattachsize) {
// too big!
eval("standarderror(\"".gettemplate("error_attachtoobig")."\");");
unlink($attachment);
exit;
}
Everything is working except the unlink, which I don't understand because it works fine with the rest of the errors :confused:
Scott MacVicar
05-08-2002, 03:47 PM
wierd, its working on my board and even wierder that it works for the rest of the errors.
I going to try a reinstall and see what happens.
I reinstalled, but I'm still having the same problem :(
Does anyone have any idea of what could be causing this, I'm desperate.
wooolF[RM]
05-12-2002, 11:15 AM
]227 Entering Passive Mode (213,239,150,20,238,22).
STOR /home/wooolf/WWW/forum/admin/attachment_install.php
150 Opening ASCII mode data connection for /home/wooolf/WWW/forum/admin/attachment_install.php
226 Transfer complete.
Transferred 21.021 bytes in 0,22 seconds (93,74 KB/s)
Queue completed; transferred 21.021 bytes in 2,41 seconds (8,53 KB/s)
Parse error: parse error in /home/wooolf/WWW/forum/admin/attachment_install.php on line 345
damnit :(
vBB 2.2.4 here...
Scott MacVicar
05-12-2002, 11:18 AM
the
?> is missing off the bottom of the file add it
it keeps getting cut when i try to adjust the attachment.
wooolF[RM]
05-12-2002, 11:25 AM
thank you very much...
I tried to read the whole thread through, and I seen people have problems with it, but i didn't found a solution. Maybe you should put it in the first post
Scott MacVicar
05-12-2002, 11:28 AM
I did after the first time you posted in nice bold letters, hopefully people will notice it.
wooolF[RM]
05-12-2002, 11:32 AM
]actually it's only > missing...
? is there on line 345
wooolF[RM]
05-12-2002, 12:59 PM
]installed / clicked on install / voted
worked like a charm :D thanx
Scott MacVicar
05-12-2002, 01:00 PM
cool, i've got a importer almost finished, to import the files back into the mysql database, in case you change your mind, but who would want to do that? ;)
wooolF[RM]
05-12-2002, 01:05 PM
]nobody! :D free MySQL! :D
Mone'
05-29-2002, 04:24 PM
Installed in vb 2.2.6 without a glitch !
Great hack PPN i really like it ;)
hack is working 99.9% =)
why 99.9%?
because i found that if you upload a file and after you edit the post and choose upload a new file you wont be able to remove the old one from the attachment folder anymore...
Is this a bug that can be solved?
Please let me know.
thankyou
Mone'
Scott MacVicar
05-29-2002, 07:51 PM
The code in editpost.php appears twice i only mentioned it once
so add
removeattachment($postinfo[attachmentid]);
above the 2nd time
$DB_site->query("DELETE FROM attachment WHERE attachmentid=$postinfo[attachmentid]");
appears
Mone'
05-30-2002, 01:29 AM
i knew it !
i saw the code twice but the installer mentined only 1 step
so i added to the first line only :))
thank you and great hack
now is working 100% on vb 2.2.6 !
Mone'
Boofo
06-01-2002, 12:08 AM
Thanks for all of the help, Scott. It's working great! :)
I do have one problem though...I also have the attachment editor hack installed and now for some reason when I go to edit a txt file, the editing box is blank. Nothing in it, but when I go to view it, everything is there. Any ideas on this one?
Scott MacVicar
06-05-2002, 12:20 PM
Here is the updated file from the zip, it is backwards compatible anyway, so if you decide to go back to the database the hack will still work. I'll see if chen can update his hack with this file later today.
The only real changes is the bits to add to misc.php so i'll just post this as an attachment.
Boofo
06-05-2002, 12:34 PM
Thanks, Scott! I'll have to re-install it again. I took it out when it messed with the attachment editor. When I re-install it, do I just ingore the part in the install php file about the misc.php file then and just do it with the attachment file you posted here?
Originally posted by PPN
Here is the updated file from the zip, it is backwards compatible anyway, so if you decide to go back to the database the hack will still work. I'll see if chen can update his hack with this file later today.
The only real changes is the bits to add to misc.php so i'll just post this as an attachment.
Scott MacVicar
06-05-2002, 03:38 PM
yep use the one i posted instead of the one in the zip and i sent chen a copy too.
Boofo
06-05-2002, 03:50 PM
Sorry to sound dense here, but the file I have is the attachment_install.php. Is there a zip out too that I missed?
Originally posted by PPN
yep use the one i posted instead of the one in the zip and i sent chen a copy too.
Scott MacVicar
06-05-2002, 03:59 PM
I meant FireFly's attachment editor hack, has a zip with that text file in it. Use mine instead of his.
Boofo
06-05-2002, 06:06 PM
Well, Scott, I re-installed your hack and I wanted to let you know that everything is working as it should be so far. The attachment editor now works with your great hack. Thank you very much for all of your help and the fix for the misc.php file. I really appreciate you working to get the editor to work with it. Not many authors would do all that you did here. This is the kind of support that makes a great hack! Thanks again! :):):) You bees the man!!! :)
Oxygen
06-06-2002, 07:18 PM
Two small questions...
Attachment as files works almost wonderfully.
Is there a size limit to the file size?
as no matter what the attachment size number is set too (20971520 which should be 20 megs) when I upload a file that is above ~3 megs (I am not sure the exact number) it does not upload the file.
also it does not promp when the file is too large.
What would be the easiest way to update to v2.2.6 from 2.2.5
while keeping attachment as files?
Thanks
Scott MacVicar
06-06-2002, 07:40 PM
You just need to re-apply the code i guess. 2.2.6 is a big update so u cant really only upload some files and not the others.
Alot of people are having the problem with attachments, Im not too sure what is causing the problem.
You realise there is a max upload size in php as well to stop too large files being uploaded, you can check this in phpinfo();
Jawelin
06-08-2002, 01:08 PM
Hi, Scott.
I read about the update, and while I'm upgrading my hacked 2.2.5 I noticed something about your hack.
JFYI in the final 2.2.6 version, there's some moved code within function.php (attachment delete), but it isn't to difficult to manage the differences from your instruction.
Thanks for the misc.php update, btw.
Scott MacVicar
06-08-2002, 09:31 PM
Will update the code when i get back from my 2 week vacation. :)
Jawelin
06-09-2002, 08:44 AM
Have nice holidays.... :D
Finally got arround to installing this.
DB size before 234Meg
DB size after 98Meg
Great hack. Did just what I was looking for.
Courage
06-18-2002, 11:18 PM
I really nned this hack :@
I'm running vb 2.2.2 and I get this nasty error when I try to run the installer (on the first step)
Database error in vBulletin Control Panel 2.2.2:
Invalid SQL: ALTER TABLE `attachment` ADD `hash` VARCHAR(32) NOT NULL
mysql error: Lost connection to MySQL server during query
mysql error number: 2013
Date: Wednesday 19th of June 2002 03:08:30 AM
Script: http://www.softnews.ro/forum/forum/admin/attachment_install.php?s=&step=3
Referer: http://www.softnews.ro/forum/admin/attachment_install.php?
I have a lot of hacks installed...
This is the problem ? :(
Please HELP !!!
eoc_Jason
06-23-2002, 05:22 AM
Just a thought, you might want to have some "upgrade" instructions. I accidently clicked the remove one thinking I could convert back from files to DB, but instead it just wiped out my hashes (ACK!), maybe have a confirm on what is about to happen?
But anyhow, It would be helpful if you could do a "upgrade" choice which would just re-display the code that is needed but not do any other stuff. :)
Tigger9969
06-24-2002, 10:40 PM
Here is my problem:
We're running vb2.2.6. We have no problem uploading files smaller than 2MB, other than it takes a REALLY long time.
We are not using safe mode.
When we try to upload a file larger, after a really long time the message is posted but the file attachement is not there.
Does anyone know why? Any help will be greatly appreciated.
Tigger9969
Boofo
07-04-2002, 11:31 PM
The default value for PHP is 2 meg. You can change that limit size in the php.ini file on the server. You will probably have to talk to your ISP about that. :)
Originally posted by Tigger9969
Here is my problem:
We're running vb2.2.6. We have no problem uploading files smaller than 2MB, other than it takes a REALLY long time.
We are not using safe mode.
When we try to upload a file larger, after a really long time the message is posted but the file attachement is not there.
Does anyone know why? Any help will be greatly appreciated.
Tigger9969
papoo
07-10-2002, 06:52 PM
thanks i will try it
Darren Evans
07-21-2002, 08:56 PM
If this is a dumb question... shoot me. ;)
Why do all the files that are exported from the database into the attachments folder have long names with .files as an extension? Is there any way to get them exported as their original file names? What did I overlook?
Thanks!
Boofo
07-21-2002, 10:57 PM
You didn't overlook anything, the hack is supposed to do that. If you really want to export them as the original filename, just copy it over to wherever you want it copied and rename it to its original filename. :)
The naming convention is more for security reasons than anything else, I think.
Originally posted by Darren Evans
If this is a dumb question... shoot me. ;)
Why do all the files that are exported from the database into the attachments folder have long names with .files as an extension? Is there any way to get them exported as their original file names? What did I overlook?
Thanks!
Renegade
07-22-2002, 12:00 AM
After placing the installer in my /admin dir and run it from the browser, nothing happens and I get a blank screen in IE. If I place the installer in /forums then I get this error:
Fatal error: Call to undefined function: cpheader() in /home/pc-gurus/public_html/vbportal/forums/attachment_install.php on line 112\
Any ideas?
JJR512
07-22-2002, 04:23 AM
I think another part of the reason for the filenames the way they are is that all the attachments are going into one directory, and if there were two attachments with the same filename, that'd be a problem.
Scott MacVicar
07-23-2002, 11:24 AM
Renegade place the file in the admin directory.
Yeah Justin thats why that is implemented, attachments as files is already in v3 so I will need to create a script to change the naming conventions to match that of vB3.
memobug
07-26-2002, 07:41 AM
I don't know a great deal about this hack, but I was wondering if it might be possible to use something like this as a basis for getting thumbnails into the forum.
If the threadid was included as a prefix in the attachment filename, and I created a cron job that would periodically create thumbnails, The forum could display some recently uploaded images, and a separate script could display them and link to the respective thread where they appear.
It would give you a visual preview of some recent uploads.
Also in lieu of the actual large attachment, the preview image could be displayed inline with the message.
Regards,
Matt
dreamhost
07-26-2002, 10:29 AM
does this hack work with firefly's attachment viewer? I just installed that one, love it, but want to avoid conflicts.
thanks in advance
Oxygen
07-26-2002, 05:54 PM
The hack works wonderfully, i just have an addtional question..
I am modifying my board to be AvantGo Friendly (PDA version)
I have it working properly, and just used the line:
http://www.yourboard.com/Forums/attachment.php?s=&postid=##
to dermine if there is a attachment and display it.
While this works for the web, avantgo needs a actual JPG image.
I also see that the files are .FILE (encoded maybe, I am not sure)
is there a way to modify or actually display the image(.file) using its native name and a path?
(what it was uploaded with)
Regards,
Oxygen
Renegade
07-27-2002, 09:15 PM
Very cool hack, This aleviates space and performance from the DB.
BillaBongUSA
07-27-2002, 09:34 PM
Cool, so this works with vBulletin 2.2.6?
Deska
08-05-2002, 10:33 AM
Originally posted by BillaBongUSA
Cool, so this works with vBulletin 2.2.6?
I hope so...!
life is boost
08-05-2002, 09:10 PM
hey guys im trying to install this hack on my test forums and when i edit the functions.php file i get this error on the site i try and try to reinstall but the same error.
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/300zxclu/public_html/test/forum/admin/functions.php on line 812
Fatal error: Call to undefined function: cachetemplates() in /home/300zxclu/public_html/test/forum/global.php on line 284
im on 2.2.6 :)
Maursheed
08-07-2002, 04:55 AM
Great hack!!! It's working perfectly.
amykhar
08-07-2002, 07:32 PM
I installed today, and everything seemed to go smoothly. However, I can view old attachments that used to be there before the hack, but new attachments are not showing up. I get broken images. I have tried with both new threads, and new replies. Same problem in both.
Using 2.2.6 and not getting any errors when I upload. I can also see that the attachment is uploading correctly to the attachment directory.
Amy
amykhar
08-07-2002, 07:39 PM
OK. New clue. Once I drop the filedata column, no attachments show up.
Amy
amykhar
08-07-2002, 08:01 PM
Never mind. Stupid user error. :D
Amy
ExAvIoUr
08-07-2002, 09:28 PM
i get this
Warning: Unable to create 'home/thunder/public_html/gsu/att4chm3nt5/a17199ecde49d7c665962da50ee0de98.file': No such file or directory in /home/thunder/public_html/gsu/admin/functions.php on line 2403
Warning: Unable to move '/tmp/phpepNhQ9' to 'home/thunder/public_html/gsu/att4chm3nt5/a17199ecde49d7c665962da50ee0de98.file' in /home/thunder/public_html/gsu/admin/functions.php on line 2403
Warning: stat failed for home/thunder/public_html/gsu/att4chm3nt5/a17199ecde49d7c665962da50ee0de98.file (errno=2 - No such file or directory) in /home/thunder/public_html/gsu/admin/functions.php on line 2407
what does it mean?
Boofo
08-07-2002, 11:25 PM
Check the path you have to the attachment directory. It can be tricky. I had the same problem when I first installed this and once I got the path right, everything was fine.
Originally posted by ExAvIoUr
i get this
Warning: Unable to create 'home/thunder/public_html/gsu/att4chm3nt5/a17199ecde49d7c665962da50ee0de98.file': No such file or directory in /home/thunder/public_html/gsu/admin/functions.php on line 2403
Warning: Unable to move '/tmp/phpepNhQ9' to 'home/thunder/public_html/gsu/att4chm3nt5/a17199ecde49d7c665962da50ee0de98.file' in /home/thunder/public_html/gsu/admin/functions.php on line 2403
Warning: stat failed for home/thunder/public_html/gsu/att4chm3nt5/a17199ecde49d7c665962da50ee0de98.file (errno=2 - No such file or directory) in /home/thunder/public_html/gsu/admin/functions.php on line 2407
what does it mean?
Sadie Frost
08-07-2002, 11:43 PM
Working perfectly on 2.2.6 : )
ExAvIoUr
08-08-2002, 12:15 AM
Originally posted by Boofo
Check the path you have to the attachment directory. It can be tricky. I had the same problem when I first installed this and once I got the path right, everything was fine.
i tried make the path work. but it never works. how exactly is the path suppose to look?
Deska
08-08-2002, 03:45 AM
Originally posted by ExAvIoUr
i tried make the path work. but it never works. how exactly is the path suppose to look?
What kind of CP in your hosting use?
Example in Ensim:
if you use command pwd, you got your path:
/home/yourname/mainwebsite_html/
that's not real path, the real path is:
/home/virtual/siteXX/var/www/html/
where siteXX is your site ID
I hope this would be help!
ExAvIoUr
08-08-2002, 02:39 PM
well i am hosting on my friends server. i will have to talk to him.
JJR512
08-08-2002, 03:00 PM
PPN, I have a question for you.
It's concerning vBulletin 3, and the features described in this thread: http://www.vbulletin.com/forum/showthread.php?s=&threadid=51821
John mentions that attachment images (.gif,.jpg.,etc) are no longer stored in the database. I'm assuming this means text files, .zips, and whatever other formats are allowed are still stored in the database. My personal opinion of this is that all formats should be stored outside the db. I can see that some formats, especially text files, might typically be so small that it doesn't make a big difference, but it seems like it would be unnecessarily complicated from a programming point of view to have two different attachment handling routines.
I don't know if you know the answer to this, but I'm curious to know if there will be an administrative way of controlling which attachment types get stored where. Some board admins may allow other file types that could be as large as, or larger, than image files, making them also be good candidates for storing outside the database.
But, PPN, what I'd really like to know from you, is when vBulletin 3 comes out, what's going to happen to those of us who have installed your hack? I know I've long ago gotten rid of the field in the attachments table that stored all the file data, and even if I still had a copy somewhere, there's plenty of new attachments since then that were never put into that field. Will you be able to adjust this hack pretty quickly to work with vB 3, so that those of us using your hack won't have to wait that long before we can start using vB 3 without losing attachments? Or can you make something to basically reverse your hack, something that will re-import all attachment files back as filedata into the database?
ExAvIoUr
08-08-2002, 04:33 PM
nevermind i made it work. i forgot to replace something.
gj
Darren Evans
08-26-2002, 05:33 AM
I manually deleted some files out of the attachments folder (per somone's suggestion) and now I have errors on thread pages. The links to the attachments still show up.
I take it I shouldn't have listened to the person who told me to delete the files. :paranoid:
Can someone help me fix this?
Tim Wheatley
09-01-2002, 01:23 PM
Ok, I'm running 2.2.7, so I hope it works for this. ;)
I'm going through the install and it says:
admin/functions.php
Step 1 of 3 FIND:
function acceptupload($moderate=0) {
REPLACE from that point to the end of the function with
Well, because I'm stupid I don't know where the function ends. Is it just the one line I replace or all the way to above:
// ###################### Start getmodpermissions #######################
Boofo
09-01-2002, 01:36 PM
Yes. :)
Tim Wheatley
09-01-2002, 01:38 PM
Good, I commented the whole (what I thought was it anyway) function out just incase it didn't work. :)
Thanks.
Chris M
09-01-2002, 02:25 PM
Great hack PPN...
I dont know why I never installed this before...
You have saved me from downloading 1.12 Mb whilst Backing up my vB Board!!!
My attachment table is now only 4.7Kb!:D
Satan
Darren Evans
09-01-2002, 03:18 PM
<bump>
Can anyone help me with my question? ^^^^
Chris M
09-01-2002, 05:36 PM
Sorry Darren...I dont know:(
I would like to know if you can delete the files, if there are no more attachments...
?
Hopefully I could avoid an error like Darren's...
Satan
Bison
09-08-2002, 02:46 PM
I installed this hack and now I can't get images to show up in the threads after uploading them from the attachment window! :(
Chris M
09-08-2002, 03:15 PM
Did you make sure that you converted the existing attachments?
Satan
Bison
09-08-2002, 03:53 PM
I ran the converter and dumped everything into a directory I created. The original files are there .... only when I upload a image to be viewed inside the thread that this doesn't work! :(
FleaBag
09-09-2002, 11:39 AM
Working on 2.2.7, cheers! :D
NoAhBoDy
09-10-2002, 06:00 PM
Very nice hack...makes backup sooo much faster :)
Thanks!
Learner29
09-12-2002, 02:20 AM
well,
I apologize if my question has been answered before, but here it is.
I installed this hack, and did all the changes, and the forum replied back saying :
Import of Files from database completed
If you are sure that the files have been imported correctly you may drop the filedata column in the attachment table
now, I went to the forum to see if "the files have been imported correctly" and all attachments are still downloadable..
I got a look at the attachments folder that I made on the root level and to which I gave the 777 chmod, and I found plenty of BINARY files with totally bizarre names such as 0b9732abf17c4032c2ef27fd562f4f70.file
1) does that mean the hack worked perfect for me now ???
2) when you say "you may drop the filedata column in the attachment table", does that mean in phpmyadmin???
3) would future attachments be automatically exported as files, or do I have to do anything every now and then???
4) if a user attaches a virus-containing zip file, can I simply delete it via FTP ? if not, how can I safely delete an attachment now??
thank you so much PPN for the great hack, I really appreciate your great help
Learner29
09-16-2002, 09:59 PM
no answer ??? :confused:
Learner29
09-17-2002, 07:45 AM
would any kind person kindly help a bit ???
Hoffi
09-17-2002, 03:05 PM
Originally posted by Learner29
well,
[snip]
1) does that mean the hack worked perfect for me now ???
yes
2) when you say "you may drop the filedata column in the attachment table", does that mean in phpmyadmin???
yes, i tried it before i dropped it, with renaming and testing if the Attachments work.
3) would future attachments be automatically exported as files, or do I have to do anything every now and then???
new Att. are saved as a file. Without the filedata they can't stored in the table.
4) if a user attaches a virus-containing zip file, can I simply delete it via FTP ? if not, how can I safely delete an attachment now??
i think it is very complicated to find out which file in the folder is the one you want to delete. Do it as always...
thank you so much PPN for the great hack, I really appreciate your great help
Learner29
09-17-2002, 04:37 PM
thank you a million Hoffi
I really really appreciate your help
thank you man !!!!
3) would future attachments be automatically exported as files, or do I have to do anything every now and then???
new Att. are saved as a file. Without the filedata they can't stored in the table.
well, thank you a lot, but as I was not sure, after exporting the attachments to files, I did not delete the table immediately... and was waiting to be sure.
Now that I trust your answer, I could go and delete the table in phpmyadmin.
but what about the attachments that were made between the export I did a few days ago and dropping the table today?? would those be lost ???
should I delete all the attachments folder and restart the exportation and then immediately delete the table in phpmyadmin???
so you are saying in this way, as the table is missing in the database, all future attachments would be exported directly as files , right ??
Thank you a million for your help
I appreciate it man .
Hoffi
09-17-2002, 07:02 PM
Immedeatly when you uploaded your hacked files, the attachments weren't stored in the DB.
Learner29
09-17-2002, 09:52 PM
thank you very much for your great answer
Bison
09-18-2002, 12:41 AM
All I know is that this frigging hack has hosed up my whole company forum!
I have it installed and I dropped the filedata table as requested and now the admin/index.php file and serverinfo.php files are looking for that table!
Sheeze!
I don't see anywhere in the installer that mentions to comment out the calls from these files to that specific table!
BTW, i'm using vb2.2.6 ... Is there anyway to reverse the damage that this ******* hack has done? I did do a backup (vbulletin.sql) from a recent dump ... will that get my sh*t back into my database?
My frigging Boss is going to kill me! :(
Learner29
09-18-2002, 12:54 AM
Rolodex wrote:
All I know is that this friggin hack has hosed up my whole forum!
I have it installed and I dropped the filedata table as requested abd now
the admin/index.php file and serverinfo.php files are looking for that
table!
Sheeze!
I don't see anywhere in the installer that mentions to comment out the calls
from these files to that specific table!
BTW, i'm using vb2.2.6 ... Is there anyway to reverse the damage that this
******* hack has done? I did do a backup (vbulletin.sql) from a recent dump
... will that get my sh*t back into my database?
My friggin Boss is going to kill me! :(
Oh my God. I have not dropped the table yet, for though I do trust Hoffin, I
just wanted to make a little test.
I uploaded a file, call it file.zip, and then checked my root vbattachments
folder and my database using phpmyadmin, and the file was updated to both !!
the file appeared both in my database AND in my vbattachments folder .....
I deleted the post and the file.zip, and the file was deleted in BOTH my
vbattachments folder AND my database....
is that normal ???
Hoffi
09-18-2002, 11:25 AM
First of all nobody should delete a whole table. The filedata is only a column in the Attachment Table. If you delete the whole Table the Forum won't work anymore...
If you apllied all Changes to your Files, the access to that row is eliminatzed and the Files are used.
However, if you make changes to your Forum make Backups. Even the Database and the Files!
@Rolodex: If the Dump was before you drop the Column (Table?) it brings you the Data back. But if you won't use this great Hack, you must change your Files back to original too.
Bison
09-18-2002, 05:25 PM
Did I say "Drop Table?"
Ok ... I did but I actually didn't drop the table ...
just the filedata column. I had everything installed proplerly (I think) but there were things that weren't showing up (Like Uploaded Images In threads) and all of the attachments that were uploaded after the hack couldn't be seen at all ... and i'm the Admin.
This is the only hack that didn't work for me. PPN I like your hacks but this one and the "login as user" Hack (Scews up the User.php after installing PHP 4.2.x) has compiled a few problems with me and with the Vbulletin 2.2.x Board Code.
I think you should check them again for compatibility...
Regards,
Rolodex
Learner29
10-01-2002, 01:48 AM
I am sorry to hear that Rolodex......
really.
I have just dropped the filedata column in phpmyadmin and everything seems to work .....
I could download old attachments, upload new ones, and download new ones. as admin or just a modo......
Learner29
10-01-2002, 01:49 AM
thank you PPN once again for this great hack.
my database is about 20 megabites less now .........
oufffff
Scott MacVicar
10-01-2002, 12:47 PM
I'll post the importer sometime before the vB3 release which will translate your attachment table into a vB3 readable format.
But the easiest solution may just be to import all the attachments back into the database.
Learner29
10-01-2002, 01:19 PM
thank you PPN for your continued efforts .....
to be honest with you, I DID think of this yesterday and asked myself : what when vb3 comes out ??? how do I keep those exported attachments that are not any more part of the database now...
thank you for working on an importer to prepare the attachments in a vb3 readable format.
I appreciate it.
one more thing : as soon as your hack is ready for vb3, I will be happy to test it for you and tell you how it works.
Scott MacVicar
10-01-2002, 07:06 PM
Attachments as files is standard in vB3 so I'll simply attach a script to change it to that format, I'll have it pretty well tested anyway well before any sort of public release. But you probably should test it just to make sure that I dont have any problems with different OS's.
WhisperPntr
10-05-2002, 01:58 PM
Rolodex...you really should have tested this on a home server first.
BTW I really like this idea. I will try it sometime this week.
Essamz
10-08-2002, 12:28 PM
hi
im having this error with the hack:
Warning: Supplied argument is not a valid File-Handle resource in /home/httpd/vhosts/montada.com/httpdocs/xx/attachment_install.php on line 403
Imported ffx_box.jpg
Warning: Supplied argument is not a valid File-Handle resource in /home/httpd/vhosts/montada.com/httpdocs/xx/attachment_install.php on line 403
Imported lee 2.jpg
Warning: Supplied argument is not a valid File-Handle resource in /home/httpd/vhosts/montada.com/httpdocs/xx/attachment_install.php on line 403
Imported conan_1_800.jpg
PPN, im having a problem with this under 2.2.8 (clean install). i get this error when trying to reply:
Parse error: parse error in /home/kousetsu/public_html/kan/admin/functions.php on line 2561
Fatal error: Call to undefined function: makelogincode() in /home/kousetsu/public_html/kan/global.php on line 360
line 2561 is the last ?>.
Scott MacVicar
10-11-2002, 08:20 AM
your missing a }
I'm at university just now so can you pm me your functions.php so I can look at it.
Yea, i found that out, however i have a new error.
when i upgraded to 2.2.8 (clean install) and tried to re install this i droped the hash table via the installer, new attachments work but old ones throw this error due to the hash table begin droped.
Warning: stat failed for /home/kousetsu/public_html/attachments/.file (errno=2 - No such file or directory) in /home/kousetsu/public_html/kan/attachment.php on line 59
Warning: Unable to access /home/kousetsu/public_html/attachments/.file in /home/kousetsu/public_html/kan/attachment.php on line 60
Warning: fopen("/home/kousetsu/public_html/attachments/.file", "rb") - No such file or directory in /home/kousetsu/public_html/kan/attachment.php on line 60
Warning: fread(): supplied argument is not a valid File-Handle resource in /home/kousetsu/public_html/kan/attachment.php on line 61
Warning: fclose(): supplied argument is not a valid File-Handle resource in /home/kousetsu/public_html/kan/attachment.php on line 62
Warning: Cannot add header information - headers already sent by (output started at /home/kousetsu/public_html/kan/attachment.php:59) in /home/kousetsu/public_html/kan/attachment.php on line 63
Warning: Cannot add header information - headers already sent by (output started at /home/kousetsu/public_html/kan/attachment.php:59) in /home/kousetsu/public_html/kan/attachment.php on line 64
Warning: Cannot add header information - headers already sent by (output started at /home/kousetsu/public_html/kan/attachment.php:59) in /home/kousetsu/public_html/kan/attachment.php on line 65
Warning: Cannot add header information - headers already sent by (output started at /home/kousetsu/public_html/kan/attachment.php:59) in /home/kousetsu/public_html/kan/attachment.php on line 66
Warning: Cannot add header information - headers already sent by (output started at /home/kousetsu/public_html/kan/attachment.php:59) in /home/kousetsu/public_html/kan/attachment.php on line 67
Warning: Cannot add header information - headers already sent by (output started at /home/kousetsu/public_html/kan/attachment.php:59) in /home/kousetsu/public_html/kan/attachment.php on line 73
Is there anyway to give old attachments a new hash in the DB so they work?
Ninth Dimension
10-13-2002, 10:34 AM
I've just installed this hack again, and it works as well as it ever did, thank you fella :)
Just a bump.
Originally posted by Anime-loo
Yea, i found that out, however i have a new error.
when i upgraded to 2.2.8 (clean install) and tried to re install this i droped the hash table via the installer, new attachments work but old ones throw this error due to the hash table begin droped.
Is there anyway to give old attachments a new hash in the DB so they work?
Scott MacVicar
10-15-2002, 07:35 AM
there isn't a way to associate the hash and the filename any more that was the whole point in using hashes, do you have a table backup before you dropped the column?
No. if i did i would have restored it, are you sure we couldent do something like import the files to the database and export them again?
sdenvers
10-20-2002, 10:38 PM
Two problems encountered on 2.2.6 trying to install this hack:
1. It said I'd already installed it, but I haven't.
2. During import it gives this error for each file, and the attachments directory is left empty:
"Warning: fwrite(): supplied argument is not a valid File-Handle resource in /home/xxx.com/html/forums/admin/attachment_install.php on line 333
Imported car_wash.jpg"
Help!
FleaBag
10-28-2002, 11:30 PM
Works with 2.2.8. :)
ricoche
10-29-2002, 07:46 AM
Could anyone tell me what possibly could have gone wrong here? I saw in the previous post that this hack worked with 2.2.8. So I installed it and now all I get is a blank white screen on my computer. The hack has totally messed up my entire system and I don't know how to uninstall or fix this. I noticed a couple of people had this problem back a few posts but I didn't see a solution.
Any help would be appreciated all my hard work seems to have been destroyed.
Thanks,
Ricoche :disappointed:
Scott MacVicar
10-29-2002, 08:02 AM
every page is a white screen?
It sounds like you've done something wrong within functions.hpp
ricoche
10-29-2002, 08:20 AM
I agree I think there is a problem with my functions.php but I'm not sure how to correct it. I made a .bak of my original, so maybe if I delete the new one and go back to the install I can redo the cut and paste job?
Wow, this is pretty scary. I thought I had this down.
Oh, also I was able to back track and dump an attachment from the database into my attachments folder with permissions set to 777 just fine. Like I said I'm confined to my vbulletin control panel only ...at the moment.
Thanks for the reply. Right now <laugh> I'm just twiddling my thumbs and sweating bullets!!
:cross-eyed:
Ricoche
ricoche
10-29-2002, 10:56 AM
Ok, I finally figured what I did wrong.
In the first edit for functions.php I failed to do the replace until the end of the function. I do understand some basic programming but for some reason I forgot that { } define beginning and ending of functions. Actually I knew this but if you look at the code it's quite confusing to identify where it ends. Kind of tricky I think.
Anyway all is well now except one thing that I think was posted earlier. The previous attachments that I had now no longer show up on the front page of my vbportal script. Have to figure that one out now.
Thanks.
ricoche
10-29-2002, 11:12 AM
Finally got it. The conversion didn't work so I just deleted the only couple of attachments I had and reposted them. The script automatically did everything else and now my attachments can be viewed by admin at least.
Thanks for the script. It sure confused the heck out of me but in the end it does work.
Thank you .
Ricoche
HappyPike
10-30-2002, 05:58 AM
How long does it take to import the files from the database to a directory? My forum's attachment table is 1.8 GB in size... I hope it doesn't take forever....
Also, does the script delete files from the attachments table as it imports the file, or does it only delete the files in the attachment table after all the files have been imported to a directory? If it makes a copy of all 1.8 GB files first, I don't think I have enough space on the server. :(
Thanks.
Areku
11-06-2002, 10:30 AM
I'm sorry if I repeat questions but this support thread has grown too much...
- Are there any chances to have real file attach names instead of weirdos like 0170111c41158690b35dbd1754a54929.file?
- I'm running v2.2.0 and it seems to be working fine, but haven't tested it in full... Do i need to remove/add the visible thing u were talking about with 2.2.2?
- How do I reset the attachments table so I remove them from the DB now that I have them as files?
Thanks!
Scott MacVicar
11-06-2002, 02:31 PM
I'll probably be changing it to just the attachmentid number soon it will allow for much easier vB3 upgrades. I'll actually try to do it tonight.
Darren Evans
11-06-2002, 03:28 PM
PPN, this never got answered:
I manually deleted some files out of the attachments folder (per somone's suggestion) and now I have errors on thread pages. The links to the attachments still show up.
I take it I shouldn't have listened to the person who told me to delete the files. :paranoid:
Can someone help me fix this?
Scott MacVicar
11-06-2002, 07:53 PM
you have to delete the attachment like your normall would, clicking the edit button on that post then in the attachment area and select Delete Attachment.
Areku
11-07-2002, 11:56 AM
Originally posted by PPN
I'll probably be changing it to just the attachmentid number soon it will allow for much easier vB3 upgrades. I'll actually try to do it tonight.
Does this replies to my first question? Shall I asume there's no option to have real names in it?
What about the other 2 questions? ;) Pleeeeez!
Scott MacVicar
11-07-2002, 02:32 PM
Will definately not having the attachment name, that would be a large security issue if you have the filename script.php which has
<?
while (1=1) {
require('http://url.com/attachment/script.php');
}?>
which would cause a loop to keep including itself and hence crash the server or other various things.
vBulletin 3 uses the attachment id as the filename, so that seems the most sensible thing to do.
Also the visible thing was actually a bug that was corrected so you should just leave it in.
Freddie Bingham
11-07-2002, 04:17 PM
Actually, it uses the postid since attachmentid has been dropped from the attachment table.
Areku
11-07-2002, 05:03 PM
OK i'm getting lost now...
I applied the hack to vb 2.2.0 and after the whole process I get a bunch of unreadable .file files...
My idea was, that in the event of a db crash, I could still have a copy of the tools itself, with its own name. I don't know why the security issue... Why so? BEcause any1 could download stuff directly maybe? Or anything else I'm missing?
Scott MacVicar
11-07-2002, 08:13 PM
they could execute scripts on your server is the main problem.
Areku
11-08-2002, 10:12 AM
Ok my initial request was to have some sort of way to have the original files extracted from the vB DB so I can back them up with their original names. Is there any workaround to this?
linesider
11-10-2002, 03:22 PM
Originally posted by sdenvers
Two problems encountered on 2.2.6 trying to install this hack:
1. It said I'd already installed it, but I haven't.
2. During import it gives this error for each file, and the attachments directory is left empty:
"Warning: fwrite(): supplied argument is not a valid File-Handle resource in /home/xxx.com/html/forums/admin/attachment_install.php on line 333
Imported car_wash.jpg"
Help!
I've had a simlar promlem with (on vB 2.2.8) #2 as sdenvers:
Warning fwrite(): supplied argument is not a valid File-Handle resource in /home/yadayada/www/public_html/vbulletin/admin/attachment_install.php on line 333 /
Imported this old.jpg
On the top of the attachment_install.php pages I see this after the edited files are uploaded. I've redone all the files several times and tripple checked the functions.php at 1806
Parse error: parse error in /home/lineside/public_html/vbulletin/admin/functions.php on line 1806 https://vborg.vbsupport.ru/external/2002/11/2.gif
Thanks :btu: ...
Areku
11-13-2002, 02:29 PM
Weird error I get at random doing different things on vB2.2.0.
Last time I was able to catch it:
I was deleting a thread on a forum that requires prevalidation from the admin control panel. I noticed the error right after pressing the submit button:
Warning: Unlink failed (No such file or directory) in /usr/local/etc/httpd/...path.../forums/admin/functions.php on line 1781
Deleted thread: 3733
Then, surfing functions.php, line with the problem is:
unlink($path);
of the following routine:
// ###################### 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);
}
What's going on? I've seen the error appearing at random while using the forums, but haven't been able to capture it until today.
Thanks!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.