Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Keep Attachment Checked by Default when Soft Deleting Details »»
Keep Attachment Checked by Default when Soft Deleting
Version: 1.00, by Merjawy Merjawy is offline
Developer Last Online: Mar 2016 Show Printable Version Email this Page

Category: Moderators Functions - Version: 4.2.0 Rating:
Released: 07-08-2012 Last Update: Never Installs: 10
Template Edits
Re-useable Code  
No support by the author.

This is something I done for my own boards and I thought of sharing it.

When you and/or your Mods soft delete a post/thread with attachment, sometimes a Mod would forget to check mark the Keep Attachments box and if you ever want to undelete the post/thread, the attachments are long gone.

This simple code will make the Keep Attachments box checked by default.

It's for 4.2.0 but it should work for 4.x.x

Templates to modify the code in:

threadadmin_deleteposts
threadadmin_deletethread
threadadmin_deletethreads


Find this code:

PHP Code:
<input type="checkbox" name="keepattachments" value="1" id="cb_keepattachments" tabindex="1" /> {vb:rawphrase keep_attachments

Replaces it with this code:

PHP Code:
<input type="checkbox" name="keepattachments" value="1" id="cb_keepattachments" {vb:raw checked.deletetabindex="1" /> {vb:rawphrase keep_attachments


If you enjoy my mod, please consider marking it as "Installed". Any comments are welcome.



Updated: Sep. 4th 2012 (fixed typo)

Screenshots

File Type: jpg 2012-07-21_1052.jpg (52.9 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 07-21-2012, 01:57 PM
Merjawy's Avatar
Merjawy Merjawy is offline
 
Join Date: Sep 2002
Location: USA
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Update:

Added screenshot
Reply With Quote
  #3  
Old 09-01-2012, 02:18 PM
dormopoco dormopoco is offline
 
Join Date: May 2007
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

TNX a LOT!!! very nice small mod!
Reply With Quote
  #4  
Old 09-01-2012, 06:12 PM
Merjawy's Avatar
Merjawy Merjawy is offline
 
Join Date: Sep 2002
Location: USA
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your're welcome, Enjoy... Please mark installed
Reply With Quote
  #5  
Old 09-03-2012, 06:28 PM
maupassant maupassant is offline
 
Join Date: Feb 2009
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, but it doesn't seem to work for me. Running 4.2.0 patch level 2 with Merhania skin (or style).
Reply With Quote
  #6  
Old 09-03-2012, 07:50 PM
Andy Andy is offline
 
Join Date: Sep 2003
Location: San Francisco
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In post #1 there's a typo error in the code example. Here's the correct way to add this template change. Just add "{vb:raw checked.delete}" as shown below:

Code:
default
<input type="checkbox" name="keepattachments" value="1" id="cb_keepattachments" tabindex="1" /> {vb:rawphrase keep_attachments}  

modified
<input type="checkbox" name="keepattachments" value="1" id="cb_keepattachments" {vb:raw checked.delete} tabindex="1" /> {vb:rawphrase keep_attachments}
Reply With Quote
  #7  
Old 09-04-2012, 02:23 AM
Merjawy's Avatar
Merjawy Merjawy is offline
 
Join Date: Sep 2002
Location: USA
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by maupassant View Post
Thanks, but it doesn't seem to work for me. Running 4.2.0 patch level 2 with Merhania skin (or style).
I done it based on the default style code, if you're using a customized style, the code might be changed and you just have to find where the changes need to be.

If you post the content of thoese templates I will try to help you.
Reply With Quote
  #8  
Old 09-04-2012, 02:27 AM
Merjawy's Avatar
Merjawy Merjawy is offline
 
Join Date: Sep 2002
Location: USA
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Andy. But I don't see the error you mentioned! The code you've posted is exactlly the same as in post #1
Reply With Quote
  #9  
Old 09-04-2012, 11:36 AM
maupassant maupassant is offline
 
Join Date: Feb 2009
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Merjawy, there is a difference between Andy's version and yours. Your code adds another <input at the beginning. Not Andy's.

So, is it because I added it that it doesn't work ? Is it normal to have <input <input ?

<input <input type="checkbox" name="keepattachments" value="1" id="cb_keepattachments" {vb:raw checked.delete} tabindex="1" /> {vb:rawphrase keep_attachments}
Reply With Quote
  #10  
Old 09-04-2012, 05:16 PM
Merjawy's Avatar
Merjawy Merjawy is offline
 
Join Date: Sep 2002
Location: USA
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That would do it.. I musta been sleepy : Thanks both of you... First post updated now
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:00 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05124 seconds
  • Memory Usage 2,320KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete