vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Attachments as files (https://vborg.vbsupport.ru/showthread.php?t=35193)

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

Quote:

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

PHP Code:

<?

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

Quote:

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:

PHP Code:

// ###################### 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!

joor 11-17-2002 05:40 PM

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!

Exo 11-21-2002 02:59 AM

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

Quote:

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!

Exo 11-21-2002 07:55 PM

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?

Exo 11-23-2002 10:26 PM

super my backup does not work because its too big!

Bison 11-24-2002 04:35 PM

Quote:

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....

fury 12-03-2002 04:32 PM

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

Quote:

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:
Code:

$DB_site->query("DELETE FROM attachment WHERE attachmentid IN ($attachmentids"."0) AND NOT attachmentid IN ($omitattachmentids"."0)");
wheras function.php has:
Code:

$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...admin/user.php
Referer: http://golden-springs.com/forums/adm...dit&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

Quote:

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:

Code:

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=&ac...t&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):

PHP Code:

// ###################### 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

Quote:

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

Quote:

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?


All times are GMT. The time now is 06:28 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01827 seconds
  • Memory Usage 1,847KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (3)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete