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: 893
MyBB Compatibility: 1.4.x, 1.6.x
Plugin License: GPLv3
Uploader: ZiNgA BuRgA
zorro Offline
Junior Member
**
Posts: 4
Joined: Jan 2011
Post: #41
RE: Soft Delete
I have tried so many plugins like this, undo-delete, trashcan etc etc

The biggest problem is ALWAYS that I cannot see who deleted WHAT the only thing I can see is the posts that have been deleted and in the inbuilt ModCP I can also only see "this post has been deleted by..." but I cannot actually see the post that have been deleted to determine if the delete was legit or not.

This is a huge problem for me who got 6 moderators on my forum when people say that someone have deleted their post for the wrong reasons.

Any suggestions?
01-20-2011 05:28 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #42
RE: Soft Delete
Unfortunately it doesn't record that, however, you can see who deleted a thread via moderator logs.
If those are too much to go through, you can try filtering it on the thread (undelete the thread, in the Moderation Options listbox at the bottom of the showthread page, go Edit/View Thread Notes, and it shows the moderation history of the thread there).

I might think about writing who deleted a thread somewhere.

My Blog
01-20-2011 08:41 PM
Find all posts by this user Quote this message in a reply
zorro Offline
Junior Member
**
Posts: 4
Joined: Jan 2011
Post: #43
RE: Soft Delete
Hi and thanks for your reply Jap

I really hope you do write something for that sometime in the future, and I'll try to stick around here for that.

I think it's a huge problem, I wanna see if my mods do a great job or not. And if 2 moderators delete 2 posts in the same thread, one that's spam and one that's really great but that particular mod doesn't like I cannot see which one of the mods that have abused.
01-21-2011 03:34 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #44
RE: Soft Delete
As I somewhat suspected, this may be an issue with delayed moderation.  There doesn't appear to be any easy way to retrieve who initiated a delayed moderation event unfortunately.
Maybe I could just ignore delayed moderation so that it won't record the user.

My Blog
01-21-2011 10:41 AM
Find all posts by this user Quote this message in a reply
zorro Offline
Junior Member
**
Posts: 4
Joined: Jan 2011
Post: #45
RE: Soft Delete
Hey Zinga, using your plugin for a few weeks now, works great

THere's only one problem, if i delete the post - undelete it and then tries to delete it again I come to a page saying I don't have any privileges to do so, even tho I'm Admin.
(This post was last modified: 02-01-2011 08:02 PM by zorro.)
02-01-2011 08:02 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #46
RE: Soft Delete
Did you perform the required code edit?

My Blog
02-01-2011 08:30 PM
Find all posts by this user Quote this message in a reply
zorro Offline
Junior Member
**
Posts: 4
Joined: Jan 2011
Post: #47
RE: Soft Delete
(02-01-2011 08:30 PM)ZiNgA BuRgA Wrote:  Did you perform the required code edit?

Yes
02-02-2011 03:37 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #48
RE: Soft Delete
Sorry, forgot to ask - I presume you did the code edit before you deleted/undeleted anything, right?

Also, is the thread itself (which contains the post) approved or unapproved?

Thanks.

My Blog
02-02-2011 08:51 AM
Find all posts by this user Quote this message in a reply
OTT_Duke Offline
Junior Member
**
Posts: 6
Joined: Mar 2011
Post: #49
RE: Soft Delete
(08-27-2010 08:56 AM)ZiNgA BuRgA Wrote:  It was tested against the beta.  I haven't looked at whether it works on MyBB 1.6 final.  I assume you have?  If so, what issues are there?

EDIT: appears to work on MyBB 1.6.0 final, though I haven't tested everything.  Do note that the location of the code edit has changed:
find FIRST INSTANCE of:

PHP Code:
			if($post['threadvisible'] != 0)
			{
				++$forum_counters[$post['fid']]['num_posts'];
			}

add after:

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


Sorry, I am a little unclear.  For 1.6 the code is added inside the conditional or not? As I read this insert instruction, it seems to be indicating outside the "$post['threadvisible'] != 0" conditional.  The instructions in the OP for 1.4 though make it look like it would be inside the conditional.
03-07-2011 12:42 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #50
RE: Soft Delete
Sorry about that.  Yes, outside the conditional.  In 1.4, there is no such conditional.

Hope that helps.

My Blog
03-07-2011 05:38 PM
Find all posts by this user Quote this message in a reply


Forum Jump: