MyBB Community Forums

Full Version: Deleting a members with all their posts!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi

Can make u an option that with deleting a member, to have a option to delete also all their posts?

Refresh this topic...

No need to refresh it, you have just posted it this morning.

This option isn't yet a feature in mybb, you will need a modification.

I'll try to find some time to test a script for that.

regards
Go to admin/users.php
find:
$db->query("DELETE FROM ".TABLE_PREFIX."sessions WHERE uid='".intval($mybb->input['uid'])."'");
add after:
$db->query("DELETE FROM ".TABLE_PREFIX."posts WHERE uid='".intval($mybb->input['uid'])."'");
And your done Smile

This will delete all users when you delete that user, however it's not an option it does it on every delete.
You'll have to delete threads, PMs, subscriptions, etc., too.
Use this then instead.
$db->query("DELETE FROM ".TABLE_PREFIX."posts WHERE uid='".intval($mybb->input['uid'])."'");
$db->query("DELETE FROM ".TABLE_PREFIX."threadratings WHERE uid='".intval($mybb->input['uid'])."'");
$db->query("DELETE FROM ".TABLE_PREFIX."pollvotes WHERE uid='".intval($mybb->input['uid'])."'");
$db->query("DELETE FROM ".TABLE_PREFIX."searchlog WHERE uid='".intval($mybb->input['uid'])."'");
$db->query("DELETE FROM ".TABLE_PREFIX."attachments WHERE uid='".intval($mybb->input['uid'])."'");
$db->query("DELETE FROM ".TABLE_PREFIX."threadsread WHERE uid='".intval($mybb->input['uid'])."'");
But PMs and Subscriptions is already deleted by default.

All I could think of.
If you delete threads, you'll also have to delete the posts by other people of those threads.
Oh, and it shouldn't be necessary anyways since an thread is added as an post as well. *deletes it*
ofcourse the posts should be deleted because they wont appear anywhere anymore, at the same time will keep counting into the members' post count

regards
What? I said the thread shouldn't need to be deleted since it gets deleted with the posts.. :|
Pages: 1 2