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

Axel Foley 12-09-2002 09:35 PM

Quote:

Originally posted by Mystics
I have updated my attachment.

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

Thanks @Axel Foley for pointing this out.

Mystics

I disagree...:D

I only discovered a bug, like you discovered the attach counter update problem on Tommy Boy's code...;)

I think Tommy Boy deserves our thanks for the hack...good job.

I guess this is what this forum is here for...to help each other.

Ciao...

indiamike 02-22-2003 10:41 AM

Has anyone updated this hack for 2.2.9 and up.


In the instructions after the $DB_site->query part in editpost.php (I am refraining from posting the code ) it shows to post the code after the second closing tag. Using 2.2.9 there is a few lines about "sort attachment" after the first closing tag.

Should this code be added after the second closing tag after the sort attachment part or before it or somewhere in between?

Mike

....ps...hope this makes sense

TexasOutdoors 02-23-2003 10:04 PM

I used the code that Mystics posted with vbulletin 2.2.9 and it works fine.

indiamike 02-23-2003 11:12 PM

gotcha...I should have better attention reading through all the threads.

Thanks

Red Blaze 04-09-2003 04:59 AM

Some one asked me about this one. Works fine with me. :)

[high]* Red Blaze clicks install ^_^[/high]

msimplay 05-11-2003 12:31 PM

works fine on vbulletin 2.30 release candidate 3

padblaz 05-23-2003 06:29 AM

works better for me with updated version of this hack :p
thanks again for this great hack

JohnK 01-22-2004 12:47 PM

Thanks :D


All times are GMT. The time now is 06: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.01084 seconds
  • Memory Usage 1,755KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (18)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