Scoop -- the swiss army chainsaw of content management
Front Page Everything News Code Help! Wishlist Project Scoop Sites Dev Notes Latest CVS changes Development Activities
Scoop Box Exchange - Show Box: erase_user 1.00

Author: janra [Info]


erases all of a user's comments, ratings, stories, etc, and anonymizes the account. Intended for spammers. Put this box on the user info page.

Box Code:

return unless $S->have_perm('edit_user');

my $uid = $S->cgi->param('uid');
my $nick = $S->cgi->param('nick');
unless ($uid) {
$uid = $S->get_uid_from_nick($nick);
my $erase = $S->cgi->param('erase');
my $confirm = $S->cgi->param('confirm');

#warn "Nick is: $nick, uid is $uid\n";
return unless ($uid);

my $return;

if ($erase && $confirm && $uid) {
$return = "Erasing $nick...<br>";

# First, wipe user ratings
$return .= 'Wiped ratings...<br>';

# Make anonymous
my ($rv, $sth) = $S->db_update({
WHAT => "users",
SET => qq{perm_group = "Anonymous"},
WHERE => "uid = $uid"});
$return .= 'Anonymized account...<br>';

# Remove all comments
($rv, $sth) = $S->db_select({
WHAT => 'sid, cid, pid',
FROM => 'comments',
WHERE => "uid = $uid"});
my $i = 0;
my ($sid, $cid, $pid) = $sth->fetchrow();
while ($cid) {
$S->_delete_comment($sid, $cid, $pid);
($sid, $cid, $pid) = $sth->fetchrow();
$return .= "Erased $i comments...<br>";

# Hide stories
($rv, $sth) = $S->db_update({
WHAT => 'stories',
SET => "displaystatus = '-1'",
WHERE => "aid = $uid"
$return .= "Hid all stories...<br>";
$return .= "Done.";
} else {
#my $urlnick = $S->urlify($nick);
$return = qq{
<form name="eraseuser" method="GET" action="|rootdir|/erase">|norm_font|
<input type="hidden" name="nick" value="$nick">
<input type="submit" name="erase" value="Erase $nick">
<input type="checkbox" name="confirm"> Are you sure?

return $return;
Display: Sort:
Question about the /erase command (none / 0) (#1)
by dnaworks on Wed Feb 28, 2007 at 06:33:21 PM PST

Hi there - I get a 404 error trying to use this box; have I missed something to enable the /erase command?

Error (none / 0) (#2)
by Neon383 on Tue Aug 20, 2019 at 12:20:05 AM PST

I also facing an error while using this code box I don't know where I am doing mistake. The also share a video in which they explain about it's working and run it as well.

shokat (none / 0) (#3)
by vostumostu on Sat Jul 18, 2020 at 09:40:36 AM PST

I felt very happy while reading this site. This was really very informative site for me. I really liked it. This was really a cordial post. Thanks a lot!. 블로그 댓글 수동

Thanks! (none / 0) (#4)
by alfredlan217 on Tue Jun 22, 2021 at 07:09:31 AM PST

This is a great information for erasing the comments. This is very helpful for those who are looking how to erase all comments like me. Thanks! hvac companies columbia sc

Thanks (none / 0) (#5)
by LucilleM on Wed Jun 23, 2021 at 07:52:12 AM PST

Does this work? finger lakes waterfront homes for sale

Great work (none / 0) (#6)
by Jon889 on Wed Jun 23, 2021 at 07:57:28 AM PST

The code works amazingly. plant nutrition

New post (none / 0) (#7)
by aricjoshua on Mon Dec 06, 2021 at 03:55:18 AM PST

While reading this website, I was ecstatic. For me, this was a really useful website. It was fantastic. This was a very pleasant post. Thank you very much! cookie clicker

  • a by nighttop, 04/19/2022 11:58:07 PM PST (none / 0)
create account
report bugs
Scoop Administrators Guide
Scoop Box Exchange

Scoop Site Scroller: Get one yourself!
It's 4:19... do you know where your bong is?

Make a new account

Hosted by Powered by Scoop
All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest 1999 The Management

create account | faq | search