News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Delete User with Unapproved Posts

Started by Groover2, January 13, 2020, 04:45:49 PM

Previous topic - Next topic

Groover2

I have a single user that has 96,000 unapproved posts (all spam). If I delete this user through the admin interface then I still have the unapproved posts only now they are set to no user (id zero).

OK, I can recreate the user and reassign the unapproved posts using MySQL but how do I delete them in bulk?

Thanks, Andy

Kindred

When you delete the user,  choose to delete all topics and posts by that user
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Illori

Quote from: Kindred on January 13, 2020, 04:50:21 PM
When you delete the user,  choose to delete all topics and posts by that user

do note this feature only exists if you delete the user from their profile.

Groover2

Ah yes, of course - I was deleting the user in the admin interface after performing a name search, and there it doesn't show the options. However, I still have a problem. I am down to the last 870 messages and they won't delete. It appears they are unapproved topics.

If I do:

SELECT * FROM `smf_messages` WHERE `id_member` = '0' AND `approved` = '0'

the result is 870 rows. If I then do:


UPDATE `smf_messages` SET `id_member` = '75928' WHERE `id_member` = '0' AND `approved` = '0';
SELECT * FROM `smf_messages` WHERE `id_member` = '0' AND `approved` = '0'


the result is zero rows. Then I go to the profile for user 75928 and choose to delete the user and 'topics and posts', click on Delete, goes back to the forum. Then I do:

SELECT * FROM `smf_messages` WHERE `id_member` = '0' AND `approved` = '0'

and the result is 870 rows.  :(



Groover2

OK, I hacked Sources\PostModeration.php to remove the 10 post/topic limit in order to make deleting these topics easier from the admin interface (kinda annoying to hard-code values like that).

That worked until I got down to 297 unapproved topics. The admin interface shows 297 remaining but doesn't list them! Doing:

SELECT * FROM `smf_messages` WHERE `id_member` = '0' AND `approved` = '0'

gives 261 rows. What a mess.

I then ran the maintenance option to 'find and repair errors' and that got rid of them but created 260 new unapproved posts in their place. Yay.


Advertisement: