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)
-   -   Keep attachments when previewing messages (https://vborg.vbsupport.ru/showthread.php?t=38995)

Admin 05-23-2002 10:00 PM

Keep attachments when previewing messages
 
This hack solves the problem of attachments not being carried on when you preview your message. The "Attach File" box empties itself and you must re-choose the file before posting the message.

So I've "fixed" this little problem. Now when you preview, the attachments is stored in the database, and in the preview screen you get the "Edit Attachment" box (you know that, you see it whenever you edit a post with an attachment). You can Keep, Update or Delete the attachment.

Orphaned attachments (people may preview posts with attachments but never post them) are removed in newthread.php and newreply.php, every 5 minutes.

That's all. The vbHacker file is attached to this post, and a regular text file version will be posted in a minute.
I will install the hack on this board in 5 or 10 minutes, so you can see what I'm talking about.

Enjoy! :bunny:

Admin 05-24-2002 12:46 PM

And the text file, as promised.

Neo 05-24-2002 02:46 PM

Very good addon :)

Smoothie 05-24-2002 04:10 PM

Nice!

Smoothie 05-24-2002 08:24 PM

I'm not finding this bit of code in newreply.php
PHP Code:

    // sort attachement
    
if ($permissions[canpostattachment] and trim($attachment)!="none" and trim($attachment)!="" and trim($attachment_name)!="") {
      
$attachmentid=acceptupload($foruminfo[moderateattach]);
    } else {
      
$attachmentid=0;
    } 

Instead, I find this:
PHP Code:

    // sort attachement
    
if (trim($attachment)!="none" and trim($attachment)!="" and trim($attachment_name)!="") {
      
$attachmentid=acceptupload($foruminfo[moderateattach]);
    } else {
      
$attachmentid=0;
    } 

And in newthread.php Ican't find this:
PHP Code:

    // sort attachement
    
if ($permissions[canpostattachment] and trim($attachment)!="none" and trim($attachment)!="" and trim($attachment_name)!="") {
      
$attachmentid=acceptupload($foruminfo[moderateattach]);
      if (!
$foruminfo[moderateattach]) {
        
$attachcount 1;
      } else {
        
$attachcount 0;
      }
    } else {
      
$attachmentid=0;
      
$attachcount=0;
    } 

Instead, I find this:
PHP Code:

    // sort attachement
    
if (trim($attachment)!="none" and trim($attachment)!="" and trim($attachment_name)!="") {
      
$attachmentid=acceptupload($foruminfo[moderateattach]);
      if (!
$foruminfo[moderateattach]) {
        
$attachcount 1;
      } else {
        
$attachcount 0;
      }
    } else {
      
$attachmentid=0;
      
$attachcount=0;
    } 


Boofo 05-25-2002 01:17 AM

Excellent addition, Firefly! Will this also work with the preview private messages hack? :)

Admin 05-25-2002 04:55 AM

Smoothie; You are using an older version of vBulletin.

Smoothie 05-25-2002 05:15 AM

Thanks for reply FireFly. So, is there anyway to get this hack to work with the version I'm using?

Admin 05-25-2002 05:23 AM

Just replace what you have now with my code. You will also get a bug fixed while doing it.

Smoothie 05-25-2002 07:08 AM

FireFly, I replaced my code with yours, but it didn't work. When I try to post a new reply, or add a new thread, nothing happens.

Admin 05-25-2002 07:19 AM

Make sure you followed everything and made all changes.

Smoothie 05-25-2002 08:18 AM

I checked, and rechecked that all the code was changed in accordance with your instructions. When I hit reply, or new thread, it just hangs.

Admin 05-25-2002 08:25 AM

Email me your files if you want, and I'll take a look.

Upload the original files in the mean time, and make sure they work.

Smoothie 05-25-2002 08:31 AM

Ok, email sent. I uploaded the original files, and everything is working fine. Thanks for taking the time to help.

JJR512 07-10-2002 06:00 AM

Is this compatible with PPN's attachments as files hack?

Admin 07-10-2002 12:40 PM

No, I don't think so.

CeleronXL 08-09-2002 01:19 AM

What would I do with 2.2.6 as there is

PHP Code:

   if (is_array($HTTP_POST_FILES)) {
        
$attachment $HTTP_POST_FILES['attachment']['tmp_name'];
        
$attachment_name $HTTP_POST_FILES['attachment']['name'];
        
$attachment_size $HTTP_POST_FILES['attachment']['size']; 

in one part that is supposed to be replaced.....

Bison 11-12-2002 04:18 AM

Damn ... I installed this hack and now the only way I can get the attachments to show is when I edit the threads ... can anyone help with this? :(

tkeil69575 12-09-2002 04:38 PM

hi firefly,
i had this installed for a while and it was working as such, however it slowed down my newthread.php and newreply.php extremely. Load time with hack 26 seconds :confused:, without 0.07 seconds on average.

any ideas why that is so? maybe i did something wrong??? Dont think so though, otherwise I guess I would have gotten errormessages of some kind.

regards tina

P.s. Using 2.2.9

jmke 12-22-2002 11:38 PM

same problem occured here, had to remove it :-/

Boofo 12-22-2002 11:48 PM

You must have another hack messing with it then. I am running a very hacked up v2.2.9 and it runs as fast with it installed as it did before I installed it. No difference. :)

BigJohnson 12-27-2002 03:01 PM

This hack is amazing. IT works well. There is just one thing missing. Ok say you post an attachment and then you go edit that post with the attachment. You want to edit the attachment so you upload another and click preview. Now it doesn't keep the attachment you just wanted to change. You have to do it again. This is in the editpost.php and that file was never edited during this hack. Can someone addon this feature please. Thanks so much.


All times are GMT. The time now is 04:46 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.02290 seconds
  • Memory Usage 1,774KB
  • 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
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (22)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete