vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Moderators Functions - Keep Attachment Checked by Default when Soft Deleting (https://vborg.vbsupport.ru/showthread.php?t=285364)

Merjawy 07-08-2012 10:00 PM

Keep Attachment Checked by Default when Soft Deleting
 
1 Attachment(s)
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)

Merjawy 07-21-2012 01:57 PM

Update:

Added screenshot

dormopoco 09-01-2012 02:18 PM

TNX a LOT!!! very nice small mod!

Merjawy 09-01-2012 06:12 PM

Your're welcome, Enjoy... Please mark installed :)

maupassant 09-03-2012 06:28 PM

Thanks, but it doesn't seem to work for me. Running 4.2.0 patch level 2 with Merhania skin (or style).

Andy 09-03-2012 07:50 PM

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}


Merjawy 09-04-2012 02:23 AM

Quote:

Originally Posted by maupassant (Post 2362310)
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.

Merjawy 09-04-2012 02:27 AM

Thanks Andy. But I don't see the error you mentioned! The code you've posted is exactlly the same as in post #1 :)

maupassant 09-04-2012 11:36 AM

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}

Merjawy 09-04-2012 05:16 PM

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


All times are GMT. The time now is 08:37 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.02384 seconds
  • Memory Usage 1,736KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)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
  • (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