Gossamer Forum
Home : Products : Links 2.0 : Customization :

nph-expired with 30 days notice

Quote Reply
nph-expired with 30 days notice
Hi

I'd like to provide 30 days notice before I expire a link. In nph-expired, it only sends out an email and deletes the link on the expiration day. Having a 30-day notice would be a little more practical than just expiring the link and sending out an obituary.

Would someone know how to build in a 30-day (or howevermany-days) email notice into the script, and still do the expiration on the correct day if needed?

Here's the sub that I believe applies:

In Reply To:
sub expired_links {

my ($mode, $message) = @_;
my (@expired, @num_days);
my ($numhits, $maxhits, $days, $i) = 0;

open (DB, "<$db_file_name") or &cgierr("error in $ENV{'SCRIPT_NAME'}. unable to open database: $db_file_name. Reason: $!");
flock (DB, 1) if ($db_use_flock);
LINE: while (<DB>) {
/^#/ and next LINE;
/^\s*$/ and next LINE;
chomp;
@values = &split_decode($_);
next LINE if (!$values[$db_modified]);

$days = &days_old($values[$db_modified], $date);

if (($days > $values[$db_expire]) && ($values[$db_expire] > 0)) {
push(@expired, @values);
push(@num_days, ($days - $values[$db_expire]));
}
}
close DB;
$numhits = ($#expired+1) / ($#db_cols+1);
I think it would go somewhere in here, but I'm not certain:

In Reply To:
if (($days > $values[$db_expire]) && ($values[$db_expire] > 0)) {
push(@expired, @values);
push(@num_days, ($days - $values[$db_expire]));
Many thanks for your help.

DT

Quote Reply
Re: nph-expired with 30 days notice In reply to
Or, it could be the way that $days is defined:

In Reply To:
$days = &days_old($values[$db_modified], $date);
I've been fooling around with the < > symbols, and I've also been trying to add/subtract 30 days in there some where. But, so far, the results have not provided only those links with 30 days or less to go.

Thanks.



Quote Reply
Re: nph-expired with 30 days notice In reply to
Just bringing 'er to the top.

Still haven't gotten this guy to provide 30 days notice of cancellation.

DT

Quote Reply
Re: [DogTags] nph-expired with 30 days notice In reply to
Has anyone found a solution?