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)

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

PHP Code:

    $DB_site->query("INSERT INTO attachment (attachmentid,userid,dateline,filename,filedata,visible) 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

Quote:

04-26-03 at 04:02 PM Preech said this in Post #324
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 ? :(

rake 05-11-2003 07:50 AM

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.


All times are GMT. The time now is 09:05 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.01531 seconds
  • Memory Usage 1,746KB
  • 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_php_printable
  • (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