![]() |
yeah you done alot of help when it was in beta :)
I'll go modify my evergrowing sig |
Great.
Works perfectly :D |
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. |
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. |
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, 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 back then too. Any suggestions? Thanks, Destee |
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 |
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? |
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 |
which folder is attachments suppose to be stored? I don't see any folder in the FTP.
|
Vivi ... hope this helps ...
Quote:
|
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!
|
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 |
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
|
Hi PPN ... I don't mean to be a pest ... but any progress on how I can resolve my issues with this hack?
Thanks, Destee |
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.
|
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! :) |
no problem :P
Sorry it took so long, it was just a rather odd error :) |
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.
|
YAYAYAYA it works!! that's all u needed to write actually! ?>
|
for some reason it shows on mine though, thats now 3 people that have had the end tag clipped from the file.
|
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. |
Is there a hack to extract all the existing attachment from db into files ?
|
test
|
Looks like a great hack-i get all the way through to step one in functions php
then i crash when i add this //we got this far, attachment passes the tests //the file should now be in the directory lets simply insert the data into the database $visible = iif($moderate,0,1); $DB_site->query("INSERT INTO attachment (attachmentid,userid,dateline,filename,visible,has h) VALUES (NULL,$bbuserinfo[userid],".time().",'".addslashes($attachment_name)."','$v isible','$attachment_hash')"); $attachmentid=$DB_site->insert_id(); } return $attachmentid; } // ###################### Start removeattachment ####################### function removeattachment ($attachmentid) { global $DB_site,$attachpath; $fileinfo = $DB_site->query_first("SELECT attachmentid, hash FROM attachment WHERE attachmentid='$attachmentid'"); $path = "$attachpath/$fileinfo[hash].file"; unlink($path); } any ideas why this crashes my board? tx! :D |
Quote:
48MB -> 84KB :) Thanks for making this hack!!! |
BUMP
|
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.
|
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: :( |
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 |
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.
|
Quote:
|
Thanks for the hack.
It was fairly painless to install and works great! |
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 :) |
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. |
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 :__ ) |
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
|
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! |
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.
|
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.
|
Nice one, thanks!
|
All times are GMT. The time now is 04:20 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|