View Full Version : Attachments as files
I am planning on making a site where users will upload large files, ranging from 1 - 10mb. So obviously I am looking at this hack to make this happen. My questions are, do you know if the upload can handle these large size files? And is there a neat way to prune old attachments say from 6 months back so that I don't use up all my hdd space? I am guessing that I can run a delete query and then just looking in the attachments folder and delete my date last modfied. Hmm, ok I answered my second question I think :). Cheers
Areku
11-18-2002, 08:33 AM
how can i uninstall this mod?
I didn't delete the files of the database the moment after installing this mod, so I'm assuming old files are duplicated.
How can I uninstall this mod?
Thanks!
all works perfect, and i imported the old attachments but now the old images etc. are not in the posts?¿?
Bison
11-21-2002, 03:08 AM
Originally posted by Areku
how can i uninstall this mod?
I didn't delete the files of the database the moment after installing this mod, so I'm assuming old files are duplicated.
How can I uninstall this mod?
Thanks!
If you get your attachments to work on the first post, after uninstalling this hack, drop me a line!
need help what must i do??
Areku
11-22-2002, 08:05 AM
Rolodex, what do you need?
I still need to uninstall this mod.
Any1?
super my backup does not work because its too big!
Bison
11-24-2002, 04:35 PM
Originally posted by Areku
Rolodex, what do you need?
I still need to uninstall this mod.
Any1?
I was mentioning if you get your board attachments to work after uninstalling this hack, please let me know what you did t do it! ~
The Ghost
11-30-2002, 09:03 AM
hi,
I want to Display the Attachments Size in the posts under the counter.
How could I do this?
thx, great Hack!
linesider
12-01-2002, 01:43 AM
Can somebody with this hack working send me a copy of their functions.php so I can compare it to what I have going?
Thanks....
Question: how easy would it be to modify the attachments database and this hack to allow up to 3 attachments per post, and be easy to convert from a userid_dateline.extension filename format?
I want to know because I'm planning on converting a phpBB board to vBulletin, but the attachment hack I installed on the phpBB allows up to 3 attachments per post, and vBulletin by default doesn't.
Prince
12-05-2002, 02:10 PM
Does this hack work with vB 2.2.9?
and can someone please briefly explain what the install does?
does it take all existing file attachments out of your vB database and make them files?
Craigr
12-14-2002, 08:42 PM
Originally posted by Prince
Does this hack work with vB 2.2.9?
and can someone please briefly explain what the install does?
does it take all existing file attachments out of your vB database and make them files?
Well i was for installing it on 2.2.9, but i couldn't find the code in attachments.php you're supposed to replace!
Craig
wolffenstein
12-15-2002, 02:37 AM
installed on my testing board, running 2.2.9. ran fine.
the install file, when viewed with your browser, helps install the hack by making modifications to the database for you, and pointing out which files to modify in an "easy way." place it in your admin folder, as it requires admin access to install.
it can import (read: copy, but not delete) files from the database.
the attachments.php with proper code is in your forums' root directory. the attachments.php in the admin folder does not have the necessary coding. yes, those instructions weren't perfectly clear at first, but read all instructions before proceding, common sense should dictate. you'll notice you have to make modifications to files in the mod and admin folders, and thus, they're located in the mod/ and admin/ folders.
however, the instructions have a slight typo, though i think the reason lies within changes to vb since 2.2.3. the second instructions for the admin/functions.php file (don't mistake this for admin/adminfunctions.php like i did) have this code:$DB_site->query("DELETE FROM attachment WHERE attachmentid IN ($attachmentids"."0) AND NOT attachmentid IN ($omitattachmentids"."0)"); wheras function.php has:$DB_site->query("DELETE FROM attachment WHERE attachmentid IN ($attachmentids"."0) AND attachmentid NOT IN ($omitattachmentids"."0)");simply, "attachmentid" and "NOT" are reversed. i wouldn't imagine this to be any problem whatsoever. i've attached the installer file with the proper change for versions 2.2.7 and above (2.2.7 change log: "Admin/functions.php; fixed a bug causing attachments used as references to be deleted when they shouldn't be").
Danny
01-03-2003, 10:33 PM
it does work fine, but I have now upgraded to vb2.2.9 and unfortunately when i try and change a user from one group to another group using the control panel i get an error in the user.php file, this error does not appear when no hacks are installed.
Database error in vBulletin Control Panel 2.2.9:
Invalid SQL: UPDATE user SET birthday='0000-00-00',options='14',usergroupid='15',username='margar et
vasey',email='email@email.com',styleid='1',parente mail='n/a',coppauser=1,homepage='http://',icq='',aim='',yahoo='',signature='',adminemail=1 ,showemail=0,invisible=1,usertitle='Member',custom title=0,joindate=UNIX_TIMESTAMP('2002-09-06
15:07:30'),cookieuser=1,nosessionhash=,daysprune='-1',lastvisit=UNIX_TIMESTAMP('2002-09-06
15:07:30'),lastactivity=UNIX_TIMESTAMP('2002-09-06 15:18:27'),lastpost=UNIX_TIMESTAMP('1970-01-01
01:00:00'),posts='0',timezoneoffset='0',emailnotif ication=1,receivepm='0',emailonpm='1',ipaddress='-1',pmpopup=IF(pmpopup=2 AND
1=1,pmpopup,'1') WHERE userid=270
mysql error: You have an error in your SQL syntax near 'daysprune='-1',lastvisit=UNIX_TIMESTAMP('2002-09-06
15:07:30'),lastactivity=UNIX' at line 1
mysql error number: 1064
Date: Friday 03rd of January 2003 08:52:07 PM
Script: http://www.golden-springs.com/forums/forums/admin/user.php
Referer: http://golden-springs.com/forums/admin/user.php?action=edit&userid=270
mv540
01-05-2003, 06:37 PM
Hi guys, I need some quick help. I have installed this hack on a 2.2.9 board and everythijng seemed to work fine. It seems now that only mods and admins can view forums or search.
Here's the error.
Fatal error: Call to undefined function: getmodpermissions() in /home/hsphere/local/home/ital911/dss-power.com/forums/admin/functions.php on line 1758
Thanks
regular members get this error when they actually click on a forum or clich the vew newest possts, which I have set to get daily..
Danny
01-06-2003, 06:45 AM
Originally posted by mv540
Hi guys, I need some quick help. I have installed this hack on a 2.2.9 board and everythijng seemed to work fine. It seems now that only mods and admins can view forums or search.
Here's the error.
Fatal error: Call to undefined function: getmodpermissions() in /home/hsphere/local/home/ital911/dss-power.com/forums/admin/functions.php on line 1758
Thanks
regular members get this error when they actually click on a forum or clich the vew newest possts, which I have set to get daily..
you have hacked the functions.php file incorrectly delete it and start over again, I have hacked my 2.2.9 board with this hack and everything is fine.
my above post was a bug in 2.2.9 which is fixed now.
Areku
01-10-2003, 11:12 AM
Hi!
I recently uninstalled this hack off from my board, but I must have forgotten to change something in editpost.php since now, everytime i try to delete ANY post (doesnt matter if it contains an attachment or not) or try to delete any attached file, I get the following error:
Database error in vBulletin 2.2.0:
Invalid SQL: SELECT attachmentid, hash FROM attachment WHERE attachmentid='491'
mysql error: Unknown column 'hash' in 'field list'
mysql error number: 1054
Date: Friday 10th of January 2003 06:07:47 AM
Script: http://.../forums/editpost.php
Referer: http://.../forums/editpost.php?s=&action=editpost&postid=32926
The error does NOT appear if I just edit the text of the post and submit changes.
Can any1 help out??
Areku
01-13-2003, 09:14 AM
Further exploring functions.php I found the responsible (I think it's the responsible for the error):
// ###################### 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);
}
However, what should I do with this routine that's causing problems ONLY with editpost.php? If I delete it I'm sure a new problem will arise, right?
I might think of a database not so well written or some sort of column is superfluous, but I'm stucked, what shall I do now?
THanks!!!
Mustang5ohhh
01-26-2003, 02:00 AM
I'm getting the same error as above when I go to delete a thread with an attachment. Any updates ?
Next ... I'm sort of new to the vB thing ... I've installed the hack and with a few minor problems that I worked out ... it "seems" to be working. The whole problem is that I'm not sure if it is working right. Using Telnet I connect to MySQL and I still see the attachment tables:
1. Am I supposed to?
2. The filedata column has nothing in it ... does that mean that it worked and the file is out in the directory?
3. Is there a querie I can run to see if that it is indeed working?
Sorry about so many questions ... I went to the MySQL site but ... I'm not that advanced yet ... I need laymans terms to get me through this.
Thanks in advance.
M
BaBa2002
01-27-2003, 07:40 PM
when i change the code in functions.php i get a error
when i try to connect the admin panel i get olso a error
Parse error: parse error in /home/httpd/vhosts/forums.blowreactor.com/httpdocs/forums/admin/functions.php on line 2029
What's the problem
i'm using vb 2.2.9
Zachery
02-13-2003, 09:37 PM
Parse error: parse error, unexpected $ in c:\phperl2\websites\site1\www\forums\admin\functio ns.php on line 2414
got that error, im running vb 2.3.0 so, im guessing its a error with vb2.3?
after gettin the error with macromedia dreamweaver mx i tried good old word pad
Parse error: parse error, unexpected $ in c:\phperl2\websites\site1\www\forums\admin\functio ns.php on line 2415
in functions.php
fofofo
02-27-2003, 05:41 PM
Warning: fwrite(): supplied argument is not a valid File-Handle resource in /usr/home/neqashal/public_html/admin/attachment_install.php on line 333
Boofo
02-27-2003, 05:47 PM
Sounds like you don't have either the dir or some files CHMOD 777? Just a guess.
fofofo
02-27-2003, 06:02 PM
Originally posted by PPN
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.
where i put the path in the vBulletin options?i cant
found any place on the vBulletin options for the path!!!
any picture i will appricated :chinese:
fofofo
02-27-2003, 06:27 PM
i test this hack on other forum and i saw the path for folder!
i think my prolem is my athchment file is 3.3gig
and this hack not work for huge size
Boofo
02-27-2003, 06:35 PM
PHP has a filesize upload limit. I don't think it will go that high. That sounds like the problem.
FleaBag
02-27-2003, 10:07 PM
Originally posted by Faranth
Parse error: parse error, unexpected $ in c:\phperl2\websites\site1\www\forums\admin\functio ns.php on line 2414
got that error, im running vb 2.3.0 so, im guessing its a error with vb2.3?
after gettin the error with macromedia dreamweaver mx i tried good old word pad
Parse error: parse error, unexpected $ in c:\phperl2\websites\site1\www\forums\admin\functio ns.php on line 2415
in functions.php
I get exactly the same problem, only now, all my files are on the server and not in the database, so I'm screwed.
FleaBag
02-27-2003, 10:33 PM
Just realised too, that's there's no exporter to put them back into the database. I'm praying for either a fix for version 2.3.0, or at least some kind person to write an exporter.
FleaBag
03-04-2003, 09:42 PM
PPN, any ideas on what may be wrong?
Bison
03-05-2003, 02:11 AM
I hope you backed up your files & database. This puppy is *Dangerous* ... once you've got errors they can't be fixed properly...
FleaBag
03-05-2003, 03:13 PM
There was no point me backing up my database, I installed this hack a long time ago, my database has trebbled in size since then. There must be a way of re-importing the files into the database.
Bison
03-05-2003, 05:50 PM
I ead somewhere in this thread that one of the guys were going to create a file importer program for this hack. The author hasn't supported this hack in several months, and I believe that he was working on making this file importer.
I feel for you, but I would have made a backup (Of everything) before upgrading my forum... if I was successful installing this hack the first time.
It's a nice idea with a deadly bite ...
wooolF[RM]
03-05-2003, 08:02 PM
nah... it works on all versions exept 2.3.x
and that's bad... otherwise it's a nice hack... I use it and have no problems
FleaBag
03-05-2003, 11:34 PM
I do back up my forums, and in fact all of my site on a monthly basis - all I'm saying is that a backup from a month ago would be useless to me.
Is it possible for me to downgrade to 2.2.9?
FleaBag
03-06-2003, 12:21 AM
Looks like this hack is never gonna work for me, so I think it's time to say goodbye to this thread permanantly [and to over a years worth of attachments]. Oh well...
Bison
03-06-2003, 12:26 AM
Like I said before ... Nice Idea, but with no support, your playing a game of "russian roulette!"
NoAhBoDy
03-06-2003, 04:16 AM
..so I guess if you have this hack installed and don't want to lose your attachment db, you're stuck at 2.2.9 ??
FleaBag
03-08-2003, 01:33 AM
More or less - yes. And you won't be able to upgrade to version 3 either.
FleaBag
03-12-2003, 10:52 AM
OK I've found a solution for anyone wishing to remove this hack so that they can continue with versions 2.3.x onwards.
BY DOING THIS YOU WILL LOSE ALL OF YOUR ATTACHMENTS
Uninstall the hack using the install file.
Run this query...
DROP TABLE IF EXISTS attachment;
CREATE TABLE attachment (
attachmentid smallint(5) unsigned NOT NULL auto_increment,
userid int(10) unsigned NOT NULL,
dateline int(10) unsigned NOT NULL,
filename varchar(100) NOT NULL,
filedata mediumtext NOT NULL,
visible smallint(5) unsigned NOT NULL,
counter smallint(5) unsigned NOT NULL,
PRIMARY KEY (attachmentid)
);
You can now delete the folder with attachments as files inside.
You will lose ALL attachments in your BB, do not blame me if what I tell you to do here messes anything in your site up - MAKE A BACKUP.
Over and out. :)
Stud_Muffin
03-21-2003, 11:33 AM
03-12-03 at 12:52 PM GamerForums said this in Post #290 (https://vborg.vbsupport.ru/showthread.php?postid=364764#post364764)
OK I've found a solution for anyone wishing to remove this hack so that they can continue with versions 2.3.x onwards.
BY DOING THIS YOU WILL LOSE ALL OF YOUR ATTACHMENTS
Uninstall the hack using the install file.
Run this query...
DROP TABLE IF EXISTS attachment;
CREATE TABLE attachment (
attachmentid smallint(5) unsigned NOT NULL auto_increment,
userid int(10) unsigned NOT NULL,
dateline int(10) unsigned NOT NULL,
filename varchar(100) NOT NULL,
filedata mediumtext NOT NULL,
visible smallint(5) unsigned NOT NULL,
counter smallint(5) unsigned NOT NULL,
PRIMARY KEY (attachmentid)
);
You can now delete the folder with attachments as files inside.
You will lose ALL attachments in your BB, do not blame me if what I tell you to do here messes anything in your site up - MAKE A BACKUP.
Over and out. :)
Did that, lots of files to sieve through now :cry:
FleaBag
03-21-2003, 04:04 PM
What do you mean?
Stud_Muffin
03-21-2003, 04:08 PM
I still have the attachments on my server but not on the forum. Just loads of files like so. beca544936ecfacf43c7076feb61d140.file so i need to load them up to see if i need to keep or delete them, that was all.
FleaBag
03-21-2003, 04:10 PM
Ah I see what you mean. I didn't go to that much effort... My site has been open for 15 months, so there was a fair few to look through... I just deleted them all. :(
Bison
03-21-2003, 06:39 PM
IMO ... this thread and this hack needs to be removed since no one's gonna help anyone with this !
wolfman
03-22-2003, 02:53 PM
Well I am glad I was able to see this before installing this hack.
wooolF[RM]
03-29-2003, 12:46 PM
]or just run 2.2.9 :D and no problems
storing all attachments in the database is pain in the ass as for the speed of it and as for backuping
FleaBag
03-29-2003, 01:45 PM
But still, your attachments won't work in version 3.x.
Bison
03-29-2003, 07:17 PM
Today at 09:46 AM wooolF[RM] said this in Post #297 (https://vborg.vbsupport.ru/showthread.php?postid=374980#post374980)
or just run 2.2.9 :D and no problems
storing all attachments in the database is pain in the ass as for the speed of it and as for backuping
I Guess you don't plan on updating to vB3! :smoke:
wooolF[RM]
03-29-2003, 09:12 PM
]exactly my point, Rolodex! ;) :D
Scott MacVicar
04-05-2003, 07:41 AM
Silly question how isn't it working for vB 2.3.0 I didn't see any changes in the attachment code.
I will test this now on a fresh cvs copy.
Scott MacVicar
04-05-2003, 07:42 AM
and there has been 2 users who upgraded to vB3 as well as using this hack, I provided a script to do so and you only need vB 2.2.9 to upgrade to vB3.
Scott MacVicar
04-05-2003, 07:59 AM
Installed file on a 2.3.0 board following the instructions exactly. How exactly did you go about the upgrade?
All you needed to do was make the file changes, you didn't need to uninstall the hack beforehand as this would remove the hash column and you would lose the association with the attachments in the directory.
scotty
04-05-2003, 08:18 AM
I followed the instructions exactly, the hash is still in the databse, can access the files per browser (supply the filename directly), but get the error:
Warning: stat failed for /home/web3/html/ioff/attachments/84902300622b0d0ded64d1ddcb68ff5e.file (errno=2 - No such file or directory) in /home/www/web3/html/ioff/attachment.php on line 53
Warning: fopen("/home/web3/html/ioff/attachments/84902300622b0d0ded64d1ddcb68ff5e.file", "rb") - No such file or directory in /home/www/web3/html/ioff/attachment.php on line 54
Warning: fread(): supplied argument is not a valid File-Handle resource in /home/www/web3/html/ioff/attachment.php on line 55
Warning: fclose(): supplied argument is not a valid File-Handle resource in /home/www/web3/html/ioff/attachment.php on line 56
chmod 777 done
php 4.2.2
php_admin_flag safe_mode Off
php_admin_value open_basedir none
Scott MacVicar
04-05-2003, 08:35 AM
is this with all attachments or just some and was the attachment before or after the hack install?
scotty
04-05-2003, 08:52 AM
copy 2.2.8 to new directory (with all attachments! ~2000)
upgrade to 2.3.0
installed:
- dynamic templates
- quickreply
- avatar as file (no problem!)
- welcome panel
- and now attachment as file
attachment was uploaded with the 2.2.8 version and your hack
when I try to upload, then this error appears:
Warning: Unable to create '/home/web3/html/ioff/attachments/bea992c8f4cdf9729c408c93a7deb10b.file': No such file or directory in /home/www/web3/html/ioff/admin/functions.php on line 1776
Warning: Unable to move '/home/www/web3/phptmp/phpfcMMqX' to '/home/web3/html/ioff/attachments/bea992c8f4cdf9729c408c93a7deb10b.file' in /home/www/web3/html/ioff/admin/functions.php on line 1776
Warning: stat failed for /home/web3/html/ioff/attachments/bea992c8f4cdf9729c408c93a7deb10b.file (errno=2 - No such file or directory) in /home/www/web3/html/ioff/admin/functions.php on line 1780
scotty
04-05-2003, 08:58 AM
error even apperas, if "upload safe mode" in CP is activated
(avatar as file does work without it)
Scott MacVicar
04-05-2003, 10:06 AM
you said you copied the entire directory to a new folder, did you move the attachments back to /home/web3/html/ioff/attachments or adjust the path in settings to reflect this?
scotty
04-05-2003, 11:01 AM
Today at 01:06 PM PPN said this in Post #308 (https://vborg.vbsupport.ru/showthread.php?postid=377784#post377784)
you said you copied the entire directory to a new folder, did you move the attachments back to /home/web3/html/ioff/attachments or adjust the path in settings to reflect this?
copied entire forum to new folder incl. attachments and adjusted path
Scott MacVicar
04-05-2003, 01:28 PM
mk if you can pm me your ftp details and admincp details. Its definately a setting somewhere thats causing this.
The only thing i notice different is
/home/www/web3/html/ioff/attachments
and
/home/web3/html/ioff/admin/functions.php
missing www but that is probably intended
scotty
04-05-2003, 01:32 PM
we have at the moment huge server probs, so I get back to you later - maybe it's a "safe mode" problem (the upload) ...
Scott MacVicar
04-06-2003, 02:25 AM
going to
http://www.ioff.de/attachments/84902300622b0d0ded64d1ddcb68ff5e.file
shows the actual file so add the missing www from the path and try that.
scotty
04-06-2003, 09:39 AM
PPN - thanks - I try it, when we solved the load issues in our board (load average: 22.04, 22.29, 22.99 ).
scotty
sumandy
04-11-2003, 02:35 AM
Urgent need PPN help.. or any other great hacker !
I'm now using VBB2.2.9 and installed the attachment to file hack. The hack can sucessfully install and all attachment can load to file in attachments folder. But there are some problem........
1. Cant retrieve those attachment when I delete all data in attachment.filedata after hack installed (all attachement transfer as file in specified folder) .!!!!!
2. Seems those data still upload in database. !!!!!
I need help ASAP.. any one can help me? Thanks a lot
sumandy
04-11-2003, 02:35 AM
Urgent need PPN help.. or any other great hacker !
I'm now using VBB2.2.9 and installed the attachment to file hack. The hack can sucessfully install and all attachment can load to file in attachments folder. But there are some problem........
1. Cant retrieve those attachment when I delete all data in attachment.filedata after hack installed (all attachement transfer as file in specified folder) .!!!!!
2. Seems those data still upload in database. !!!!!
I need help ASAP.. any one can help me? Thanks a lot
GlitterKill
04-11-2003, 12:10 PM
I successfully installed this hack but right after doing so the load averages on my site increased dramatically from around .5 to 1.5. Any ideas as to why this is happening?
sumandy
04-12-2003, 03:12 AM
No one can help me????
Tim Wheatley
04-23-2003, 09:29 PM
Maybe can help someone...
http://www.vbulletin.com/forum/showthread.php?postid=445219
sumandy
04-24-2003, 01:17 AM
Thanks. go to take a look! :D
Today at 06:29 AM Tim Wheatley said this in Post #318 (https://vborg.vbsupport.ru/showthread.php?postid=386116#post386116)
Maybe can help someone...
http://www.vbulletin.com/forum/showthread.php?postid=445219
Tim Wheatley
04-24-2003, 08:36 PM
I'm using 2.3.0 by the way, I installed the hack using the file in the 1st post of this thread on an unhacked 2.3.0 and altered the tables as shown in the thread link I posted above, worked for me. BACKUP though if you try it. My host backs mine up every night. :)
jjj0923
04-26-2003, 07:43 AM
I installed this hack on 2.2.9 AND have the hack that allows people to add attachments on editpost an ran into a small problem.
with a combination of this code from this hack and also the add attachment on edit post I was unable to add a 'new' attachment when editing a post. No problem replacing an attachment or deleting an attachment that was placed in the post via newthread or newreply.
Therefore I cam up with following few lines that fixed the problem in editpost.php
add this bit of code:
--------------------------
if ($attachment != '' and $attachmentaction < ' ')
{
$attachmentaction = "new";
$postinfo[attachmentid] = 999;
}
-----------------------
before:
-----------------------
if ($postinfo[attachmentid]!=0) {
// check attachment status
// keep, delete, update
-----------------------
Don't worry about the $postinfo[attachmentid] being set to 999 because a new ID is calculated later in in the code by calculating the next available key value in the attachment table primary index.
jjj0923
04-26-2003, 07:47 AM
hey Scott, one small question...
why didin't you just use attachmentid as the file name?
- jeff
jjj0923
04-26-2003, 08:02 AM
by the way - this is a great hack. My attachments table had grown to over 400 mb alone. I never liked the idea of keeping binary data (blobs) in a sql server table.
I have also created my own hack to use mogrify to automatically reduce the size of uploaded images and avatars on my forum and my users love my site. They have no idea about how their attachments are stored but it's pleasing to me to have them as separate files instead of cluttering up my database.
:)
Preech
04-26-2003, 07:02 PM
about 8 million people asked this question
no one answered yet
but
how do you fix this???
"Warning: fwrite(): supplied argument is not a valid File-Handle resource in /home/hhapdotcom/www/airplay/admin/attachment_install.php on line 333"
its in the IMPORT portion.
roninuta
05-02-2003, 02:42 PM
Installed on 2.2.9 and working well. Thanks
Nickos
05-06-2003, 08:04 PM
my problem
Parse error: parse error, unexpected '}' in /home/xxx/public_html/forums/admin/functions.php on line 1819
here are the lines around there
$DB_site->query("INSERT INTO attachment (attachmentid,userid,dateline,filename,filedata,vi sible) VALUES (NULL,$bbuserinfo[userid],".time().",'".addslashes($attachment_name)."','".addslashes($filestuff)."','$visible')");
$attachmentid=$DB_site->insert_id();
}
return $attachmentid;
}
// ###################### Start getmodpermissions #######################
function getmodpermissions($forumid,$userid=-1) {
// gets permissions, depending on given userid and forumid
global $DB_site,$bbuserinfo;
i cant even get in my admin control panel
Nickos
05-06-2003, 08:08 PM
the whole forums are not working now... going to the main oage i get this errors
Parse error: parse error, unexpected '}' in /home/xxx/public_html/forums/admin/functions.php on line 1819
Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/public_html/forums/admin/functions.php:1819) in /home/xxx/public_html/forums/admin/functions.php on line 1573
Fatal error: Call to undefined function: makelogincode() in /home/xxx/public_html/forums/global.php on line 371
Dean C
05-07-2003, 03:47 PM
You've applied some part of the hack wrong :)
You have an extra } somewhere
- miSt
Preech
05-11-2003, 02:50 AM
04-26-03 at 04:02 PM Preech said this in Post #324 (https://vborg.vbsupport.ru/showthread.php?postid=387571#post387571)
about 8 million people asked this question
no one answered yet
but
how do you fix this???
"Warning: fwrite(): supplied argument is not a valid File-Handle resource in /home/hhapdotcom/www/airplay/admin/attachment_install.php on line 333"
its in the IMPORT portion.
anyone ? :(
One thing i noticed:
During the installation, set your attachments folder RELATIVE TO THE ADMIN FOLDER, then import the files and then set it relative to your root folder. That will probably fix the above error, assuming the folder is chmodded correctly.
Courage
05-16-2003, 08:42 PM
On a new vb 2.3.0 all is working OK, but
If I attach a file, then edit and add a new attachement, on my ftp i can see 2 files. The old file is not deleted !
Courage
05-19-2003, 02:44 PM
It seems that suport for 2.3.0 is missing :(
Scott missed adding removeattachment() in a few places in editpost.php ;)
Courage
05-19-2003, 06:04 PM
@rake
Solutions ? :D
angelo70
05-27-2003, 10:48 PM
The user who uses the Advanced Attachmentbox v1.0
(https://vborg.vbsupport.ru/showthread.php?postid=375998#post375998) HACK:
functions.php
FIND:
$DB_site->query("INSERT INTO attachment (attachmentid,userid,dateline,filename,visible,has h) VALUES (NULL,$bbuserinfo[userid],".time().",'".addslashes($attachment_name)."','$visible','$attachment_hash')");
and replace it with:
$DB_site->query("INSERT INTO attachment (attachmentid,userid,dateline,filename,filedata,vi sible,hash) VALUES (NULL,$bbuserinfo[userid],".time().",'".addslashes($attachment_name)."','$filesize','$visible','$attachment_hash')");
Open Showthread.php
Search for this (2 times on a unhacked vB, Line 55 , 410):
attachment.counter
and replace it with:
attachment.counter,attachment.filedata AS attachsize
displays the filesize of the attachments :rolleyes:
Intex
05-29-2003, 12:14 PM
Is it possible to get an explanation of what happens during the installation process. Obviously files are going to get saved as attachments, but it doesn't say anything other than that on the thread or instructions. Specifically it would be good to know:
Does this apply to attachments from once this hack is installed
If it does go through the database and store them as files, how do you control where they go?
How are these linked
Thanks for any help.
1. Yes. Attachment are ported during the installation process.
2 and 3. Only the [data] is stored in files. Other information related to attachments is still stored in the database.
Intex
06-01-2003, 05:18 PM
Thx for the reply rake. However, can you specify what folder these attachment files are stored upon installation / after installation?
minder
06-09-2003, 01:17 AM
just installed it on my 230 board with no problems thanks for a great hack
rob
Tim Wheatley
06-13-2003, 06:01 PM
04-05-03 at 10:42 AM Scott MacVicar said this in Post #302 (https://vborg.vbsupport.ru/showthread.php?postid=377743#post377743)
and there has been 2 users who upgraded to vB3 as well as using this hack, I provided a script to do so and you only need vB 2.2.9 to upgrade to vB3.
Any news on this for the beta 3?
Tim Wheatley
06-13-2003, 06:47 PM
As I'm only testing I've empted the attachment table and wiped the line in the post table also, hopefully we can get the conversion for the next version?
Thanks.
ptenthus
06-14-2003, 01:48 PM
Any idea when a conversion script to get a production board's attachments into the new vB3 format will be released?
I'd imagine that, even in beta, that this should be something that could be written now (not much chance of a change in data format during the beta process, right?)
gmarik
06-14-2003, 04:14 PM
Yesterday at 11:01 PM Tim Wheatley said this in Post #340 (https://vborg.vbsupport.ru/showthread.php?postid=408576#post408576)
Any news on this for the beta 3?
The same question. :disappointed:
Tim Wheatley
06-15-2003, 06:23 PM
Scott has uploaded it here:
http://www.vbulletin.com/forum/showthread.php?threadid=73467
:)
bitbender
06-16-2003, 06:06 PM
THANK YOU. :)
roxics
06-16-2003, 07:18 PM
Does this limit file size uploads? What I mean is do you still have to edit PHP to accept larger file size uploads? I'd like my members to be able to attach videos up to 20MB's or more.
bitbender
06-17-2003, 04:20 PM
Ok, I must have missed something. I have attempted to follow the path of redemption, and get my attachments working under my VB3.0 beta test. I am one of the hundreds that enjoy the attachments as files hack.
Took a good backup from 2.3.0 and restored it to my test server.
Added the filedata column back to the attachment table via phpmyadmin;
ALTER TABLE attachment ADD filedata mediumtext NOT NULL
Ran an optimize on the attachment table (if I didn't, MySql kept getting 122 table handler errors at insert after a number of inserts)
Ensured that the current value for the VB setting field 'fileattach' was correct, and pointed to said directory where all the attachements were
Executed the attachment_upgrade.php from /vb22/admin directory (no output does it make to the panel, just a blank screen after it runs for about 3 minutes and then says "done" in the lower left )
Verified that 'filedata' column in the attachment table was populated with data via phpmyadmin
Ran the VB3 conversion (upgrade.php) on the DB, and yes, it worked thru the attachments, and then updated another table related to attachements
What I am seeing in my VB3.0 beta is broken links for the attachments. It "thinks" it got them, but in reality the file sizes are zero for the attachements (when you disable viewing of attachements, it gives a handy link with file size instead)
I really, really like what I have seen so far of VB3.0, but I gota beat this 1000 pound gorrilla where the attachments as files hacks is concerned.
Any ideas? If any one wants a look, let me know, as I have it locked down to stay in compliance with the "no public" rule :)
shorty
06-20-2003, 05:23 AM
Hello BB .. have you enabled attachments as files in the VB3 backend?
Im gonna run this on my dev board then upgrade it to VB3 later.
I really wanna run it over at Short-media. Been live for two weeks and the forums db is over 300mb already :ermm:
Il let ya know how I get on. You are still on VB 2.3.0 aren't you?
dssstorm
06-21-2003, 02:57 AM
I installed the hack and all my dl are 0kb any insite?
bitbender
06-21-2003, 12:11 PM
Yesterday at 01:23 AM shorty said this in Post #348 (https://vborg.vbsupport.ru/showthread.php?postid=410926#post410926)
Hello BB .. have you enabled attachments as files in the VB3 backend?
Im gonna run this on my dev board then upgrade it to VB3 later.
I really wanna run it over at Short-media. Been live for two weeks and the forums db is over 300mb already :ermm:
Il let ya know how I get on. You are still on VB 2.3.0 aren't you?
You dont have much choice, bud. You HAVE to load the attachments back to the DB, BEFORE you run the VB3 upgrade. The Upgrade.php will process only attachments that are in the data base.
Then, if that part WORKS right, you can go thru the part that moves them BACK to files via the attachment manager functions. But, neither worked, for me.
And I kind of figgured that, if it didn't display them properly and showed all zero file sizes when the attachments had been moved back to DB. When I used the VB3 admincp "backend" (as you are calling it, I have no idea what you meant) to move them back out, of course that failed too.
0 + 0 = 0.
The attachments folder in vb 2.3.0 (yes, I got the attachments as files hack working there, too) is close to 1GB in size.
Any real insight into this matter would be very helpful.
ranger2kxlt
06-21-2003, 02:20 PM
Was wondering if this hack is kinda like what vb3 does now? It saves attachments as files and your database size will be greatly reduced correct? But Diskspace will be increase??
The main benefit that i can see and want is ease of transfering to a new server without dealing with the attachments in the database. Let me know.
Sabrina
06-23-2003, 09:55 PM
Oh my god, you do not know what this hack has done to my forum! THANK YOU SO MUCH!
I had to disable attachments due to such a large database, anyways, this is a miracle hack!!
Very good work! Best Hack Ever Made!!!
:banana: :banana: :banana:
john_rsd
06-26-2003, 03:43 PM
After some problems initially the hack now works on my 2.3.0 test site & I have tried attach, edit & delete attachments.
Although I delete an attachment in a post, or delete the whole post itself, the file attachment still remains in the /home/mystuff/attachments folder
Why does it not delete the attachments at the same time as the thread?
Have I missed something in editing another file?
Thanks
john
any idea when the attachments as files hack will be ready for vb3?
WCW Fan
07-15-2003, 02:48 AM
Im just wondering if this is even worth installing alot of people have had errors so is it worth installing
ontherun
07-25-2003, 05:32 PM
This is a excelent hack, but I need to uninstall it and placed files back into the data base to upgrade to vB 3.0 Beta 4 on my development site.
Is there a easy way ?
ontherun
07-26-2003, 05:55 PM
06-30-03 at 08:22 AM skc said this in Post #354 (https://vborg.vbsupport.ru/showthread.php?postid=414207#post414207)
any idea when the attachments as files hack will be ready for vb3?
skc vB 3.0 has this hack built in as of beta 4
bitbender
08-07-2003, 04:57 AM
WOOOOOTTT!!!
FIxed as of Beta 5 for me !!
W000TTT!!
PARTY ON !! :) ( i know, it doesn't take much for me)
shorty
08-07-2003, 05:32 AM
Today at 06:57 AM bitbender said this in Post #358 (https://vborg.vbsupport.ru/showthread.php?postid=424013#post424013)
WOOOOOTTT!!!
FIxed as of Beta 5 for me !!
W000TTT!!
PARTY ON !! :) ( i know, it doesn't take much for me)
If this is true.. Im installing this hack tonight!
Thanks for the information BB that it works with beta 5.
bitbender
08-07-2003, 02:36 PM
Today at 01:32 AM shorty said this in Post #359 (https://vborg.vbsupport.ru/showthread.php?postid=424018#post424018)
If this is true.. Im installing this hack tonight!
Thanks for the information BB that it works with beta 5.
Yep, it IS true !! It was Soo true I did it three times!! (ok, so I couldn't sleep last nite)
Be SURE to follow the instructions closely, and be patient.
MY issue was that even thou I altered the attachpath variable to be the CORRECT value, the cache was still point back to the place I restored it FROM (an invalid path).
So, I flushed cache, and ran again, and log and behold, it worked just fine.
So....here is what I did. Create a backup (I have a cron script, but it's the same as reccomended by the VB3.0 upgrade) Create a database for VB 3.0 (if your host only allows one, of course you cannot do this) Restore the new DB using the backup just made (Skip this is you only have one DB available to you) Using PHPmyAdmin, add the field filedata back to the attachments table;ALTER TABLE attachment ADD filedata mediumtext NOT NULL Run Repair, and Optimize on the attachment table using the functions in PHPMyAdmin Again, using PHPmyAdmin, select the settings table, and locate the variable attachpath Edit this to ensure you have the CORRECT path there. What's key here is that it is an absolute path;For my installation it was;
/home/virtual/site22/fst/var/www/html/vb30/attach_folder Execute admin/attachment_upgrade.php - On the BBF test Server, a full copy of VB 2.3.0 was already place in the VB30 directory structure, so that prior to the VB30 cutover I could still access it as 2.3.0. The script attachment_upgrade.php depends on the vb 2.x struture to be intact and in place to work correctly. Believe me, I called it's bluff. Once That completed, I proceeded thru the install/upgrade.php, no issues, or worries, straight thru. It DID take some time, as 1.3 GB worth of attachment files takes a bit of time.
Next up? Pushing them BACK out to the file system, along with the Av's!
PARTY on VB!! I'm renewing today! Totally pleased, am I!
shorty
08-07-2003, 02:45 PM
Perfecto mondo. BB you never cease on enthuiasm :D
Im gonna hack the attachments out of Short-Media's 2.3.0 until VB3 is ready and then I shall use your (now bookmarked) guide to getting them back in for the upgrade ;)
Sweet! Gonna dump 250mb of attachments into the filesystem.. take that FreeBSD :p
Mistah Roth
09-21-2003, 07:27 PM
Alright I installed the vb3 Attachments hack a while back - the one that lets you post multiple attachments and such. Now I just installed this hack as well, and low and behold the two conflict with each other.
The thing is, old attachments work fine after I did that scan thing to them all, but when I try to post new attachments I get a bunch of errors:
Warning: filesize(): Stat failed for /home/virtual/site4/fst/var/www/html/attachments/.file (errno=2 - No such file or directory) in /home/virtual/site4/fst/var/www/html/attachment.php on line 59
Warning: fopen(): Unable to access /home/virtual/site4/fst/var/www/html/attachments/.file in /home/virtual/site4/fst/var/www/html/attachment.php on line 60
Warning: fopen(/home/virtual/site4/fst/var/www/html/attachments/.file): failed to open stream: No such file or directory in /home/virtual/site4/fst/var/www/html/attachment.php on line 60
Warning: fread(): supplied argument is not a valid stream resource in /home/virtual/site4/fst/var/www/html/attachment.php on line 61
Warning: fclose(): supplied argument is not a valid stream resource in /home/virtual/site4/fst/var/www/html/attachment.php on line 62
Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site4/fst/var/www/html/attachment.php:59) in /home/virtual/site4/fst/var/www/html/attachment.php on line 68
Any thought as to getting the two hacks to integrate together? Or anyway to fix the problems im having?
Hoffi
09-22-2003, 08:37 PM
Great. The Uninstall works perfectly.
PAINTBALLM
10-14-2003, 04:10 AM
Database error in vBulletin Control Panel 2.3.2:
Invalid SQL: UPDATE attachment SET hash='3315f4bdf94d848b53a3ef8756408772' WHERE attachmentid='1'
mysql error: Unknown column 'hash' in 'field list'
mysql error number: 1054
Date: Tuesday 14th of October 2003 01:04:06 AM
Script: http://www.paintballmessage.com/forums/forums/admin/attachment_install.php?s=&step=9&total=&pergo=
Referer: http://www.paintballmessage.com/forums/admin/attachment_install.php?s=&step=8
When I try to import my posts from the database, that is the database error im getting. It also says there has been a problem attaching the file when you try to make a new post within the forum. The path is set correctly, and I have tried uninstalling and it wont let me.
Please help me get this beast working ;)
PAINTBALLM
10-14-2003, 04:38 AM
ok I figured that out, i had to execute the lines manually..
Now I have this problem..
Warning: fwrite(): supplied argument is not a valid File-Handle resource in /usr/local/psa/home/vhosts/paintballmessage.com/httpdocs/forums/admin/attachment_install.php on line 333
PAINTBALLM
10-14-2003, 04:39 AM
Warning: SAFE MODE Restriction in effect. The script whose uid is 14426 is not allowed to access / owned by uid 0 in /usr/local/psa/home/vhosts/paintballmessage.com/httpdocs/forums/admin/functions.php on line 1949
Warning: stat failed for /attachments/b0e10845b2e4ad1d63087a7ab2f1cd6c.file (errno=2 - No such file or directory) in /usr/local/psa/home/vhosts/paintballmessage.com/httpdocs/forums/admin/functions.php on line 1953
And that when I try to make a new post
PAINTBALLM
10-14-2003, 04:52 AM
Ok got it all fixed on my own ;) Im good, lol...
One more question, can I drop the file data or not, if so whats the query to do it? If I ever want to upgrade to a vb3 board, would it effect anything?
PAINTBALLM
10-14-2003, 05:21 AM
grr ok one more that I cant figure out.. When you go to delete a thread that has attachments in it...
This is what it says..
Warning: unlink() failed (No such file or directory) in /usr/local/psa/home/vhosts/paintballmessage.com/httpdocs/forums/admin/functions.php on line 2001
I looked up line 2001 and it was this area:
// ###################### 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);
}
It deletes the thread, its just returning that error, and its bugging me... Please help me
todd.o.callen
10-16-2003, 04:11 PM
I have been running in 2.2.9 in production for months with this hack working perfectly. All of the sudden, this week, attachments stopped being accepted. We ran the repair.php routine to repair and optimize the tables, and this seemed to help temporarily, but the problem has recurred, and now the "fix" isn't working either.
Where do I start looking for clues as to the problem?
I have checked permissions on the forums, on the attachment directory, disk space, etc. No clues there. Since our company uses vBulletin for document control and we have an ISO9000 audit coming up next week, I am in a panic.
Please help?
todd.o.callen
10-16-2003, 06:32 PM
I have been running in 2.2.9 in production for months with this hack working perfectly. All of the sudden, this week, attachments stopped being accepted. We ran the repair.php routine to repair and optimize the tables, and this seemed to help temporarily, but the problem has recurred, and now the "fix" isn't working either.
Where do I start looking for clues as to the problem?
I have checked permissions on the forums, on the attachment directory, disk space, etc. No clues there. Since our company uses vBulletin for document control and we have an ISO9000 audit coming up next week, I am in a panic.
Please help?
No error messages, no attachment queue issues, either.
Here's my.ini:
[WinMySQLAdmin]
Server=C:/mysql/bin/mysqld-nt.exe
[mysqld]
datadir=E:/mysql/data
set-variable = max_connections=450
set-variable = key_buffer=16M
set-variable = myisam_sort_buffer_size=64M
set-variable = join_buffer=1M
set-variable = record_buffer=1M
set-variable = sort_buffer=2M
set-variable = table_cache=1024
set-variable = thread_cache_size=256
set-variable = wait_timeout=9600
set-variable = connect_timeout=10
set-variable = max_allowed_packet=16M
set-variable = max_connect_errors=10
and my phpinfo:
todd.o.callen
10-16-2003, 08:58 PM
Update: We restarted the mySQL service, and this didn't help. On a hunch, I deleted some bogus threads with attachments, and this seemed to unlock the problem, at least temporarily. I think there have been more successful attachments than I deleted added since then, so I seriously doubt that there was some magic ceiling number out there, but I will continue to watch it carefully.
gmarik
10-19-2003, 04:48 PM
So it is working no problemo on 2.3 and I could upload my board to 3.0, not loosing the attachment info, correct?!
PAINTBALLM
10-21-2003, 04:51 AM
I have a question, how exactly will I be able to upgrade to VB3 when the gold is released without loosing any attachments... Please instruct me, thanks!!!!
Also, I am confused about something, when I post 2 posts with attachments right after each other if the comments are the same for both posts, it erased the post I just posted.. Or it will save it but use the picture that the last post used...
But if I put "." in my first post and upload 1_pic.jpg in that post... Then put "...." in my second, with 2_pic.jpg, it will work fine.. The description/comments for the post just has to be different. How can I fix this? Sometimes when my users post pics, they just wanna put a - or a . beacuse its a pic only.. In vb3 we wont have to worry about this, but for now we do.
ontherun
11-22-2003, 12:09 AM
I'm a little confused here, this thread started out Attachments as files and I see where
somewhere along the way multiple file attachments per thread was added.
MaN hOW cOnFuSiNg when trying to figure out how to do anything with each of the different hacks.
one post is about the original and the next is about a similar but different hack. How the
heck do you keep it ...................(just my rant ... I'm to organized I guess)
I really came back to this area to find some help to remove the ORIGINAL Attachments as files
hack that allowed files to be stored in a folder not the database. You see I have been running
it for a long time.
I want to move to vB 3.0, but to do this you have to get the files back into your database.
Now if one of you good users or vB pro's can point me in the right direction I would be forever
grate full................
I see that there are 2 php files one is the installer that will do a uninstall, but it does not reset the db or move the files back into the db.
attachment_install.php - the file that was used to install the hack
attachment_upgrade.php - the (fix) filke that you can put the files back into the db
The 2nd one is supposed to put your files back into the db, but all I ever get from this file is php errors about files and line numbers that are not there.
So I you can help PLEASE show me the way.........................to get the files back into the db.
Thanks
One toke over the line ..........in this thread
ontherun
11-23-2003, 12:12 AM
I have gotten down to the point where attachment_upgrade.php appears to run and then quites with this error.
Fatal error: Allowed memory size of 8388608 bytes exhausted at (null):0 (tried to allocate 2885154 bytes) in /var/www/html/forums/admin/db_mysql.php on line 245
Line 245:
echo "<form><textarea rows=\"12\" cols=\"60\">".htmlspecialchars($message)."</textarea></form>";
The current db is only 4MB and and the attachment folder only holds 95.5 MB
HELP!
Any solutions sure would be helpful.
Thanks
ontherun
11-23-2003, 04:04 AM
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
Ok we have followed, read and posted until my fingers hurt.
PLEASE ............. I need to get the files back into the db
I have added the filedata table
ALTER TABLE attachment ADD filedata mediumtext NOT NULL
I have used attachment_install.php and did a uninstall
I have ran the attachment_upgrade.php
Nothing is working ......... I need to get the files back to the db so I can roll vB 2.3.0 to vB 3.0 beta 7
ontherun
11-23-2003, 04:24 AM
How about a few lines to let us know that your alive and still around?
DO I ?????????
1st - run the attachment_install.php and uninstall the hack
2nd - run the attachment_upgrade.php to get the files back to db.
We have remove all other hacks and vbportal and site is running great...........but we can upgrade to 3.0 until we get the files back into the db.
bitbender
11-29-2003, 10:07 PM
Hello All,
I just rebuilt my VB 3.0 from Beta 7,with VB 2.3.0 as input to verify the 'documented' attachments procedure I had used before(for my own sanity). I had not yet read the other methods beyond attachment_upgrade.php. I used a new data base, and a seperate directory structure for VB 3.0. The reason I do things this way is that the test and live Board are really two different virtual sites on on my rack, so they have differnt HTML structures. It also helps to make sure I don't stomp on my live board, because it uses a different DB names and users.
I'd like to know if the way I'm doing it is backwards, or ok. Seems to be working ok, but I have not yet tested using the file system store in VB3.0.
Copy live VB directories to a dummy set, ie vb23 Update vb23/admin/config.php to reflect new data base name bitbender_vb30 Backup "live" DB using mysqldump from SSH Drop data base name bitbender_vb30 using MySqlAdmin from SSH Create data base name bitbender_vb30 using MySqlAdmin Grant Permissions to Db User using MySqlAdminfrom SSH Restore to data base name bitbender_vb30 from backup using MYSQL from SSH Used PhpMyAdmin and edited data base name bitbendertest_vb30 to; ALTER TABLE attachment ADD filedata mediumtext NOT NULL Change the settings field attachpath to point to correct directory structure /html/vb23/attach_archive Ran REPAIR.PHP against the data base bitbendertest_vb30 from the vb23/admin folder Copied attachment_upgrade.php to my vb23/admin folder Edit the attachpath within the exec to ensure it is the same as attachpath above Copied the attachment directory from live board to duplicate VB 2.3.0 structure /html/vb23/attach_archive I had some server Issues - (you may NOT need to do this part); Altered PHP.INI to allow for 360 seconds max execution 16M total script consumption. Adjusted my.cnf in /etc to allow a max_allowed_packet=4M
This was required due to the size of some of the crap in my attachment folder. Because I had to make adjustments, I needed to restart some stuff.
Stopped apache
Stopped MySQL
Started MySQL
Started Apache
Ran /html/vb23/admin/attachment_upgrade.php This took about 15 mins for me (575Megs of attachments)
Uploaded VB 3.0 Beta 7.0 to VB30 folder ===>vb30 ======>/admincp ======>/ and so on
Altered vb30/includes/config.php for new DB user and data base name bitbender_vb30
Ran vb30/install/upgrade.php
Once all done and working, delete /vb23 directory
And it worked. If you would like to see, let me know, and I can issue a guest id to let you see. Now, since we can put a worm on a hook ten ways and a fish will still bite, who knows.. comments any one??
DaveRobbo
01-21-2004, 08:19 AM
Is there still any support for this hack? I have a few questions...
Firstly I would like to know if this supports attachments with the same name? If one user uploads a picture called "image.gif" followed later by another user uploading a different attachment with the same name, does the original get overwritten? Or is this handled correctly?
Also, what is the best way to maintain and prune these attachments? If I go to the upload folder and delete the attachments I no longer wish to keep, is the code smart enough to notice or will my pages be full of the dreaded "little red X" ?
Alternatively is there another way of maintaining the attachment store? On our forum we don't wish to do regular complete purges of attachments - there are some old ones we may wish to retain (semi-)permanently but others we wish to purge out regularly.
Any help would be much appreciated - our current attachment datebase is rapidly getting out of hand!
I used to use the old "admin functions" hack which allowed attachments to be deleted from the database from ACP - but because of a change in my ISP's caching/proxy strategy, this now has to reload the list page everytime rther than returning to a cached version and so it has become almost impossibly slow to go through and selectively delete many attachments.
Dave
DaveRobbo
01-22-2004, 01:42 PM
Anyone???
EzX5U
01-30-2004, 06:34 PM
hi
for anyone installed this hack..
can i choose where to enable or disable this feature in the forum?
can i allow mods or admin only to use it??
thx
waiting a reply..
gmarik
02-03-2004, 04:17 PM
Completed readmore3o.gif
P,BODY{FONT-FAMILY:tahoma,arial,sans-serif;FONT-SIZE:11px;}ЛnI6Х ѕЩкЗ\0јФ o5ЙyР*І67KMЮеєюDХJПШ\"kЩЋ#bэXаАb§uёт¶jЊ6cд\0П№\0zЁђ «}52о^ѕ[л°uъаУљпН \\1G Ѓ
Eѕ«Q<0ьЖUE$ЌH?ЃЗЌVФ*еОкЮЮ,2љщcЋ1 A^w YЦК:Pњ\0Э·Їnв№ЩИ©qrЇµgВprCю|ац дgЦґґ;oнYк72°\"dЇ иqФМЧ ¦Э<^\'ФE»4К»7P%UAЏB;ьЗ5и^ qasz<ҐPєFгЄА§\'УЊюuЮиццВy#+`бqњ*Џ G_»ЗгQЯ°Чu
±bC+7 @=NqЗЇ¦+ѕчѕ(0*Аёљ\"СКџГeAоyБoс®ГLУPDосG0 т2КLvQи9ьjЮ±i|I_*VЗpvь«ПМ{њzњbЇ 04v°YAhтЫГ6rXу№ЬuЙ=ыtⶬ ¬ч`YК¬И6ѓњ(8зѓЫ¶~ѕВ¶E¤±±i/&»\"Џи§ЅgjђЪЭ\'$x¤щЋнCйЛџэjТ ХJE!ђH0Јnвюлн[єnњBоb®дя\0«>џэjЅ4^6Шu·Џeя\0бK%јoo%ґGpог§ѕ GOjЙіi4ЌNMр4¬уOьфык=GlУх\0 ,ЇVЃСў\0Иу-іHя\0pњэ+°QQ|U=©ў4fmт[°ф©ћЛЋzУyк\0ТћфЭЗ|SБcRЇJCАг* !ЙгЉiля\0Ц¬]\\AqvЈycmu-ы±ЗVця\0=№џЯЖє|Т!c:lC#lGbpoVдр:w¬ ќ КKдёb8DЫX0одгЫ?З^YЫ[ЃјLU Ъ dю}7uЦЬ«Иc@b&x\'їФ3Ћ§ҐTюСbb·Уb bИxыПьRУу?Тіcэ¤чRµеМБ·9Э Іw>ЉфЖO~9С{[У+M-шҐ;жaюЮЁ%Нw-лЁЬf»}±юлфЁоЇs,Чnc@Hт!П№#$}j¤2I (/i\0%С Јюєї¦iџЩгМуS1$олёп+ба NbЋ< ДћpЫЙъ»бпZpЗе`ѕдCОжі{n}ЈтSE t),jP»¦bКsйњщWћxNљ;|Щ6`с¶6ф=zя\0 Jуп\"Hј5 ЁH ЌK|Щщ@9лЧµ7бЃ»бKFо±°YP6ЬбWi9ЗL° эkњс ќЌЅееіИіM$њп ЄзЋHRN<Ч¦шR%¶тнаUы6џo$\0 аqнЖGвkjБ¤ЮY^c|ґзЬЈђЂg©=qэkS[Љ-#Г2НЫЯ]#ZФ~хYИЄ0@ Б9W?б] БdZ]ќЫїЧЅыћћЭl0FFн3
vЪ¶гймѕ«{ ёHЛ3f>дрх5uјјEg§ -оe_љVбЏLџ§aя\0л*(¬¬?gљЪ\'1ЏХ¶° сщfЈKY-.¤МнbFЃ TѕgЪЪ+і п Ўv%x?LгЦ·¬mн4ґЩlѕdд|ОЭ@ф?ЭФ eМќМxИпЃЪ¦ЋЮIЧК¶КЗРїLХп.8\" ;Џlх>юµ®ЩґђҐм`µМ\'r/gФъдV=µтЩБђmXо
Iж6?z>уЏN;Wgl ИіОбЗaRЫп(Lёг*JЅHЙ>ґёд qP{P<\0љ^ЅM\0uдRvйXчЃ~ТЦv°\"®|ЫЫ
9зж=эOя\0®ёя\0]%ЫШAЂБ5Ш*зпМ%њ{d vвЈС3.љ7 fw IЪШn$ю8ЮЇ¦xКЫБцh0f;Ь·Рw\0F*З f*эЇ.Р ІLv¤h9ЅШњухъQ:L±¤Гq-М ђp¶ййЂ^§ЧѓЃNпSRђYµ№ЪJ$(]Ђч a~јU]іМщё<ґqююR3РАъжњa*Пx*¤sВcПёaЫеP\\ Hњ<сTь^џ:OЄЖ>Uюtа/.Л-ІЗьј_°XЗыЄxэ Jљ{Л!№ј\0к<GСЫж#ЭEjiЪ\\a S,¤eЌєgџy_шR8ЮBsз$D¦yOХЏJОјЅ·v1 i$<љ_Ї§OРЦ.*cЈњ
and there is stops
jjj0923
02-04-2004, 03:39 PM
in the for what it's worth department... I have been using this hack for almost a year now and no problems whatsoever...
:)
ErryLee
02-22-2004, 09:58 AM
:nervous:
Hello!
I hope someone can help me. At first: Sorry for my bad english, I´m a german user.
Version 2.3.4 (german)
I have installed the hack and everything is working fine. No error message at all.
>>>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<<<
But in the folder is nothing importet. The attachment folder is empty and in the forum is no attachment left.
Thank you for help,
Soeren
Slybone
02-22-2004, 12:30 PM
I hate to be the stupid one.... but this hack does what exactly?
ErryLee
02-22-2004, 01:38 PM
Hi!
I did what the hack says to me:
At first I do the changes in the php files: attachment, editpost....
Then I make a folder "attachment" with stetting 777 and give the directory path in the admin control.
After that the hack imports the files in this folder.
But the folder is still empty.
Thanks
Soeren
ErryLee
02-25-2004, 03:01 PM
No one can help me?? :disappointed:
TranceMaster
04-26-2004, 06:41 AM
hi guys, got some problems here, im looking to uninstall this hack, but dont have a clue where to start.
but we really need it uninstalled, for now.
how do we go about doing so?
or how to do with it whilest upgrading to newest version
thanks in advance.
bitbender
04-26-2004, 10:04 PM
Erry - You need to run the portion of the hack that copies the attachments across. If you have placed the remainder of the code properly, it will place any NEW ones posted as binary attachment files in there. If the folder is empty, then the copy from the Data Base wasn't done. This will also be painfully obvious, because any attachments will display only red x's too. If you are still seeing your attachments, well, something else is afoot. I'd review :)
Trance Master - As with any hack, you must reverse the changes to the code. How you get the attachments back into the data base is a seperate discussion. First, you will need to make sure your hosting allows for the increase in size of the DB, and then, you will need the attachment _upgrade.php mentioned earlier in this thread Here (https://vborg.vbsupport.ru/showpost.php?p=424106&postcount=360).
But that is only PART of the process. You will need to regress each part of the hack as it instructed you to apply it to all the php scripts, lest it will fail. Now, if I remember right, this was a very well documented one, so you can get a good visual of what needs to be replaced, becuse the hack tells you to look for this and replace it with that.
Good luck. I will be regressing mine when I go to vb3, as I have a ton of other hacked code thruought, and I am not changing any of mine, it's better to just go with it in the DB with vb3, and I have made it part of my conversion process :)
highlander_RD
05-23-2004, 10:44 PM
I run vB 2.2.9 in my forum http://forum.egcommunity.it
This hack is *absolute necessary* as inserting the attachment files in a table field it's a madness. I actually hold in my forum about 15'000 image files that occupy ~400 MB. I followed the hack procedure as indicated in post #1 and I succeded to import tons of files in my new admin/attachment directory (chmod 777).
But... I got 2 problems:
1) when I read the attachment post (showthread.php), I cannot see anymore the preview image (I get the usual IE 6.0 broken image frame) whereas I can see, once clicked, the full size image in the popup page (so the attachment link works).
I tried to force a cache refresh by ctrl+F5 with no results.
2) I don't know if it depends on 3 previous attachments hacks:
-> the private attachments in PM hack (by Chen 'FireFly' Avinadav)
-> the admin CP browsing attachments hack (by Kevin https://vborg.vbsupport.ru/showthread.php?threadid=23692)
-> the "who downloaded" hack (by Chris Bowyer)
I know that it's maybe too late to get a help, but any suggestions are welcome.
Thanks,
Kamui Shirou
04-16-2005, 12:04 AM
Hey,
nice hack, but somehow my hash for the files disappeared. now it only shows a red cross. how can i get them back. the files are still in the attachment folder, it's only the hash query in the database.
Marco van Herwaarden
04-16-2005, 06:35 AM
I hope you are aware of the fact that this is a hack for vB2?
jjj0923
08-26-2005, 02:13 PM
I've been using this hack for over two years now and just ran into my first problem... the datatype for the index field "attachmentid" is tinyint - length 5 and my forum members have posted 65,535 images to date and now they cannot add any more...
I'm reluctant to go in and change the data type to medint or integer and expand the length of the field without consulting with someone first. Has anyone else run into this problem and if so - how did you get around it.
upgrading to V3 is just not in the card for me until the end of september because of a very busy schedule..
any help would be appreciate - especially if you are using this hack on V2 and have oversome this problem yourself..
thanks in advance...
- jeff
Marco van Herwaarden
08-26-2005, 03:31 PM
I don't know the code, but it is very unlikely that the code will fail if you change the datatype to a longer integer type.
But you better check if there are not other tables that are refering to the same column, they would have to be changed also.
jjj0923
08-26-2005, 10:35 PM
well - the length is 5 character does a medint or integer fields require more characters?
Marco van Herwaarden
08-27-2005, 07:46 AM
Are you talking about usable 'characters' (positions) or internal storage in the database?
Yes it will increase, that is why it will be able to hold a higher value. And like i said, modifying all columns in the database that reference this column should probably be enough.
Azeem
09-15-2005, 01:41 AM
Hi so which directory do I upload this to? (Newb here) and wil this solve my problem of not being able to upload large files (on shared hosting cant change max upload size)
Zachery
09-15-2005, 06:07 AM
You know this mod is for vBulletin 2 and is a default feature for vB3 ;)
bitbender
11-27-2005, 05:26 PM
You know this mod is for vBulletin 2 and is a default feature for vB3 ;)
Yep, completely.
But, until we can get it to work consistiently when merging the data back to the DB before running the VB 3.5.* upgrade script, it's still a bone of contention. Even at the VB 3.5 (gold) level, it does not seem to recognize the fact that the attachments are in files versus data base, even if you enable it. That's a problem (unless I am doing it wrong, and I'd LOVE it if someone showed me a better way here).
That implies to me that anyone using the Attachments As Files hack HAS to get the attachments loaded back into the filedata variable before we can proceed with the move to 3.5. When I try to upgrade to vb 3.5 without merging the attachment data back into the DB, the upgrade script fails when it goes to alter the attachments table on or about step 10/42. So, for my hacked up situation, I have to perform the process.
I am having a problem now with losing about 2 thousand of the latest attachments. I rewrote attachment_upgrade.php to to;
a) Check the return codes on each of the DB and File calls being made
b) count of how many attachment records are in the returned array
c) Write a message every 500 attachments saying "nnnn have uploaded sucessfully"
c) count of how many failed upload
d) write out some basic messaging of these actions - total in array, total uploaded, total failed..
While the script runs, it matches the count of records I see in my live DB, and I get no "file not found" messages. Also, it appears that the attachment table is back to being the huge behemoth it once was when the filedata variable contained the attachment data(800+ Meg).
One cannot remove the hash field from the attachment table prior to running the attachment_upgrade.php script as it depends on that field to help determine the file name to read into the filedata variable. Although I have tried to remove this after I did run the attachment_upgrade script to see if that made a difference.. It didn't. As a matter of fact, it caused a loss of rows.
The problem is that when I take this DB into VB 3.5 it seems to lose all attachments posted after a certain date (like 1/5/2005 thru current day). Anything older than that is ok, as well as any new ones updated.
I have tried a ton of variations to see what in creation is happening. I cannot proceed with losing 2 thousand+ attachments.. Any Ideas, or insights?
Zachery
11-27-2005, 06:21 PM
Yep, completely.
But, until we can get it to work consistiently when merging the data back to the DB before running the VB 3.5.* upgrade script, it's still a bone of contention. Even at the VB 3.5 (gold) level, it does not seem to recognize the fact that the attachments are in files versus data base, even if you enable it. That's a problem (unless I am doing it wrong, and I'd LOVE it if someone showed me a better way here).
That implies to me that anyone using the Attachments As Files hack HAS to get the attachments loaded back into the filedata variable before we can proceed with the move to 3.5. When I try to upgrade to vb 3.5 without merging the attachment data back into the DB, the upgrade script fails when it goes to alter the attachments table on or about step 10/42. So, for my hacked up situation, I have to perform the process.
I am having a problem now with losing about 2 thousand of the latest attachments. I rewrote attachment_upgrade.php to to;
a) Check the return codes on each of the DB and File calls being made
b) count of how many attachment records are in the returned array
c) Write a message every 500 attachments saying "nnnn have uploaded sucessfully"
c) count of how many failed upload
d) write out some basic messaging of these actions - total in array, total uploaded, total failed..
While the script runs, it matches the count of records I see in my live DB, and I get no "file not found" messages. Also, it appears that the attachment table is back to being the huge behemoth it once was when the filedata variable contained the attachment data(800+ Meg).
One cannot remove the hash field from the attachment table prior to running the attachment_upgrade.php script as it depends on that field to help determine the file name to read into the filedata variable. Although I have tried to remove this after I did run the attachment_upgrade script to see if that made a difference.. It didn't. As a matter of fact, it caused a loss of rows.
The problem is that when I take this DB into VB 3.5 it seems to lose all attachments posted after a certain date (like 1/5/2005 thru current day). Anything older than that is ok, as well as any new ones updated.
I have tried a ton of variations to see what in creation is happening. I cannot proceed with losing 2 thousand+ attachments.. Any Ideas, or insights?
You are moving from 2.x with this hack to 3.5?
bitbender
11-27-2005, 09:06 PM
Yep.. Unfortunately, my work year has been very busy(months of 80+ hour weeks), and I haven't been able to spend as much time on my board as I have had to spend at work, or travelling for work. IRL I am a mainframe operating systems engineer, and I have a number of clients I am assigned to serve.. So, I got a bit behind on upgrading to VB, and I was waiting for VB 3 to stabilize, and then I was waiting on vbportal, and on the list goes...
Nonetheless, I am still looking for a solution. I am currently running my xx-th iteration of the upgrade on my test site, trying to see if I can spot any nuance at all with what is happening along the way. Sometimes, this process just works perfectly, and other times, I get this weird arse behaviour where it drops most of this years attachments.. Go figgure.
bitbender
11-27-2005, 10:46 PM
And Go Figgure.. IT WORKED this time! The only change in process made was not removing the 'hash' field from the attachment table, and the attachpath from the settings table. the attachments as hack uninstall option did these thwo things, and I was too, after I ran the attachment_upgrade_new.php script.
I would really like to understand why it has seperate behaviours and what could be causing this. Code usually doesn't act fickle.
dug320
02-26-2007, 03:06 AM
This seems like a good idea.
Is there any chance it will be updated to 3.6X?
Deska
04-03-2007, 10:01 AM
This seems like a good idea.
Is there any chance it will be updated to 3.6X?
vBulletin 3.6.x has default feature for this :D
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.