#### Delete members with specified number of posts HACK, #### by C.v. Marle (C.A.vanMarle@inter.NL.net) #### This hack makes an extra function in the "set members" #### wich gives you the uppertunity to delete members #### with a by you specified number of posts. # Some things may differ, because I've a very modified board... # Sorry... If you can't find any thing, please mail me... # BACK-UP all your files before editing!!! # Don't blame me if your board's messed up # All the edits are done in setmembers.cgi >> Aftter: my %Mode = ( 'updatecount' => \&docount, 'viewletter' => \&viewletter, 'edit' => \&edit, 'deletemember' => \&deletemember, 'unban' => \&unban >> add this: 'delnumofpos' => \&delnumofpos, 'suredelnumpos' => \&suredelnumpos >> and add a , [comma] after &unban >> after: foreach (@sortedletters) { unless ($_ eq "$ltr") { $tempoutput .= qq~ $_ ~; $ltr = "$_"; } } print qq~ Current Member Sections:

$tempoutput >> add:

Delete all members with a specified number of posts
Delete all members with or less posts >> And the end before: print qq~~; exit; >> add: ############### delete members with specified number of posts sub delnumofpos { $numofpos = $query -> param('numberofposts'); $dirtoopen = "$ikondir" . "members"; opendir (DIR, "$dirtoopen"); @filedata = readdir(DIR); closedir (DIR); @sortedfile = sort(@filedata); @sortedfile = grep(/cgi/,@sortedfile); @sortedfile = sort alphabetically(@sortedfile); foreach (@sortedfile) { unless ($_ eq "$ltr") { open (FILE, "$ikondir" . "members/" . "$_"); $todeldata = ; close (FILE); @totrash = split(/\|/,$todeldata); $numofmsgs = @totrash[4]; if ($numofmsgs <= $numofpos) { push(@todelete,$_); $memnam = $_; $memnam =~ s/.cgi//ig; $tempoutput .= qq~$memnam has made $numofmsgs posts
~; } $ltr = "$_"; } } $todelwithcomma = qq~~; print qq~
These members have $numofpos or less posts and will be deleted

$tempoutput $todelwithcomma

~; } # end route sub suredelnumpos { $todel = $query -> param('tosuredel'); @tosuredel = split(/\,/,$todel); $deleted=0; foreach $del (@tosuredel) { $dele = $del; $dele =~ s/.cgi//ig; $tempoutput .= qq~$dele

~; $filetounlink = "$ikondir" . "members/$del"; unlink $filetounlink; $deleted++; } require "$ikondir" . "data/boardstats.cgi"; $newtotalmembers = $totalmembers - $deleted; $filetomake = "$ikondir" . "data/boardstats.cgi"; open(FILE, ">$filetomake"); flock(FILE, 2); print FILE "\$lastregisteredmember = \"$lastregisteredmember\"\;\n"; print FILE "\$totalmembers = \"$newtotalmembers\"\;\n"; print FILE "\$totalthreads = \"$totalthreads\"\;\n"; print FILE "\$totalposts = \"$totalposts\"\;\n"; print FILE "\n1\;"; close (FILE); print qq~ These members have been deleted

$tempoutput ~; } # end route # I think that should do it... ;) # Mzzl, Chris # P.S. if you find any bugs/errors please send me an e-mail