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)
-   -   Add Attachment on Edit Post (https://vborg.vbsupport.ru/showthread.php?t=33676)

Hellburn 07-03-2002 10:25 AM

oki i have fixed the hack for 2.2.6.

Mystics 07-06-2002 03:40 PM

Hi,

the Hack doesn't update the attachment count of the thread, so if there was no attachment before in this thread, the paperclip icon does not show up in the thread list of a forum.

To fix this, you have to do this change, after installing the Hack:

Search in editpost.php:
Code:

  // Add attachment on edit post hack (start)
  elseif (trim($attachment)!="none" and trim($attachment)!="" and trim($attachment_name)!="")
  {
    $attachmentid=acceptupload($foruminfo[moderateattach]);
    $attachmentsql=",attachmentid='$attachmentid'";

and add below it:
Code:

    $DB_site->query("UPDATE thread SET attach = attach + 1 WHERE threadid='$threadinfo[threadid]'");
Mystics

PhotoGenie 07-08-2002 03:53 AM

I'm a little confused in the directions.

Still in editpost.php, look for: [vBulletin 2.2.6 and up ONLY!]
--------------------------------------------------------------------------------
if (phpversion() < '4.0.3') {
$enctype = 'enctype="multipart/form-data"';
} else if (ini_get('file_uploads')) {
$enctype = 'enctype="multipart/form-data"';
} else {
--------------------------------------------------------------------------------

Move this block a few lines up, just after this line:
--------------------------------------------------------------------------------
$enctype = '';

Am I supposed to remove the text above " $enctype = ''; " and then put it back in below it?

Harley-1 07-08-2002 09:49 AM

me too... can you give us a newbie hint?:D

Mystics 07-08-2002 02:03 PM

@PhotoGenie
@Harley-1

Just ignore this step! It's no longer necessary since vB 2.2.6. :)

I have attached the final version for 2.2.6 with my Bugfix (see Posting above).

Mystics

PhotoGenie 07-08-2002 04:31 PM

That was easy enough.. Thank you!!.. This is a very good practical hack.

eoc_Jason 07-20-2002 11:56 PM

After comparing the code that Mystics posted vs. the other code for 2.2.6, I went with Mystics. I dug around in other files and couldn't find where it would add to the attachment count, so that's why I used his. If this is incorrect someone post another update. ;) :bunny:

Quote:

Originally posted by Mystics
@PhotoGenie
@Harley-1

Just ignore this step! It's no longer necessary since vB 2.2.6. :)

I have attached the final version for 2.2.6 with my Bugfix (see Posting above).

Mystics


Tim Wheatley 08-03-2002 12:59 AM

<a href="https://vborg.vbsupport.ru/attachment.php?s=&postid=270639" target="_blank">https://vborg.vbsupport.ru/attac...&postid=270639</a>
Works perfect here: 2.2.6.

Schorsch 08-08-2002 04:11 AM

[high]* Schorsch says Thank you very much Tommy Boy and Mystics :)[/high]

Mystics 12-09-2002 01:54 PM

I have updated my attachment.

The canpostattachment-permission was not checked while editing a posting.

Thanks @Axel Foley for pointing this out.

Mystics


All times are GMT. The time now is 06:55 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.01275 seconds
  • Memory Usage 1,734KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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