News:

Wondering if this will always be free?  See why free is better.

Main Menu

Deleting posts by member

Started by frankliustart, May 19, 2006, 05:04:30 PM

Previous topic - Next topic

frankliustart

SMF Version: SMF 1.1 RC2
Hi, is there a way to delete all posts posted by the same member by a admin function? or do i have to delete them one by one?
(I got spammed) :(

Thanks

Oldiesmann

Put this script in your forum directory and run it...

<?php
include_once('SSI.php');
include_once(
$sourcedir . '/RemoveTopic.php');

// Find all the spammer's posts...
$query = db_query("SELECT ID_MSG FROM {$db_prefix}messages WHERE posterName = 'somespammer'", __FILE__, __LINE__);

// ... and remove them
while($results = mysql_fetch_row($query))
{
   
removeMessage($results[0]);
}

?>


Notes:
Replace somespammer with the name of the person who spammed you
Make sure you're logged in to your forum before you do this - the removeMessage function includes permission checks so you'll be told you aren't allowed to do that if you aren't logged in.
Michael Eshom
Christian Metal Fans

frankliustart

sorry, i am really really horrible at coding. Where's the forum directory?

Kindred

copy that script into a text file called "remove_posts.php"
upload the text file to your server in the same location that you have SMF installed in...

go to your forum
In your browser, edit the url in the browser address bar and replace index.php with remove_posts.php
Сл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."

frankliustart


Advertisement: