Author Topic: Mass delete Private Messages  (Read 3479 times)

Offline BrianOlsen

  • Junior Phone Loser
  • **
  • Posts: 23
  • 1337 13V3L: +0/-0
Mass delete Private Messages
« on: December 26, 2006, 02:29:17 PM »
Reverend, I have another problem.

My site just got hit by a spammer. He/she/it posted pornographic links to every board in my forum and sent more than 800 PMs to the members before I found out about it and banned the new member. Then I had to delete all those PMs. I kept thinking there should be an sql function that would mass delete all PMs by a member, only to be used in extreme situations like this, but I can't figure it out.

Anybody have any ideas? For the moment, I've suspended new memberships and with any luck I'll never have another of these slimeballs to deal with. But just in case, it would be nice to have something that I could use through phpMyAdmin to get rid of their filth.

Offline Reverend Greed

  • PLA Guru
  • *****
  • Posts: 224
  • 1337 13V3L: +42/-7
Re: Mass delete Private Messages
« Reply #1 on: December 26, 2006, 03:02:56 PM »
This situation can be remedied.  However, you've posted in an incorrect board in my opinion.  This forum is very well organized with the administrator(s) putting forth the effort and time to maintain threads and posts fall into a particular board.  You're asking for technical support as you did previously.

Will a moderator please move this topic to the appropriate board?  Thanks.
Reboot America

Offline Reverend Greed

  • PLA Guru
  • *****
  • Posts: 224
  • 1337 13V3L: +42/-7
Re: Mass delete Private Messages
« Reply #2 on: December 26, 2006, 05:56:23 PM »
This situation can be remedied.  However, you've posted in an incorrect board in my opinion.  This forum is very well organized with the administrator(s) putting forth the effort and time to maintain threads and posts fall into a particular board.  You're asking for technical support as you did previously.

Will a moderator please move this topic to the appropriate board?  Thanks.

Excellent.  The post was moved to the appropriate area.  Lets begin.  Where's your site by the way?
Reboot America

Offline BrianOlsen

  • Junior Phone Loser
  • **
  • Posts: 23
  • 1337 13V3L: +0/-0
Re: Mass delete Private Messages
« Reply #3 on: December 26, 2006, 11:40:08 PM »
Sorry about that.  The site isn't mine, I'm just helping out the webmaster.  {Edit} I decided to PM the site to you at this time incase robots collect the info.

We deleted the member and also that deleted the posts but I need to delete all the PMs he sent.
« Last Edit: December 26, 2006, 11:44:45 PM by BrianOlsen »

Offline Reverend Greed

  • PLA Guru
  • *****
  • Posts: 224
  • 1337 13V3L: +42/-7
Re: Mass delete Private Messages
« Reply #4 on: December 27, 2006, 12:08:01 AM »
Sorry about that.  The site isn't mine, I'm just helping out the webmaster.  {Edit} I decided to PM the site to you at this time incase robots collect the info.

We deleted the member and also that deleted the posts but I need to delete all the PMs he sent.

Alright.  I received the message.  Just so you know, I would strongly suggest re-doing that entire site.  It is absolutely shitty.

Anyway, the SQL command you need to run is this:

Code: [Select]
delete from `smf_personal_messages` where `ID_MEMBER_FROM`=xx
Where "xx" is the member ID number assigned when they signed up.  For example:  You are user ID# 802 on this particular forum so in phpMyAdmin you'd query this:

Code: [Select]
delete from `smf_personal_messages` where `ID_MEMBER_FROM`=802
Also, if you're ever curious how many a particular member did actually send, then you can run this SQL query prior:

Code: [Select]
SELECT count( * )
FROM `smf_personal_messages`
WHERE `ID_MEMBER_FROM` =xx

Now I'm assuming your database is using the prefix "smf_".  If not, then you'll need to change that variable.
Reboot America

Offline BrianOlsen

  • Junior Phone Loser
  • **
  • Posts: 23
  • 1337 13V3L: +0/-0
Re: Mass delete Private Messages
« Reply #5 on: December 29, 2006, 01:12:04 AM »
I just wanted to tell you Reverend Greed that you are one hell of a helper.  Everything you have showed me was perfect to perfection.

Thanks for everything and I'll make sure to contact you if I need help again.  My own mediocre attempt at humor has been highly amusing to myself.

Offline Reverend Greed

  • PLA Guru
  • *****
  • Posts: 224
  • 1337 13V3L: +42/-7
Re: Mass delete Private Messages
« Reply #6 on: December 29, 2006, 02:25:54 AM »
I just wanted to tell you Reverend Greed that you are one hell of a helper.  Everything you have showed me was perfect to perfection.

Thanks for everything and I'll make sure to contact you if I need help again.  My own mediocre attempt at humor has been highly amusing to myself.

Anytime.
Reboot America