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.


All times are GMT. The time now is 06:05 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.01114 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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