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)
-   -   Optimized attachments in vB2.X.X (https://vborg.vbsupport.ru/showthread.php?t=49306)

Dean C 02-26-2003 03:53 PM

lifesourcerec - The @ prevents it from outputting an error if the function fails. It was added in there in vb 2.2.7 i believe (i can remember from when i upgraded)

- miSt

pogo 02-26-2003 04:04 PM

Quote:

Originally posted by TranceMaster
how would i go about removing this hack
after installing it, my forum has been going very very slow :(
how do i remove these queries?
-------------------------------------------------------------------------------
ALTER TABLE attachment ADD hash VARCHAR(32) DEFAULT '0' NOT NULL;
-------------------------------------------------------------------------------


-------------------------------------------------------------------------------
UPDATE attachment SET hash = md5(filedata);
-------------------------------------------------------------------------------


-------------------------------------------------------------------------------
ALTER TABLE attachment ADD INDEX(hash);
-------------------------------------------------------------------------------

hope sum1 can help
thanks

If you use PHPMyAdmin you can remove the hash field and the index just by clicking the links in PHPMyAdmin.

In the table listing menu click attachment.
Then in the fields table click delete in the hash row.
And last click delete a little below in the index area.

TranceMaster 02-26-2003 04:13 PM

Quote:

Originally posted by pogo


If you use PHPMyAdmin you can remove the hash field and the index just by clicking the links in PHPMyAdmin.

In the table listing menu click attachment.
Then in the fields table click delete in the hash row.
And last click delete a little below in the index area.

tried that aswell, yet for some reason the forum is going very very slow.

dont get me wrong, great hack, i would just like 2 tottaly remove it now, :(

TranceMaster 02-26-2003 04:21 PM

ahh yea slowly but surely, the speed is improving. :)

s.molinari 02-26-2003 07:38 PM

Hi all. There is a small (embarrassing) mistake in the functions.php replacement code. :0 Please correct the following lines in functions.php.
PHP Code:

if (!$allowduplicates) {
      if (
$result=$DB_site->query_first("SELECT attachmentid
                                         FROM attachment
                                         WHERE hash = '"
.addslashes($attachmenthash)."'")) {
        
$attachmentid $result[attachmentid];
      }
    } else {
      
$DB_site->query("INSERT INTO attachment (attachmentid,userid,dateline,filename,filedata,visible,hash) VALUES (NULL,$bbuserinfo[userid],".time().",'".addslashes($attachment_name)."','".addslashes($filestuff)."','$visible','".addslashes($attachmenthash)."')");
      
$attachmentid=$DB_site->insert_id(); 

with
PHP Code:

  if (!$allowduplicates) {
      if (
$result=$DB_site->query_first("SELECT attachmentid
                                         FROM attachment
                                         WHERE hash = '"
.addslashes($attachmenthash)."'")) {
        
$attachmentid $result[attachmentid];
        return 
$attachmentid;
      }
    }
    
$DB_site->query("INSERT INTO attachment (attachmentid,userid,dateline,filename,filedata,visible,hash) VALUES (NULL,$bbuserinfo[userid],".time().",'".addslashes($attachment_name)."','".addslashes($filestuff)."','$visible','".addslashes($attachmenthash)."')");
    
$attachmentid=$DB_site->insert_id(); 

We apologize for the inconvenience. The download has also been updated.

Scott

s.molinari 02-26-2003 07:40 PM

Quote:

Originally posted by TranceMaster


tried that aswell, yet for some reason the forum is going very very slow.

dont get me wrong, great hack, i would just like 2 tottaly remove it now, :(

Hi,
I highly doubt that this hack is the cause of the slow down on your site.

Scott

TranceMaster 02-26-2003 07:52 PM

Quote:

Originally posted by s.molinari
Hi,
I highly doubt that this hack is the cause of the slow down on your site.

Scott

well it was right after i installed it, that the forum came almost to a halt.
all is fine now though.
forum is running normally again.

:D

Boofo 02-26-2003 07:53 PM

Scott, how about the English version? ;)

Brad 02-26-2003 08:14 PM

When i apply the fix to functions.php i get this error:

PHP Code:

Parse errorparse error in /home/kous/public_html/forums/admin/functions.php on line 1756

Fatal error
Call to undefined function: makelogincode() in /home/kous/public_html/forums/global.php on line 367 


Aaron1 02-27-2003 05:30 AM

I think the code should be like this:

PHP Code:

if (!$allowduplicates) {
      if (
$result=$DB_site->query_first("SELECT attachmentid
                                         FROM attachment
                                         WHERE hash = '"
.addslashes($attachmenthash)."'")) {
        
$attachmentid $result[attachmentid];
        return 
$attachmentid;
      }
      
    
$DB_site->query("INSERT INTO attachment (attachmentid,userid,dateline,filename,filedata,visible,hash) VALUES (NULL,$bbuserinfo[userid],".time().",'".addslashes($attachment_name)."','".addslashes($filestuff)."','$visible','".addslashes($attachmenthash)."')");
    
$attachmentid=$DB_site->insert_id(); 

I guess there was just one } to much.
Correct me if i am wrong Molinari...

Grtz


All times are GMT. The time now is 06:01 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.03803 seconds
  • Memory Usage 1,766KB
  • 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
  • (4)bbcode_php_printable
  • (4)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
  • (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