#### Delete members who've not posted for # days UPDATE!!!, #### 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. #### -->>-->>UPDATE<<--<<-- #### Now You Can Specify Number Of Posts TOO # 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 >> change:
Delete all members who have not posted for # days
Delete all members who have not posted for days >> to:
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. >> change: ############### delete members who've not posted for specified # of days sub deldatofpos { $numofdays = $query -> param('daytodel'); $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; foreach (@sortedfile) { unless ($_ eq "$ltr") { $member = $_; open (FILE, "$ikondir" . "members/" . "$_"); $todeldata = ; close (FILE); @totrash = split(/\|/,$todeldata); $lastpostdate = @totrash[14]; ($userinfo_POSTDATE, $userinfo_POSTURL, $userinfo_POSTTOPIC) = split(/\%%%/,$lastpostdate); if ($userinfo_POSTDATE <= $deldate) { push(@todelete,$_); $memnam = $_; $memnam =~ s/.cgi//ig; $hisdate = &longdate($userinfo_POSTDATE); $tempoutput .= qq~$memnam has made his/her last post on $hisdate
~; } $ltr = "$_"; } } $todelwithcomma = qq~~; print qq~
These members have not posted since $deldat and will be deleted

$tempoutput $todelwithcomma

~; } # end route >> to: ############### 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 # I think that should do it... ;) # Mzzl, Chris # P.S. if you find any bugs/errors please send me an e-mail