druss
01-07-2003, 12:59 AM
i have made a script that removes any inactive members that i may have in my database, the script i use is below.
open("users","$datadir/members.db");
@users = <users>;
close("users");
$member_active = "0";
$member_inactive = "0";
$time = time();
@array = split(/ +/ , localtime($time));
foreach $slot (@users) {
@info = split (/\s*\|\s*/,$slot);
if($info[7] =~ m"$array[1]") { $member_active++; }
else { $member_inactive++; }
}
the problem is this. if someone joins on the 31'st, they will be deleted the next day because the months are diffirent and thats all that my script recognises. What i want is to delete ppl once 3 months is passed, it dosent have to be accurate so long as 3 months have passed and since the localtime method displays months as text i cannot find a way to enforce this.
Can you please help me. Thanks
Goran
open("users","$datadir/members.db");
@users = <users>;
close("users");
$member_active = "0";
$member_inactive = "0";
$time = time();
@array = split(/ +/ , localtime($time));
foreach $slot (@users) {
@info = split (/\s*\|\s*/,$slot);
if($info[7] =~ m"$array[1]") { $member_active++; }
else { $member_inactive++; }
}
the problem is this. if someone joins on the 31'st, they will be deleted the next day because the months are diffirent and thats all that my script recognises. What i want is to delete ppl once 3 months is passed, it dosent have to be accurate so long as 3 months have passed and since the localtime method displays months as text i cannot find a way to enforce this.
Can you please help me. Thanks
Goran