Soft Delete
Author Message
Warning: this plugin has some known issues with messing up counters on the latest MyBB due to the complex workarounds it has to go through to get things working, and the fact that MyBB actually gets bug fixes sometimes.  This can lead to some quirky effects on your board, but usually can be resolved by recounting everything (but you have to do this every so often)

I spent quite a few days working on this plugin - it's quite fiddly to get right and I found it a bit of a challenge to implement (especially the counters).

Basically this stops threads and posts from being "fully" deleted.  Deleted threads/posts are displayed appropriately, only shown to moderators (see screenshots below).  Moderators can then undelete these deleted threads/posts if desired.  Administrators also have the ability to purge (completely remove) deleted threads/posts.

Due to the difficulty of this plugin, I can't be entirely sure that all cases are covered - I have done a fair bit of testing, but if you do find issues, please report them.  To give you an idea of how difficult this plugin was to get right, the development of this plugin actually lead to the finding of a few bugs in MyBB:
http://dev.mybboard.net/issues/827
http://dev.mybboard.net/issues/830
http://dev.mybboard.net/issues/831
http://dev.mybboard.net/issues/860
http://dev.mybboard.net/issues/861
http://dev.mybboard.net/issues/862
http://dev.mybboard.net/issues/863
http://dev.mybboard.net/issues/881

This plugin is somewhat affected by some of these bugs to an extent, though should be nothing major under normal usage.


This plugin requires a code modification (due to the lack of hooks provided).
For MyBB 1.6, see here
For MyBB 1.4 or 1.6 beta: in inc/class_moderation.php, find (FIRST INSTANCE):

PHP Code:
++$forum_counters[$post['fid']]['num_posts'];

add below:

PHP Code:
if(function_exists('softdeletex_approveposts')) eval(softdeletex_approveposts($post));

If you're a fag and think code edits are homosexual, you can GTFO or make a plugin (that works properly) which doesn't require them - go ahead, I challenge you

Upgrade instructions: If you're upgrading from v1.0 or v1.1 to v1.2x, please see this post

Notes:

  • The undelete function has been implemented as an approve, that is, approving a deleted thread/post will undelete it.
  • Deleting an unapproved item, when restored, will no longer be unapproved.
  • Uninstalling the plugin will remove all deleted threads and posts

Known issues:
  • Custom moderation has not been tested with deleted content and may cause issues.  Probably does work, but it may stuff up some counters.
  • Splitting posts from a thread, causing the first post to become a deleted post will cause the thread to be marked as deleted.  However, the thread count of the forum may not go down by 1 due to this.  This is mostly (indirectly) due to a MyBB bug.  But if this really bothers you, it's possible to fix this issue by doing the following modification to inc/class_moderation.php
    Find:

    PHP Code:
    			$forum_counters[$moveto]['threads'] = $forum_cache[$moveto]['threads'];
    			++$forum_counters[$moveto]['threads'];

    Replace with:

    PHP Code:
    			$forum_counters[$moveto]['threads'] = '+1';

  • Deleting posts containing attachments won't cause the attachment count of the thread to go down.  I don't really think this as much of an issue however, as, with standard MyBB behaviour, unapproving attachments or posts doesn't affect the thread's attachment count.


Changelogs: v1.1, v1.2, v1.21, v1.22, v1.23, v1.24, v1.25

Screenshots:


Attached File(s) Thumbnail(s)
       
(This post was last modified: 05-10-2012 09:04 AM by ZiNgA BuRgA.)
Find all posts by this user
Quote this message in a reply
Download: softdelete-1.25.7z (11.4 KB)
Plugin Version: 1.25
Last Updated: 03-12-2011, 09:24 AM

Downloads: 878
MyBB Compatibility: 1.4.x, 1.6.x
Plugin License: GPLv3
Uploader: ZiNgA BuRgA
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #31
RE: Soft Delete
(10-14-2010 04:20 AM)noammn Wrote:  Hi, i have a problem:
http://img176.imageshack.us/img176/3310/problemi.png
I think the problem is that I don't have the column of the Rating..
How can i fix this problem?
Please help me...

You can edit forumdisplay_thread_deleted template in your global template.

(This post was last modified: 10-14-2010 04:31 AM by RateU.)
10-14-2010 04:31 AM
Find all posts by this user Quote this message in a reply
noammn Offline
Junior Member
**
Posts: 4
Joined: Oct 2010
Post: #32
RE: Soft Delete
(10-14-2010 04:31 AM)RateU Wrote:  
(10-14-2010 04:20 AM)noammn Wrote:  Hi, i have a problem:
http://img176.imageshack.us/img176/3310/problemi.png
I think the problem is that I don't have the column of the Rating..
How can i fix this problem?
Please help me...

You can edit forumdisplay_thread_deleted template in your global template.

Thanks =]
10-14-2010 06:30 AM
Find all posts by this user Quote this message in a reply
noammn Offline
Junior Member
**
Posts: 4
Joined: Oct 2010
Post: #33
RE: Soft Delete
Where can I find this mod's languages variables
10-18-2010 04:33 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #34
RE: Soft Delete
I think there is no a specific language file for this plugin.
But I think you need to wait Yumi to reply.

10-18-2010 07:16 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #35
RE: Soft Delete
Search the files for ) or $lang->

You can overwrite these with a language file (+ will need to load it during global_start).
Example

PHP Code:
isset($lang->purge_post) or $lang->purge_post = 'Purge Post';

Make the typical plugin file, adding a line such as

PHP Code:
$l['purge_post'] = "whatever";


You can do this for each instance of the language variable.

Also, edit inc/plugins/softdelete.php, find:

PHP Code:
if(!defined('IN_MYBB'))
    die('This file cannot be accessed directly.');

Add below:

PHP Code:
$plugins->add_hook('global_start', 'softdelete_loadlang');
function softdelete_loadlang() { $GLOBALS['lang']->load('softdelete'); }


Hope that helps.


My Blog
10-18-2010 07:24 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #36
RE: Soft Delete
Updated to v1.24:
- fix bug with editing polls
- fix issue with deleting moved threads
- fix XThreads template prefix conflict with newer versions of XThreads

Still haven't tested this with 1.6.1, mainly the counters (which are a bit of a mess).

My Blog
12-17-2010 11:39 AM
Find all posts by this user Quote this message in a reply
Turel Offline
Junior Member
**
Posts: 5
Joined: Oct 2010
Post: #37
RE: Soft Delete
Nice, So can you make a plugin that automatically makes a reported posts and threads invisible (unaproved)?
12-25-2010 01:28 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #38
RE: Soft Delete
Can I?  Probably.
Will I?  Probably not.

My Blog
12-26-2010 10:47 PM
Find all posts by this user Quote this message in a reply
Turel Offline
Junior Member
**
Posts: 5
Joined: Oct 2010
Post: #39
RE: Soft Delete
Why not? I need something like that
(This post was last modified: 12-28-2010 06:10 AM by Turel.)
12-28-2010 06:09 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #40
RE: Soft Delete
The great thing is, I don't.

My Blog
12-28-2010 02:58 PM
Find all posts by this user Quote this message in a reply


Forum Jump: