Topic: Delete Posts via database

Hey I was recently attacked on my forum by a lot of porn bots.

I hadn't checked the forum in a while as I had been away over summer. Now i need to get it back online and going again.

I looked at the posts and everything seemed to occur almost after the 13 of August this year.

So i went into the database and deleted the posts from the post table using this command:

DELETE FROM posts WHERE posted > UNIX_TIMESTAMP('2008-08-13 10:09:20');

This then said that 200 posts had been removed. However when I went back onto the categories pages they were still there. Just the titles mind.

So i deleted the topics with a similar command.

Im not sure what I need to do now. Is there some other place the posts are stored like in a cache or something? This is so that I can update the last posted details etc. Any ideas would be greatly appreciated.

On a separate note I think I need to update my websites software to a more recent version of punBB. I am using punBB version: PunBB 1.2.15  how hard would it be to upgrade?

I really like the lightweightness of the software its soo nice to use.

Keep up the excellent work.

Matt

Gigs in Leeds

Re: Delete Posts via database

I'm having the same issue. I removed thousands of spam entries from the database, however, they are still showing up in the forum. How do I get rid of these?

Re: Delete Posts via database

Hi Derek

I think the way around it is to delete the posts file and then delete the topics files which are stored in a separate table in the database.

This removed the topics from the database however I am unable to remove it from the "Last Post" on the homepage.

It would be nice to see some easy way in the admin to select multiple posts and remove them. Eg a tick box. Same for users as I have lost of spam users.

There may be mods out there that let this happen I am not sure, i haven't looked into this yet.

Kindest regards

Matthew

Re: Delete Posts via database

See the delete_post($post_id, $topic_id) source for the correct steps of post deletion (topic deletion is nearby). Call update_forum($forum_id) to update the cached fields.

Take a look at delete.php for example.

Carpe diem