Now and then I got spammers on my site leaving a lot of junk.
When removing a member/spammer the shouts are not automatically deleted. Very annoying. :@
This is because the developers of php fusion decided NOT to include the shoutbox in the core anymore but offer it as an separate infusion/add on. After that point the automatic cleanup was lost.
How to fix that?
Open /administration/members.php and find:
GeSHi: PHP
// Delete content
$result= dbquery("DELETE FROM ".DB_USERS." WHERE user_id='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_ARTICLES." WHERE article_name='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_COMMENTS." WHERE comment_name='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_MESSAGES." WHERE message_to='".$user_id."' OR message_from='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_NEWS." WHERE news_name='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_POLL_VOTES." WHERE vote_user='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_RATINGS." WHERE rating_user='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_SUSPENDS." WHERE suspended_user='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_THREADS." WHERE thread_author='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_POSTS." WHERE post_author='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_THREAD_NOTIFY." WHERE notify_user='".$user_id."'");
redirect(USER_MANAGEMENT_SELF."&status=dok");
Parsed in 0.019 seconds, using GeSHi 1.0.8.10
Add the second last line so it looks like this:
GeSHi: PHP
// Delete content
$result= dbquery("DELETE FROM ".DB_USERS." WHERE user_id='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_ARTICLES." WHERE article_name='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_COMMENTS." WHERE comment_name='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_MESSAGES." WHERE message_to='".$user_id."' OR message_from='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_NEWS." WHERE news_name='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_POLL_VOTES." WHERE vote_user='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_RATINGS." WHERE rating_user='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_SUSPENDS." WHERE suspended_user='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_THREADS." WHERE thread_author='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_POSTS." WHERE post_author='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_THREAD_NOTIFY." WHERE notify_user='".$user_id."'");
$result= dbquery("DELETE IGNORE FROM ".DB_PREFIX."shoutbox WHERE shout_name='".$user_id."'");// Mod Wanabo. Don't enable user field shoutbox if you don't have this table
redirect(USER_MANAGEMENT_SELF."&status=dok");
Parsed in 0.010 seconds, using GeSHi 1.0.8.10
Why the DELETE IGNORE FROM?
In this way it is safe to make the modification. The ignore statement is just there to ensure no errors are produced in case you haven't infused the shoutbox and therefore no shoutbox tables exists.
Update:
It appears that also submission are left behind when you delete a user.
Update members.php with the following line:
GeSHi: PHP
$result= dbquery("DELETE FROM ".DB_SUBMISSIONS." WHERE submit_user='".$user_id."'");// Mod Wanabo. No need for IGNORE because this table exists in the core.
Parsed in 0.008 seconds, using GeSHi 1.0.8.10
Together with the cleanup for the shoutbox it would look like this:
GeSHi: PHP
// Delete content
$result= dbquery("DELETE FROM ".DB_USERS." WHERE user_id='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_ARTICLES." WHERE article_name='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_COMMENTS." WHERE comment_name='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_MESSAGES." WHERE message_to='".$user_id."' OR message_from='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_NEWS." WHERE news_name='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_POLL_VOTES." WHERE vote_user='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_RATINGS." WHERE rating_user='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_SUSPENDS." WHERE suspended_user='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_THREADS." WHERE thread_author='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_POSTS." WHERE post_author='".$user_id."'");
$result= dbquery("DELETE FROM ".DB_THREAD_NOTIFY." WHERE notify_user='".$user_id."'");
$result= dbquery("DELETE IGNORE FROM ".DB_PREFIX."shoutbox WHERE shout_name='".$user_id."'");// Mod Wanabo. Don't enable user field shoutbox if you don't have this table
$result= dbquery("DELETE FROM ".DB_SUBMISSIONS." WHERE submit_user='".$user_id."'");// Mod Wanabo. No need for IGNORE because this table exists in the core.
Warning about ParkingCrew.com! Case: ParkingCrew.com acquires NameDrive.com but earnings are not transferred despite assurances and promises. Inquiries about this are ignored! It's just a con compagny. Don't do business with them!
Jump to Forum
Gebruik BBcode of HTML om naar; 'Remove member/spammer including shoutbox posts and submissions', te verwijzen!