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)

mup_cow 02-27-2002 08:59 PM

It would be nice if this functionality is included in the standard VB I mean put the attachment into an attachment directory (off the docroot), and perhaps some options as to whether it should use the real name (allowing / disallowing duplicates) or hashed version.

attachments into the DB is making the DB so big :( taking a long time to backup / restore it.

mup_cow 02-27-2002 09:23 PM

Is there a hack to extract all the existing attachment from db into files ?

maverick1236 02-28-2002 12:50 AM

test

maverick1236 02-28-2002 12:54 AM

Looks like a great hack-i get all the way through to step one in functions php

then i crash when i add this

//we got this far, attachment passes the tests
//the file should now be in the directory lets simply insert the data into the database
$visible = iif($moderate,0,1);
$DB_site->query("INSERT INTO attachment (attachmentid,userid,dateline,filename,visible,has h) VALUES (NULL,$bbuserinfo[userid],".time().",'".addslashes($attachment_name)."','$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

mup_cow 02-28-2002 06:35 AM

Quote:

Originally posted by mup_cow
It would be nice if this functionality is included in the standard VB I mean put the attachment into an attachment directory (off the docroot), and perhaps some options as to whether it should use the real name (allowing / disallowing duplicates) or hashed version.

attachments into the DB is making the DB so big :( taking a long time to backup / restore it.

Sorry I hadn't got to the part where it imported the attachments from the table into the files.... hehehe it makes this hack sper duper cool

48MB -> 84KB :) Thanks for making this hack!!!

maverick1236 02-28-2002 09:34 AM

BUMP

Scott MacVicar 02-28-2002 01:59 PM

maverick your applying the patch wrongly, make sure that you are doing it correctly you should completely remove the accept_attachments function and then replace it with the ew one.

maverick1236 03-01-2002 09:36 PM

this hack wouldnt work for me

in fact it TOTALLY screwed my board up-and i am quite experienced at applying hacks

ive uninstalled the hack-and am using vb default php files

and guess what?-my attachments dont show---period.

nothing shows

now people think they are uploading an attachment-and no errors occur-but no file either-so they post 3 times trying to upload it-and NOTHING

i dont get it-how could such a simple hack do so much damage

:mad: :( :mad: :(

Linux 03-02-2002 07:40 PM

Hi, thanks for this hack it is a rock

But I have a problem with the imported files, after installation every things work well. but when I checked the attachment folder I noticed there are a duplication in most of files, yes it has different name but there are 3 or 4 copy of each file, so is there any way to determine unused file and delete them to save the space

Scott MacVicar 03-02-2002 09:06 PM

the files can't be the same, they wouldn't be able to exist as they would have been overwritten. The files may look the same as it uses a md5 hash to create it.


All times are GMT. The time now is 11:52 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
  • Page Generation 0.01286 seconds
  • Memory Usage 1,736KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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