#### Delete members who've not posted for # days, #### 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 #### who have not posted for # days. # 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: 'deldatofpos' => \&deldatofpos, 'suredeldatpos' => \&suredeldatpos >> 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 who have not posted for # days
Delete all members who have not posted for days
, have posts or less and are member for more
than that amount of days. >> And the end before: print qq~~; exit; >> add: ############### delete members who've not posted for specified # of days sub deldatofpos { $numofdays = $query -> param('daytodel'); $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); $days = $numofdays * 24 * 60 * 60; $now = time; $deldate = $now - $days; $tempoutput = ""; foreach (@sortedfile) { unless ($_ eq "$ltr") { $member = $_; open (FILE, "$ikondir" . "members/" . "$_"); $todeldata = ; close (FILE); @totrash = split(/\|/,$todeldata); $lastpostdate = @totrash[14]; $registerdate = @totrash[13]; $numofmsgs = @totrash[4]; ($userinfo_POSTDATE, $userinfo_POSTURL, $userinfo_POSTTOPIC) = split(/\%%%/,$lastpostdate); if (($userinfo_POSTDATE <= $deldate)&&($registerdate<$deldate)){ if ($numofmsgs <= $numofpos) { push(@todelete,$_); $memnam = $_; $memnam =~ s/.cgi//ig; $hisdate = &longdate($userinfo_POSTDATE); $regdate = &longdate($registerdate); $tempoutput .= qq~$memnam has made his/her last post on $hisdate, has $numofmsgs posts and is member since $regdate
~; } } $ltr = "$_"; } } $todelwithcomma = qq~~; if ($tempoutput) { $continuehtml = ""; } else { $tempoutput = "Nobody fits this conditions"; $continuehtml = ""; } print qq~
These members have not posted since $deldat and will be deleted

$tempoutput $todelwithcomma $continuehtml

~; } # end route sub suredeldatpos { $todel = $query -> param('suredeldat'); @suredeldat = split(/\,/,$todel); $deleted=0; foreach $del (@suredeldat) { $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